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 | ;; |
| 503 | esac |
| 504 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 505 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 506 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 507 | */server5*|\ |
| 508 | */server7*|\ |
| 509 | */dir-maxpath*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 510 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 511 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 512 | # In case of TLS13 the support for ECDSA is enough |
| 513 | requires_pk_alg "ECDSA" |
| 514 | else |
| 515 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 516 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 517 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 518 | # key exchange is required. However gnutls also does not |
| 519 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 520 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 521 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 522 | else |
| 523 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 524 | fi |
| 525 | elif [ "$ROLE" = "client" ]; then |
| 526 | # On the client side it is enough to have any certificate |
| 527 | # based authentication together with support for ECDSA. |
| 528 | # Of course the GnuTLS limitation mentioned above applies |
| 529 | # also here. |
| 530 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 531 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 532 | else |
| 533 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 534 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 535 | requires_pk_alg "ECDSA" |
| 536 | fi |
| 537 | fi |
| 538 | ;; |
| 539 | esac |
| 540 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 541 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 542 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 543 | */server1*|\ |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 544 | */server2*|\ |
| 545 | */server7*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 546 | requires_certificate_authentication |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 547 | # Certificates with an RSA key. The algorithm requirement is |
| 548 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 549 | # PSS signature}. We can't easily tell which subset works, and |
| 550 | # we aren't currently running ssl-opt.sh in configurations |
| 551 | # where partial RSA support is a problem, so generically, we |
| 552 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 553 | requires_config_enabled "MBEDTLS_RSA_C" |
| 554 | esac |
| 555 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 556 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 557 | } |
| 558 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 559 | adapt_cmd_for_psk () { |
| 560 | case "$2" in |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 561 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 562 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 6f9952a | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 563 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 564 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 565 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 566 | esac |
| 567 | eval $1='"$2 $s"' |
| 568 | unset s |
| 569 | } |
| 570 | |
| 571 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 572 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 573 | # |
| 574 | # If not running in a PSK-only build, do nothing. |
| 575 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 576 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 577 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 578 | # a pre-shared key, do nothing. |
| 579 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 580 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 581 | # |
| 582 | # Inputs: |
| 583 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 584 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 585 | # * "$@": options passed to run_test. |
| 586 | # |
| 587 | # Outputs: |
| 588 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 589 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 590 | maybe_adapt_for_psk() { |
| 591 | if [ "$PSK_ONLY" != "YES" ]; then |
| 592 | return |
| 593 | fi |
| 594 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 595 | return |
| 596 | fi |
| 597 | case "$CLI_CMD $SRV_CMD" in |
| 598 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 599 | return;; |
| 600 | *force_ciphersuite*) |
| 601 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 602 | # PSK cipher suite could be substituted, but we're not ready for |
| 603 | # that yet. |
| 604 | SKIP_NEXT="YES" |
| 605 | return;; |
| 606 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 607 | # The test case involves certificates. PSK won't do. |
| 608 | SKIP_NEXT="YES" |
| 609 | return;; |
| 610 | esac |
| 611 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 612 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 613 | } |
| 614 | |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 615 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 616 | # one PSK key exchange mode. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 617 | PSK_PRESENT="NO" |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 618 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 619 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 620 | PSK_ONLY="" |
| 621 | for c in $CONFIGS_ENABLED; do |
| 622 | case $c in |
| 623 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 2dd4395 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 624 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 625 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 626 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 627 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 628 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 629 | esac |
| 630 | done |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 631 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 632 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 633 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 634 | # the edge case of no key exchanges. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 635 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 636 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 637 | |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 638 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 639 | HAS_ALG_SHA_1="NO" |
| 640 | HAS_ALG_SHA_224="NO" |
| 641 | HAS_ALG_SHA_256="NO" |
| 642 | HAS_ALG_SHA_384="NO" |
| 643 | HAS_ALG_SHA_512="NO" |
| 644 | |
| 645 | check_for_hash_alg() |
| 646 | { |
| 647 | CURR_ALG="INVALID"; |
| 648 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 649 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 650 | USE_PSA="YES"; |
| 651 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 652 | if [ $USE_PSA = "YES" ]; then |
| 653 | CURR_ALG=PSA_WANT_ALG_${1} |
| 654 | else |
| 655 | CURR_ALG=MBEDTLS_${1}_C |
| 656 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 657 | # MD5 is an exception to this convention |
| 658 | if [ "${1}" != "MD5" ]; then |
| 659 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 660 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 661 | fi |
| 662 | |
| 663 | case $CONFIGS_ENABLED in |
| 664 | *" $CURR_ALG"[\ =]*) |
| 665 | return 0 |
| 666 | ;; |
| 667 | *) :;; |
| 668 | esac |
| 669 | return 1 |
| 670 | } |
| 671 | |
| 672 | populate_enabled_hash_algs() |
| 673 | { |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 674 | 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] | 675 | if check_for_hash_alg "$hash_alg"; then |
| 676 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 677 | eval ${hash_alg_variable}=YES |
| 678 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 679 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 680 | } |
| 681 | |
| 682 | # skip next test if the given hash alg is not supported |
| 683 | requires_hash_alg() { |
| 684 | HASH_DEFINE="Invalid" |
| 685 | HAS_HASH_ALG="NO" |
| 686 | case $1 in |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 687 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 688 | SHA_1):;; |
| 689 | SHA_224):;; |
| 690 | SHA_256):;; |
| 691 | SHA_384):;; |
| 692 | SHA_512):;; |
| 693 | *) |
| 694 | echo "Unsupported hash alg - $1" |
| 695 | exit 1 |
| 696 | ;; |
| 697 | esac |
| 698 | |
| 699 | HASH_DEFINE=HAS_ALG_${1} |
| 700 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 701 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 702 | then |
| 703 | SKIP_NEXT="YES" |
| 704 | fi |
| 705 | } |
| 706 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 707 | # Skip next test if the given pk alg is not enabled |
| 708 | requires_pk_alg() { |
| 709 | case $1 in |
| 710 | ECDSA) |
| 711 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 712 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 713 | else |
| 714 | requires_config_enabled MBEDTLS_ECDSA_C |
| 715 | fi |
| 716 | ;; |
| 717 | *) |
| 718 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 719 | exit 1 |
| 720 | ;; |
| 721 | esac |
| 722 | } |
| 723 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 724 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 725 | requires_openssl_with_fallback_scsv() { |
| 726 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 727 | 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] | 728 | then |
| 729 | OPENSSL_HAS_FBSCSV="YES" |
| 730 | else |
| 731 | OPENSSL_HAS_FBSCSV="NO" |
| 732 | fi |
| 733 | fi |
| 734 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 735 | SKIP_NEXT="YES" |
| 736 | fi |
| 737 | } |
| 738 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 739 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 740 | requires_max_content_len() { |
| 741 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 742 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 743 | } |
| 744 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 745 | # skip next test if GnuTLS isn't available |
| 746 | requires_gnutls() { |
| 747 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 748 | 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] | 749 | GNUTLS_AVAILABLE="YES" |
| 750 | else |
| 751 | GNUTLS_AVAILABLE="NO" |
| 752 | fi |
| 753 | fi |
| 754 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 755 | SKIP_NEXT="YES" |
| 756 | fi |
| 757 | } |
| 758 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 759 | # skip next test if GnuTLS-next isn't available |
| 760 | requires_gnutls_next() { |
| 761 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 762 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 763 | GNUTLS_NEXT_AVAILABLE="YES" |
| 764 | else |
| 765 | GNUTLS_NEXT_AVAILABLE="NO" |
| 766 | fi |
| 767 | fi |
| 768 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 769 | SKIP_NEXT="YES" |
| 770 | fi |
| 771 | } |
| 772 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 773 | requires_openssl_next() { |
| 774 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 775 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 776 | OPENSSL_NEXT_AVAILABLE="YES" |
| 777 | else |
| 778 | OPENSSL_NEXT_AVAILABLE="NO" |
| 779 | fi |
| 780 | fi |
| 781 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 782 | SKIP_NEXT="YES" |
| 783 | fi |
| 784 | } |
| 785 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 786 | # skip next test if openssl version is lower than 3.0 |
| 787 | requires_openssl_3_x() { |
| 788 | requires_openssl_next |
| 789 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 790 | OPENSSL_3_X_AVAILABLE="NO" |
| 791 | fi |
| 792 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 793 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 794 | then |
| 795 | OPENSSL_3_X_AVAILABLE="YES" |
| 796 | else |
| 797 | OPENSSL_3_X_AVAILABLE="NO" |
| 798 | fi |
| 799 | fi |
| 800 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 801 | SKIP_NEXT="YES" |
| 802 | fi |
| 803 | } |
| 804 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 805 | # skip next test if openssl does not support ffdh keys |
| 806 | requires_openssl_tls1_3_with_ffdh() { |
| 807 | requires_openssl_3_x |
| 808 | } |
| 809 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 810 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 811 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 812 | requires_openssl_next |
| 813 | |
| 814 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 815 | requires_openssl_tls1_3_with_ffdh |
| 816 | fi |
| 817 | } |
| 818 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 819 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 820 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 821 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 822 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 823 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 824 | fi |
| 825 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 826 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 827 | then |
| 828 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 829 | else |
| 830 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 831 | fi |
| 832 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 833 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 834 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 835 | fi |
| 836 | } |
| 837 | |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 838 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 839 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 840 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 841 | case $($OPENSSL s_server -help 2>&1) in |
| 842 | *-client_renegotiation*) |
| 843 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 844 | esac |
| 845 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 846 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 847 | requires_gnutls_tls1_3() { |
| 848 | requires_gnutls_next |
| 849 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 850 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 851 | fi |
| 852 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 853 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 854 | then |
| 855 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 856 | else |
| 857 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 858 | fi |
| 859 | fi |
| 860 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 861 | SKIP_NEXT="YES" |
| 862 | fi |
| 863 | } |
| 864 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 865 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 866 | requires_gnutls_next_no_ticket() { |
| 867 | requires_gnutls_next |
| 868 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 869 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 870 | fi |
| 871 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 872 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 873 | then |
| 874 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 875 | else |
| 876 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 877 | fi |
| 878 | fi |
| 879 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 880 | SKIP_NEXT="YES" |
| 881 | fi |
| 882 | } |
| 883 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 884 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 885 | requires_gnutls_next_disable_tls13_compat() { |
| 886 | requires_gnutls_next |
| 887 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 888 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 889 | fi |
| 890 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 891 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 892 | then |
| 893 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 894 | else |
| 895 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 896 | fi |
| 897 | fi |
| 898 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 899 | SKIP_NEXT="YES" |
| 900 | fi |
| 901 | } |
| 902 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 903 | # skip next test if GnuTLS does not support the record size limit extension |
| 904 | requires_gnutls_record_size_limit() { |
| 905 | requires_gnutls_next |
| 906 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 907 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 908 | else |
| 909 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 910 | fi |
| 911 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 912 | SKIP_NEXT="YES" |
| 913 | fi |
| 914 | } |
| 915 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 916 | # skip next test if IPv6 isn't available on this host |
| 917 | requires_ipv6() { |
| 918 | if [ -z "${HAS_IPV6:-}" ]; then |
| 919 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 920 | SRV_PID=$! |
| 921 | sleep 1 |
| 922 | kill $SRV_PID >/dev/null 2>&1 |
| 923 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 924 | HAS_IPV6="NO" |
| 925 | else |
| 926 | HAS_IPV6="YES" |
| 927 | fi |
| 928 | rm -r $SRV_OUT |
| 929 | fi |
| 930 | |
| 931 | if [ "$HAS_IPV6" = "NO" ]; then |
| 932 | SKIP_NEXT="YES" |
| 933 | fi |
| 934 | } |
| 935 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 936 | # skip next test if it's i686 or uname is not available |
| 937 | requires_not_i686() { |
| 938 | if [ -z "${IS_I686:-}" ]; then |
| 939 | IS_I686="YES" |
| 940 | if which "uname" >/dev/null 2>&1; then |
| 941 | if [ -z "$(uname -a | grep i686)" ]; then |
| 942 | IS_I686="NO" |
| 943 | fi |
| 944 | fi |
| 945 | fi |
| 946 | if [ "$IS_I686" = "YES" ]; then |
| 947 | SKIP_NEXT="YES" |
| 948 | fi |
| 949 | } |
| 950 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 951 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 952 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 953 | 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] | 954 | if [ "$LIST_TESTS" -eq 0 ];then |
| 955 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 956 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 957 | # Calculate the maximum content length that fits both |
| 958 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 959 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 960 | fi |
| 961 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 962 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 963 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 964 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 965 | # skip the next test if the SSL output buffer is less than 16KB |
| 966 | requires_full_size_output_buffer() { |
| 967 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 968 | SKIP_NEXT="YES" |
| 969 | fi |
| 970 | } |
| 971 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 972 | # skip the next test if valgrind is in use |
| 973 | not_with_valgrind() { |
| 974 | if [ "$MEMCHECK" -gt 0 ]; then |
| 975 | SKIP_NEXT="YES" |
| 976 | fi |
| 977 | } |
| 978 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 979 | # skip the next test if valgrind is NOT in use |
| 980 | only_with_valgrind() { |
| 981 | if [ "$MEMCHECK" -eq 0 ]; then |
| 982 | SKIP_NEXT="YES" |
| 983 | fi |
| 984 | } |
| 985 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 986 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 987 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 988 | CLI_DELAY_FACTOR=$1 |
| 989 | } |
| 990 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 991 | # wait for the given seconds after the client finished in the next test |
| 992 | server_needs_more_time() { |
| 993 | SRV_DELAY_SECONDS=$1 |
| 994 | } |
| 995 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 996 | # print_name <name> |
| 997 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 998 | TESTS=$(( $TESTS + 1 )) |
| 999 | LINE="" |
| 1000 | |
| 1001 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 1002 | LINE="$TESTS " |
| 1003 | fi |
| 1004 | |
| 1005 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1006 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 1007 | printf "%s " "$LINE" |
| 1008 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 1009 | for i in `seq 1 $LEN`; do printf '.'; done |
| 1010 | printf ' ' |
| 1011 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1012 | } |
| 1013 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1014 | # record_outcome <outcome> [<failure-reason>] |
| 1015 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1016 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1017 | record_outcome() { |
| 1018 | echo "$1" |
| 1019 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1020 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1021 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1022 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1023 | "$1" "${2-}" \ |
| 1024 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1025 | fi |
| 1026 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1027 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1028 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1029 | # True if the presence of the given pattern in a log definitely indicates |
| 1030 | # that the test has failed. False if the presence is inconclusive. |
| 1031 | # |
| 1032 | # Inputs: |
| 1033 | # * $1: pattern found in the logs |
| 1034 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1035 | # |
| 1036 | # Outputs: |
| 1037 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1038 | # unchanged otherwise. |
| 1039 | # * Return value: 1 if the pattern is inconclusive, |
| 1040 | # 0 if the failure is definitive. |
| 1041 | log_pattern_presence_is_conclusive() { |
| 1042 | # If we've run out of attempts, then don't retry no matter what. |
| 1043 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1044 | return 0 |
| 1045 | fi |
| 1046 | case $1 in |
| 1047 | "resend") |
| 1048 | # An undesired resend may have been caused by the OS dropping or |
| 1049 | # delaying a packet at an inopportune time. |
| 1050 | outcome="RETRY(resend)" |
| 1051 | return 1;; |
| 1052 | esac |
| 1053 | } |
| 1054 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1055 | # fail <message> |
| 1056 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1057 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1058 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1059 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1060 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1061 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1062 | if [ -n "$PXY_CMD" ]; then |
| 1063 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1064 | fi |
| 1065 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1066 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1067 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1068 | echo " ! server output:" |
| 1069 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1070 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1071 | echo " ! client output:" |
| 1072 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1073 | if [ -n "$PXY_CMD" ]; then |
| 1074 | echo " ! ========================================================" |
| 1075 | echo " ! proxy output:" |
| 1076 | cat o-pxy-${TESTS}.log |
| 1077 | fi |
| 1078 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1079 | fi |
| 1080 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1081 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1082 | } |
| 1083 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1084 | # is_polar <cmd_line> |
| 1085 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1086 | case "$1" in |
| 1087 | *ssl_client2*) true;; |
| 1088 | *ssl_server2*) true;; |
| 1089 | *) false;; |
| 1090 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1091 | } |
| 1092 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1093 | # openssl s_server doesn't have -www with DTLS |
| 1094 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1095 | case "$SRV_CMD" in |
| 1096 | *s_server*-dtls*) |
| 1097 | NEEDS_INPUT=1 |
| 1098 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1099 | *) NEEDS_INPUT=0;; |
| 1100 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1101 | } |
| 1102 | |
| 1103 | # provide input to commands that need it |
| 1104 | provide_input() { |
| 1105 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1106 | return |
| 1107 | fi |
| 1108 | |
| 1109 | while true; do |
| 1110 | echo "HTTP/1.0 200 OK" |
| 1111 | sleep 1 |
| 1112 | done |
| 1113 | } |
| 1114 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1115 | # has_mem_err <log_file_name> |
| 1116 | has_mem_err() { |
| 1117 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1118 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1119 | then |
| 1120 | return 1 # false: does not have errors |
| 1121 | else |
| 1122 | return 0 # true: has errors |
| 1123 | fi |
| 1124 | } |
| 1125 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1126 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1127 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1128 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1129 | newline=' |
| 1130 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1131 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1132 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1133 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1134 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1135 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1136 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1137 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1138 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1139 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1140 | # When we use a proxy, it will be listening on the same port we |
| 1141 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1142 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1143 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1144 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1145 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1146 | echo "$3 START TIMEOUT" |
| 1147 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1148 | break |
| 1149 | fi |
| 1150 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1151 | # OSes this may be a tight loop. |
| 1152 | sleep 0.1 2>/dev/null || true |
| 1153 | done |
| 1154 | } |
| 1155 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1156 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1157 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1158 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1159 | } |
| 1160 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1161 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1162 | # Wait for server process $2 to be listening on port $1. |
| 1163 | wait_server_start() { |
| 1164 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1165 | } |
| 1166 | |
| 1167 | # Wait for proxy process $2 to be listening on port $1. |
| 1168 | wait_proxy_start() { |
| 1169 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1170 | } |
| 1171 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1172 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1173 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1174 | # acceptable bounds |
| 1175 | check_server_hello_time() { |
| 1176 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 1177 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1178 | # Get the Unix timestamp for now |
| 1179 | CUR_TIME=$(date +'%s') |
| 1180 | THRESHOLD_IN_SECS=300 |
| 1181 | |
| 1182 | # Check if the ServerHello time was printed |
| 1183 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1184 | return 1 |
| 1185 | fi |
| 1186 | |
| 1187 | # Check the time in ServerHello is within acceptable bounds |
| 1188 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1189 | # The time in ServerHello is at least 5 minutes before now |
| 1190 | return 1 |
| 1191 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1192 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1193 | return 1 |
| 1194 | else |
| 1195 | return 0 |
| 1196 | fi |
| 1197 | } |
| 1198 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1199 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1200 | handshake_memory_get() { |
| 1201 | OUTPUT_VARIABLE="$1" |
| 1202 | OUTPUT_FILE="$2" |
| 1203 | |
| 1204 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1205 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1206 | |
| 1207 | # Check if memory usage was read |
| 1208 | if [ -z "$MEM_USAGE" ]; then |
| 1209 | echo "Error: Can not read the value of handshake memory usage" |
| 1210 | return 1 |
| 1211 | else |
| 1212 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1213 | return 0 |
| 1214 | fi |
| 1215 | } |
| 1216 | |
| 1217 | # Get handshake memory usage from server or client output and check if this value |
| 1218 | # is not higher than the maximum given by the first argument |
| 1219 | handshake_memory_check() { |
| 1220 | MAX_MEMORY="$1" |
| 1221 | OUTPUT_FILE="$2" |
| 1222 | |
| 1223 | # Get memory usage |
| 1224 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1225 | return 1 |
| 1226 | fi |
| 1227 | |
| 1228 | # Check if memory usage is below max value |
| 1229 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1230 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1231 | "but should be below $MAX_MEMORY bytes" |
| 1232 | return 1 |
| 1233 | else |
| 1234 | return 0 |
| 1235 | fi |
| 1236 | } |
| 1237 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1238 | # wait for client to terminate and set CLI_EXIT |
| 1239 | # must be called right after starting the client |
| 1240 | wait_client_done() { |
| 1241 | CLI_PID=$! |
| 1242 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1243 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1244 | CLI_DELAY_FACTOR=1 |
| 1245 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1246 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1247 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1248 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1249 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1250 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1251 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1252 | CLI_EXIT=$? |
| 1253 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1254 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1255 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1256 | |
| 1257 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1258 | |
| 1259 | sleep $SRV_DELAY_SECONDS |
| 1260 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1261 | } |
| 1262 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1263 | # check if the given command uses dtls and sets global variable DTLS |
| 1264 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1265 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1266 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1267 | *) DTLS=0;; |
| 1268 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1269 | } |
| 1270 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1271 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1272 | is_gnutls() { |
| 1273 | case "$1" in |
| 1274 | *gnutls-cli*) |
| 1275 | CMD_IS_GNUTLS=1 |
| 1276 | ;; |
| 1277 | *gnutls-serv*) |
| 1278 | CMD_IS_GNUTLS=1 |
| 1279 | ;; |
| 1280 | *) |
| 1281 | CMD_IS_GNUTLS=0 |
| 1282 | ;; |
| 1283 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1284 | } |
| 1285 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1286 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1287 | # and this limit the tests that can be run with them. This function checks server |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1288 | # and client command lines, given as input, to verify if the current test |
| 1289 | # is using one of these tools. |
| 1290 | use_ext_tool_without_ecdh_support() { |
| 1291 | case "$1" in |
| 1292 | *$GNUTLS_SERV*|\ |
| 1293 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1294 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1295 | echo "yes" |
| 1296 | return;; |
| 1297 | esac |
| 1298 | case "$2" in |
| 1299 | *$GNUTLS_CLI*|\ |
| 1300 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1301 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1302 | echo "yes" |
| 1303 | return;; |
| 1304 | esac |
| 1305 | echo "no" |
| 1306 | } |
| 1307 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1308 | # Generate random psk_list argument for ssl_server2 |
| 1309 | get_srv_psk_list () |
| 1310 | { |
| 1311 | case $(( TESTS % 3 )) in |
| 1312 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1313 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1314 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1315 | esac |
| 1316 | } |
| 1317 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1318 | # Determine what calc_verify trace is to be expected, if any. |
| 1319 | # |
| 1320 | # calc_verify is only called for two things: to calculate the |
| 1321 | # extended master secret, and to process client authentication. |
| 1322 | # |
| 1323 | # Warning: the current implementation assumes that extended_ms is not |
| 1324 | # disabled on the client or on the server. |
| 1325 | # |
| 1326 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1327 | # * $1: the value of the server auth_mode parameter. |
| 1328 | # 'required' if client authentication is expected, |
| 1329 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1330 | # * $CONFIGS_ENABLED |
| 1331 | # |
| 1332 | # Outputs: |
| 1333 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1334 | set_maybe_calc_verify() { |
| 1335 | maybe_calc_verify= |
| 1336 | case $CONFIGS_ENABLED in |
| 1337 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1338 | *) |
| 1339 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1340 | ''|none) return;; |
| 1341 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1342 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1343 | esac |
| 1344 | esac |
| 1345 | case $CONFIGS_ENABLED in |
| 1346 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1347 | *) maybe_calc_verify="<= calc verify";; |
| 1348 | esac |
| 1349 | } |
| 1350 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1351 | # Compare file content |
| 1352 | # Usage: find_in_both pattern file1 file2 |
| 1353 | # extract from file1 the first line matching the pattern |
| 1354 | # check in file2 that the same line can be found |
| 1355 | find_in_both() { |
| 1356 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1357 | if [ -z "$srv_pattern" ]; then |
| 1358 | return 1; |
| 1359 | fi |
| 1360 | |
| 1361 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1362 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1363 | else |
| 1364 | return 1; |
| 1365 | fi |
| 1366 | } |
| 1367 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1368 | SKIP_HANDSHAKE_CHECK="NO" |
| 1369 | skip_handshake_stage_check() { |
| 1370 | SKIP_HANDSHAKE_CHECK="YES" |
| 1371 | } |
| 1372 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1373 | # Analyze the commands that will be used in a test. |
| 1374 | # |
| 1375 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1376 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1377 | # |
| 1378 | # Inputs: |
| 1379 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1380 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1381 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1382 | # |
| 1383 | # Outputs: |
| 1384 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1385 | analyze_test_commands() { |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame^] | 1386 | # If the test uses DTLS, does not force a specific port, and does not |
| 1387 | # specify a custom proxy, add a simple proxy. |
| 1388 | # It provides timing info that's useful to debug failures. |
| 1389 | if [ "$DTLS" -eq 1 ] && |
| 1390 | [ "$THIS_SRV_PORT" = "$SRV_PORT" ] && |
| 1391 | [ -z "$PXY_CMD" ] |
| 1392 | then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1393 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1394 | case " $SRV_CMD " in |
| 1395 | *' server_addr=::1 '*) |
| 1396 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1397 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1398 | fi |
| 1399 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1400 | # update CMD_IS_GNUTLS variable |
| 1401 | is_gnutls "$SRV_CMD" |
| 1402 | |
| 1403 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1404 | # set the default priority |
| 1405 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1406 | case "$SRV_CMD" in |
| 1407 | *--priority*) :;; |
| 1408 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1409 | esac |
| 1410 | fi |
| 1411 | |
| 1412 | # update CMD_IS_GNUTLS variable |
| 1413 | is_gnutls "$CLI_CMD" |
| 1414 | |
| 1415 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1416 | # set the default priority |
| 1417 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1418 | case "$CLI_CMD" in |
| 1419 | *--priority*) :;; |
| 1420 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1421 | esac |
| 1422 | fi |
| 1423 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1424 | # fix client port |
| 1425 | if [ -n "$PXY_CMD" ]; then |
| 1426 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1427 | else |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1428 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$THIS_SRV_PORT/g ) |
| 1429 | fi |
| 1430 | |
| 1431 | # If the test forces a specific port and the server is OpenSSL or |
| 1432 | # GnuTLS, override its port specification. |
| 1433 | if [ "$THIS_SRV_PORT" != "$SRV_PORT" ]; then |
| 1434 | case "$SRV_CMD" in |
| 1435 | "$G_SRV"*|"$G_NEXT_SRV"*) SRV_CMD="$SRV_CMD -p $THIS_SRV_PORT";; |
| 1436 | "$O_SRV"*|"$O_NEXT_SRV"*) SRV_CMD="$SRV_CMD -accept $THIS_SRV_PORT";; |
| 1437 | esac |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1438 | fi |
| 1439 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1440 | # prepend valgrind to our commands if active |
| 1441 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1442 | if is_polar "$SRV_CMD"; then |
| 1443 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1444 | fi |
| 1445 | if is_polar "$CLI_CMD"; then |
| 1446 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1447 | fi |
| 1448 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1449 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1450 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1451 | # Check for failure conditions after a test case. |
| 1452 | # |
| 1453 | # Inputs from run_test: |
| 1454 | # * positional parameters: test options (see run_test documentation) |
| 1455 | # * $CLI_EXIT: client return code |
| 1456 | # * $CLI_EXPECT: expected client return code |
| 1457 | # * $SRV_RET: server return code |
| 1458 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1459 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1460 | # |
| 1461 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1462 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1463 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1464 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1465 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1466 | if [ $TIMES_LEFT -gt 0 ] && |
| 1467 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1468 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1469 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1470 | return |
| 1471 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1472 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1473 | # 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] | 1474 | # (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] | 1475 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1476 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1477 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1478 | then |
| 1479 | if is_polar "$SRV_CMD"; then |
| 1480 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1481 | else |
| 1482 | fail "server or client failed to reach handshake stage" |
| 1483 | return |
| 1484 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1485 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1486 | if is_polar "$CLI_CMD"; then |
| 1487 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1488 | else |
| 1489 | fail "server or client failed to reach handshake stage" |
| 1490 | return |
| 1491 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1492 | fi |
| 1493 | fi |
| 1494 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1495 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1496 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1497 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1498 | # care anyway), in case e.g. the server reports a memory leak. |
| 1499 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1500 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1501 | return |
| 1502 | fi |
| 1503 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1504 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1505 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1506 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1507 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1508 | 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] | 1509 | return |
| 1510 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1511 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1512 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1513 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1514 | # 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] | 1515 | while [ $# -gt 0 ] |
| 1516 | do |
| 1517 | case $1 in |
| 1518 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1519 | 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] | 1520 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1521 | return |
| 1522 | fi |
| 1523 | ;; |
| 1524 | |
| 1525 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1526 | 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] | 1527 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1528 | return |
| 1529 | fi |
| 1530 | ;; |
| 1531 | |
| 1532 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1533 | 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] | 1534 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1535 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1536 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1537 | return |
| 1538 | fi |
| 1539 | ;; |
| 1540 | |
| 1541 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1542 | 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] | 1543 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1544 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1545 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1546 | return |
| 1547 | fi |
| 1548 | ;; |
| 1549 | |
| 1550 | # The filtering in the following two options (-u and -U) do the following |
| 1551 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1552 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1553 | # - keep one of each non-unique line |
| 1554 | # - count how many lines remain |
| 1555 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1556 | # if there were no duplicates. |
| 1557 | "-U") |
| 1558 | 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 |
| 1559 | fail "lines following pattern '$2' must be unique in Server output" |
| 1560 | return |
| 1561 | fi |
| 1562 | ;; |
| 1563 | |
| 1564 | "-u") |
| 1565 | 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 |
| 1566 | 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] | 1567 | return |
| 1568 | fi |
| 1569 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1570 | "-F") |
| 1571 | if ! $2 "$SRV_OUT"; then |
| 1572 | fail "function call to '$2' failed on Server output" |
| 1573 | return |
| 1574 | fi |
| 1575 | ;; |
| 1576 | "-f") |
| 1577 | if ! $2 "$CLI_OUT"; then |
| 1578 | fail "function call to '$2' failed on Client output" |
| 1579 | return |
| 1580 | fi |
| 1581 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1582 | "-g") |
| 1583 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1584 | fail "function call to '$2' failed on Server and Client output" |
| 1585 | return |
| 1586 | fi |
| 1587 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1588 | |
| 1589 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1590 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1591 | exit 1 |
| 1592 | esac |
| 1593 | shift 2 |
| 1594 | done |
| 1595 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1596 | # check valgrind's results |
| 1597 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1598 | 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] | 1599 | fail "Server has memory errors" |
| 1600 | return |
| 1601 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1602 | 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] | 1603 | fail "Client has memory errors" |
| 1604 | return |
| 1605 | fi |
| 1606 | fi |
| 1607 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1608 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1609 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1610 | } |
| 1611 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1612 | # Run the current test case: start the server and if applicable the proxy, run |
| 1613 | # the client, wait for all processes to finish or time out. |
| 1614 | # |
| 1615 | # Inputs: |
| 1616 | # * $NAME: test case name |
| 1617 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1618 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1619 | # |
| 1620 | # Outputs: |
| 1621 | # * $CLI_EXIT: client return code |
| 1622 | # * $SRV_RET: server return code |
| 1623 | do_run_test_once() { |
| 1624 | # run the commands |
| 1625 | if [ -n "$PXY_CMD" ]; then |
| 1626 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1627 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1628 | PXY_PID=$! |
| 1629 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1630 | fi |
| 1631 | |
| 1632 | check_osrv_dtls |
| 1633 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1634 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1635 | SRV_PID=$! |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1636 | wait_server_start "$THIS_SRV_PORT" "$SRV_PID" |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1637 | |
| 1638 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1639 | # The client must be a subprocess of the script in order for killing it to |
| 1640 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1641 | # not at the end of the line: the latter approach will spawn eval as a |
| 1642 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1643 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1644 | wait_client_done |
| 1645 | |
| 1646 | sleep 0.05 |
| 1647 | |
| 1648 | # terminate the server (and the proxy) |
| 1649 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1650 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1651 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1652 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1653 | SRV_RET=$? |
| 1654 | |
| 1655 | if [ -n "$PXY_CMD" ]; then |
| 1656 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1657 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1658 | fi |
| 1659 | } |
| 1660 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1661 | # 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] | 1662 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1663 | # |
| 1664 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1665 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1666 | # for the sake of tests' filtering (especially in conjunction with the |
| 1667 | # detect_required_features() function), it does NOT guarantee that the |
| 1668 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1669 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1670 | # that we are going to use TLS 1.2 |
| 1671 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1672 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1673 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1674 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1675 | *tls12*) |
| 1676 | echo "TLS12" |
| 1677 | return;; |
| 1678 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1679 | echo "TLS13" |
| 1680 | return;; |
| 1681 | esac |
| 1682 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1683 | *tls12*) |
| 1684 | echo "TLS12" |
| 1685 | return;; |
| 1686 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1687 | echo "TLS13" |
| 1688 | return;; |
| 1689 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1690 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1691 | case $1 in |
| 1692 | tls1_2*) |
| 1693 | echo "TLS12" |
| 1694 | return;; |
| 1695 | *tls1_3) |
| 1696 | echo "TLS13" |
| 1697 | return;; |
| 1698 | esac |
| 1699 | case $2 in |
| 1700 | *tls1_2) |
| 1701 | echo "TLS12" |
| 1702 | return;; |
| 1703 | *tls1_3) |
| 1704 | echo "TLS13" |
| 1705 | return;; |
| 1706 | esac |
| 1707 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1708 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1709 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1710 | then |
| 1711 | echo "TLS13" |
| 1712 | else |
| 1713 | echo "TLS12" |
| 1714 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1715 | } |
| 1716 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1717 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1718 | # Options: -s pattern pattern that must be present in server output |
| 1719 | # -c pattern pattern that must be present in client output |
| 1720 | # -u pattern lines after pattern must be unique in client output |
| 1721 | # -f call shell function on client output |
| 1722 | # -S pattern pattern that must be absent in server output |
| 1723 | # -C pattern pattern that must be absent in client output |
| 1724 | # -U pattern lines after pattern must be unique in server output |
| 1725 | # -F call shell function on server output |
| 1726 | # -g call shell function on server and client output |
| 1727 | run_test() { |
| 1728 | NAME="$1" |
| 1729 | shift 1 |
| 1730 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1731 | if is_excluded "$NAME"; then |
| 1732 | SKIP_NEXT="NO" |
| 1733 | # There was no request to run the test, so don't record its outcome. |
| 1734 | return |
| 1735 | fi |
| 1736 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1737 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1738 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1739 | return |
| 1740 | fi |
| 1741 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1742 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1743 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1744 | # Do not skip next test and skip current test. |
| 1745 | SKIP_NEXT="NO" |
| 1746 | return |
| 1747 | fi |
| 1748 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1749 | print_name "$NAME" |
| 1750 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1751 | # Do we only run numbered tests? |
| 1752 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1753 | case ",$RUN_TEST_NUMBER," in |
| 1754 | *",$TESTS,"*) :;; |
| 1755 | *) SKIP_NEXT="YES";; |
| 1756 | esac |
| 1757 | fi |
| 1758 | |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame^] | 1759 | # Does this test specify a proxy? |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1760 | if [ "X$1" = "X-p" ]; then |
| 1761 | PXY_CMD="$2" |
| 1762 | shift 2 |
| 1763 | else |
| 1764 | PXY_CMD="" |
| 1765 | fi |
| 1766 | |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1767 | # Does this test force a specific port? |
| 1768 | if [ "$1" = "-P" ]; then |
| 1769 | THIS_SRV_PORT="$2" |
| 1770 | shift 2 |
| 1771 | else |
| 1772 | THIS_SRV_PORT="$SRV_PORT" |
| 1773 | fi |
| 1774 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1775 | # get commands and client output |
| 1776 | SRV_CMD="$1" |
| 1777 | CLI_CMD="$2" |
| 1778 | CLI_EXPECT="$3" |
| 1779 | shift 3 |
| 1780 | |
| 1781 | # Check if test uses files |
| 1782 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1783 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1784 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1785 | esac |
| 1786 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1787 | # Check if the test uses DTLS. |
| 1788 | detect_dtls "$SRV_CMD" |
| 1789 | if [ "$DTLS" -eq 1 ]; then |
| 1790 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1791 | fi |
| 1792 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1793 | # 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] | 1794 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1795 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1796 | # Guess the TLS version which is going to be used |
| 1797 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1798 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1799 | else |
| 1800 | TLS_VERSION="TLS12" |
| 1801 | fi |
| 1802 | |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1803 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1804 | maybe_adapt_for_psk "$@" |
| 1805 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1806 | # 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] | 1807 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1808 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1809 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1810 | |
| 1811 | # should we skip? |
| 1812 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1813 | SKIP_NEXT="NO" |
| 1814 | record_outcome "SKIP" |
| 1815 | SKIPS=$(( $SKIPS + 1 )) |
| 1816 | return |
| 1817 | fi |
| 1818 | |
| 1819 | analyze_test_commands "$@" |
| 1820 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1821 | # One regular run and two retries |
| 1822 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1823 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1824 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1825 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1826 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1827 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1828 | check_test_failure "$@" |
| 1829 | case $outcome in |
| 1830 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1831 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1832 | FAIL) return;; |
| 1833 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1834 | done |
| 1835 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1836 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1837 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1838 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1839 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1840 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1841 | if [ -n "$PXY_CMD" ]; then |
| 1842 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1843 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1844 | fi |
| 1845 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1846 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1847 | } |
| 1848 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1849 | run_test_psa() { |
| 1850 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1851 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1852 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1853 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1854 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1855 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1856 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1857 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1858 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1859 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1860 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1861 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1862 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1863 | -S "error" \ |
| 1864 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1865 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1866 | } |
| 1867 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1868 | run_test_psa_force_curve() { |
| 1869 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1870 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1871 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1872 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1873 | "$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] | 1874 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1875 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1876 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1877 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1878 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1879 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1880 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1881 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1882 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1883 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1884 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1885 | } |
| 1886 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1887 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1888 | # a maximum fragment length. |
| 1889 | # first argument ($1) is MFL for SSL client |
| 1890 | # 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] | 1891 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1892 | { |
| 1893 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1894 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1895 | |
| 1896 | # Leave some margin for robustness |
| 1897 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1898 | |
| 1899 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1900 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1901 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1902 | 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] | 1903 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1904 | 0 \ |
| 1905 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1906 | } |
| 1907 | |
| 1908 | |
| 1909 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1910 | # 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] | 1911 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1912 | { |
| 1913 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1914 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1915 | |
| 1916 | # first test with default MFU is to get reference memory usage |
| 1917 | MEMORY_USAGE_MFL_16K=0 |
| 1918 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1919 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1920 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1921 | 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] | 1922 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1923 | 0 \ |
| 1924 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1925 | |
| 1926 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1927 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1928 | |
| 1929 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1930 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1931 | |
| 1932 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1933 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1934 | |
| 1935 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1936 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1937 | } |
| 1938 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1939 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1940 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1941 | rm -f context_srv.txt |
| 1942 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1943 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1944 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1945 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1946 | 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] | 1947 | exit 1 |
| 1948 | } |
| 1949 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1950 | # |
| 1951 | # MAIN |
| 1952 | # |
| 1953 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1954 | # Make the outcome file path relative to the original directory, not |
| 1955 | # to .../tests |
| 1956 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1957 | [!/]*) |
| 1958 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1959 | ;; |
| 1960 | esac |
| 1961 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1962 | populate_enabled_hash_algs |
| 1963 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1964 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1965 | # patterns rather than regular expressions, use a case statement instead |
| 1966 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1967 | # detects simple cases: plain substring, everything, nothing. |
| 1968 | # |
| 1969 | # As an exception, the character '.' is treated as an ordinary character |
| 1970 | # if it is the only special character in the string. This is because it's |
| 1971 | # rare to need "any one character", but needing a literal '.' is common |
| 1972 | # (e.g. '-f "DTLS 1.2"'). |
| 1973 | need_grep= |
| 1974 | case "$FILTER" in |
| 1975 | '^$') simple_filter=;; |
| 1976 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1977 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1978 | need_grep=1;; |
| 1979 | *) # No regexp or shell-pattern special character |
| 1980 | simple_filter="*$FILTER*";; |
| 1981 | esac |
| 1982 | case "$EXCLUDE" in |
| 1983 | '^$') simple_exclude=;; |
| 1984 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1985 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1986 | need_grep=1;; |
| 1987 | *) # No regexp or shell-pattern special character |
| 1988 | simple_exclude="*$EXCLUDE*";; |
| 1989 | esac |
| 1990 | if [ -n "$need_grep" ]; then |
| 1991 | is_excluded () { |
| 1992 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1993 | } |
| 1994 | else |
| 1995 | is_excluded () { |
| 1996 | case "$1" in |
| 1997 | $simple_exclude) true;; |
| 1998 | $simple_filter) false;; |
| 1999 | *) true;; |
| 2000 | esac |
| 2001 | } |
| 2002 | fi |
| 2003 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 2004 | # Filter tests according to TEST_SUITE_NAME |
| 2005 | is_excluded_test_suite () { |
| 2006 | if [ -n "$RUN_TEST_SUITE" ] |
| 2007 | then |
| 2008 | case ",$RUN_TEST_SUITE," in |
| 2009 | *",$1,"*) false;; |
| 2010 | *) true;; |
| 2011 | esac |
| 2012 | else |
| 2013 | false |
| 2014 | fi |
| 2015 | |
| 2016 | } |
| 2017 | |
| 2018 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2019 | if [ "$LIST_TESTS" -eq 0 ];then |
| 2020 | |
| 2021 | # sanity checks, avoid an avalanche of errors |
| 2022 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 2023 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 2024 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 2025 | if [ ! -x "$P_SRV_BIN" ]; then |
| 2026 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2027 | exit 1 |
| 2028 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2029 | if [ ! -x "$P_CLI_BIN" ]; then |
| 2030 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 2031 | exit 1 |
| 2032 | fi |
| 2033 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2034 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2035 | exit 1 |
| 2036 | fi |
| 2037 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2038 | if which valgrind >/dev/null 2>&1; then :; else |
| 2039 | echo "Memcheck not possible. Valgrind not found" |
| 2040 | exit 1 |
| 2041 | fi |
| 2042 | fi |
| 2043 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2044 | echo "Command '$OPENSSL' not found" |
| 2045 | exit 1 |
| 2046 | fi |
| 2047 | |
| 2048 | # used by watchdog |
| 2049 | MAIN_PID="$$" |
| 2050 | |
| 2051 | # We use somewhat arbitrary delays for tests: |
| 2052 | # - how long do we wait for the server to start (when lsof not available)? |
| 2053 | # - how long do we allow for the client to finish? |
| 2054 | # (not to check performance, just to avoid waiting indefinitely) |
| 2055 | # Things are slower with valgrind, so give extra time here. |
| 2056 | # |
| 2057 | # Note: without lsof, there is a trade-off between the running time of this |
| 2058 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2059 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2060 | # the script, only the case where a client or server gets stuck. |
| 2061 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2062 | START_DELAY=6 |
| 2063 | DOG_DELAY=60 |
| 2064 | else |
| 2065 | START_DELAY=2 |
| 2066 | DOG_DELAY=20 |
| 2067 | fi |
| 2068 | |
| 2069 | # some particular tests need more time: |
| 2070 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2071 | # - for the server, we sleep for a number of seconds after the client exits |
| 2072 | # see client_need_more_time() and server_needs_more_time() |
| 2073 | CLI_DELAY_FACTOR=1 |
| 2074 | SRV_DELAY_SECONDS=0 |
| 2075 | |
| 2076 | # fix commands to use this port, force IPv4 while at it |
| 2077 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2078 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2079 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2080 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2081 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2082 | 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"}" |
| 2083 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2084 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2085 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2086 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2087 | |
| 2088 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2089 | # low-security ones. This covers not just cipher suites but also protocol |
| 2090 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2091 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2092 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2093 | # a way to discover it from -help, so check the openssl version. |
| 2094 | case $($OPENSSL version) in |
| 2095 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2096 | *) |
| 2097 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2098 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2099 | ;; |
| 2100 | esac |
| 2101 | |
| 2102 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2103 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2104 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2105 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2106 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2107 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2108 | fi |
| 2109 | |
| 2110 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2111 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2112 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2113 | fi |
| 2114 | |
| 2115 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2116 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2117 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2118 | fi |
| 2119 | |
| 2120 | # Allow SHA-1, because many of our test certificates use it |
| 2121 | P_SRV="$P_SRV allow_sha1=1" |
| 2122 | P_CLI="$P_CLI allow_sha1=1" |
| 2123 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2124 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2125 | # Also pick a unique name for intermediate files |
| 2126 | SRV_OUT="srv_out.$$" |
| 2127 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2128 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2129 | SESSION="session.$$" |
| 2130 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2131 | SKIP_NEXT="NO" |
| 2132 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2133 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2134 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2135 | # Basic test |
| 2136 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2137 | # Checks that: |
| 2138 | # - 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] | 2139 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2140 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2141 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2142 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2143 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2144 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2145 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2146 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2147 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2148 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2149 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2150 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2151 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2152 | -S "error" \ |
| 2153 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2156 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2157 | run_test "Default, DTLS" \ |
| 2158 | "$P_SRV dtls=1" \ |
| 2159 | "$P_CLI dtls=1" \ |
| 2160 | 0 \ |
| 2161 | -s "Protocol is DTLSv1.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 | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2163 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2164 | run_test "TLS client auth: required" \ |
| 2165 | "$P_SRV auth_mode=required" \ |
| 2166 | "$P_CLI" \ |
| 2167 | 0 \ |
| 2168 | -s "Verifying peer X.509 certificate... ok" |
| 2169 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2170 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2171 | "$P_SRV" \ |
| 2172 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2173 | 0 \ |
| 2174 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2175 | -c "Key size is 256" |
| 2176 | |
| 2177 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2178 | "$P_SRV" \ |
| 2179 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2180 | 0 \ |
| 2181 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2182 | -c "Key size is 128" |
| 2183 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2185 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2186 | # module does not support PSA dispatching so we need builtin support. |
| 2187 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2188 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2189 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2190 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2191 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2192 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2193 | "$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] | 2194 | 0 |
| 2195 | |
| 2196 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2197 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2198 | # module does not support PSA dispatching so we need builtin support. |
| 2199 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2200 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2201 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2202 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2203 | run_test "TLS: password protected server key" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2204 | "$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] | 2205 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2206 | 0 |
| 2207 | |
| 2208 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_RSA_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, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2217 | "$P_SRV force_version=tls12\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2218 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2219 | 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] | 2220 | "$P_CLI" \ |
| 2221 | 0 |
| 2222 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2223 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2224 | run_test "CA callback on client" \ |
| 2225 | "$P_SRV debug_level=3" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2226 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2227 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2228 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2229 | -S "error" \ |
| 2230 | -C "error" |
| 2231 | |
| 2232 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2233 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2234 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2235 | run_test "CA callback on server" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2236 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2237 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2238 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2239 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2240 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2241 | -s "Verifying peer X.509 certificate... ok" \ |
| 2242 | -S "error" \ |
| 2243 | -C "error" |
| 2244 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2245 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2246 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2247 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2249 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2250 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2251 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2252 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2253 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2254 | 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] | 2255 | 0 \ |
| 2256 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2257 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2258 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2259 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2260 | -S "error" \ |
| 2261 | -C "error" |
| 2262 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2263 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2265 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2268 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2269 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2270 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2271 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2272 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2273 | 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] | 2274 | 0 \ |
| 2275 | -c "key type: Opaque" \ |
| 2276 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2277 | -s "Verifying peer X.509 certificate... ok" \ |
| 2278 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2279 | -S "error" \ |
| 2280 | -C "error" |
| 2281 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2283 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2284 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2285 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2286 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2287 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2288 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2289 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2290 | 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] | 2291 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2292 | 0 \ |
| 2293 | -c "key type: Opaque" \ |
| 2294 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2295 | -s "Verifying peer X.509 certificate... ok" \ |
| 2296 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2297 | -S "error" \ |
| 2298 | -C "error" |
| 2299 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2300 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2301 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2302 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2303 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2304 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2305 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2306 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2307 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2308 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2309 | 0 \ |
| 2310 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2311 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2312 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2313 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2314 | -S "error" \ |
| 2315 | -C "error" |
| 2316 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2317 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2318 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2319 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2320 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2321 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2322 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2323 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2324 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2325 | 0 \ |
| 2326 | -c "Verifying peer X.509 certificate... ok" \ |
| 2327 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2328 | -s "key types: Opaque, none" \ |
| 2329 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2330 | -S "error" \ |
| 2331 | -C "error" |
| 2332 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2333 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2334 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2335 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2336 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2337 | 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] | 2338 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2339 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2340 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2341 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2342 | 1 \ |
| 2343 | -s "key types: Opaque, none" \ |
| 2344 | -s "error" \ |
| 2345 | -c "error" \ |
| 2346 | -c "Public key type mismatch" |
| 2347 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2349 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2350 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2351 | requires_config_enabled MBEDTLS_RSA_C |
| 2352 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2353 | requires_hash_alg SHA_256 |
| 2354 | 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] | 2355 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2356 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2357 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2358 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2359 | 1 \ |
| 2360 | -s "key types: Opaque, none" \ |
| 2361 | -s "error" \ |
| 2362 | -c "error" \ |
| 2363 | -c "Public key type mismatch" |
| 2364 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2365 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2366 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2367 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2368 | requires_hash_alg SHA_256 |
| 2369 | 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] | 2370 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2371 | 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] | 2372 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2373 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2374 | 1 \ |
| 2375 | -s "key types: Opaque, none" \ |
| 2376 | -s "got ciphersuites in common, but none of them usable" \ |
| 2377 | -s "error" \ |
| 2378 | -c "error" |
| 2379 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2381 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2382 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2383 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2384 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2385 | 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] | 2386 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2387 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2388 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2389 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2390 | 1 \ |
| 2391 | -s "key types: Opaque, none" \ |
| 2392 | -s "got ciphersuites in common, but none of them usable" \ |
| 2393 | -s "error" \ |
| 2394 | -c "error" |
| 2395 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2396 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2397 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2398 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2399 | 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] | 2400 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2401 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2402 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2403 | "$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] | 2404 | 1 \ |
| 2405 | -s "key types: Opaque, none" \ |
| 2406 | -s "got ciphersuites in common, but none of them usable" \ |
| 2407 | -s "error" \ |
| 2408 | -c "error" |
| 2409 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2411 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2412 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2413 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2414 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2415 | 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] | 2416 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2417 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2418 | 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] | 2419 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2420 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2421 | 0 \ |
| 2422 | -c "Verifying peer X.509 certificate... ok" \ |
| 2423 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2424 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2425 | -s "key types: Opaque, Opaque" \ |
| 2426 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2427 | -S "error" \ |
| 2428 | -C "error" |
| 2429 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2431 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2432 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2433 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2434 | 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] | 2435 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2436 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2437 | 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] | 2438 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2439 | "$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] | 2440 | 0 \ |
| 2441 | -c "Verifying peer X.509 certificate... ok" \ |
| 2442 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2443 | -c "CN=Polarssl Test EC CA" \ |
| 2444 | -s "key types: Opaque, Opaque" \ |
| 2445 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2446 | -S "error" \ |
| 2447 | -C "error" |
| 2448 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2450 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2451 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2452 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2453 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2454 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2455 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2456 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2457 | 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] | 2458 | "$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] | 2459 | 0 \ |
| 2460 | -c "Verifying peer X.509 certificate... ok" \ |
| 2461 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2462 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2463 | -s "key types: Opaque, Opaque" \ |
| 2464 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2465 | -S "error" \ |
| 2466 | -C "error" |
| 2467 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2469 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2470 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2471 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2472 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2473 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2474 | "$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] | 2475 | "$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] | 2476 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2477 | -c "key type: Opaque" \ |
| 2478 | -s "key types: Opaque, Opaque" \ |
| 2479 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2480 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2481 | |
| 2482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2483 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2484 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2486 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2487 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2488 | "$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] | 2489 | "$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] | 2490 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2491 | -c "key type: Opaque" \ |
| 2492 | -s "key types: Opaque, Opaque" \ |
| 2493 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2494 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2495 | |
| 2496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2497 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2498 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2500 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2501 | 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] | 2502 | "$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] | 2503 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2504 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2505 | -s "key types: Opaque, Opaque" \ |
| 2506 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2507 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2508 | -C "error" \ |
| 2509 | -S "error" \ |
| 2510 | |
| 2511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2512 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2513 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2514 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2515 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2516 | 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] | 2517 | "$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] | 2518 | "$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] | 2519 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2520 | -c "key type: Opaque" \ |
| 2521 | -s "key types: Opaque, Opaque" \ |
| 2522 | -C "error" \ |
| 2523 | -S "error" \ |
| 2524 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2525 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2527 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2530 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2531 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2532 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2533 | 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] | 2534 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2535 | 0 \ |
| 2536 | -c "Verifying peer X.509 certificate... ok" \ |
| 2537 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2538 | -s "key types: Opaque, none" \ |
| 2539 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2540 | -S "error" \ |
| 2541 | -C "error" |
| 2542 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2543 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2544 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2545 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2546 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2547 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2548 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2549 | 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] | 2550 | "$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] | 2551 | 0 \ |
| 2552 | -c "Verifying peer X.509 certificate... ok" \ |
| 2553 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2554 | -s "key types: Opaque, none" \ |
| 2555 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2556 | -S "error" \ |
| 2557 | -C "error" |
| 2558 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2560 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2562 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2563 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2564 | "$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] | 2565 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2566 | "$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] | 2567 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2568 | 0 \ |
| 2569 | -c "Verifying peer X.509 certificate... ok" \ |
| 2570 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2571 | -s "key types: Opaque, Opaque" \ |
| 2572 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2573 | -S "error" \ |
| 2574 | -C "error" |
| 2575 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2577 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2578 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2579 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2580 | run_test "Opaque key for server authentication: RSA-" \ |
| 2581 | "$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] | 2582 | "$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] | 2583 | 0 \ |
| 2584 | -c "Verifying peer X.509 certificate... ok" \ |
| 2585 | -c "Ciphersuite is TLS-RSA-" \ |
| 2586 | -s "key types: Opaque, Opaque" \ |
| 2587 | -s "Ciphersuite is TLS-RSA-" \ |
| 2588 | -S "error" \ |
| 2589 | -C "error" |
| 2590 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2591 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2592 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2594 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2595 | 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] | 2596 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2597 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2598 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2599 | 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] | 2600 | 1 \ |
| 2601 | -s "key types: Opaque, none" \ |
| 2602 | -s "got ciphersuites in common, but none of them usable" \ |
| 2603 | -s "error" \ |
| 2604 | -c "error" |
| 2605 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2607 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2608 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2609 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2610 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2611 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2612 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2613 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2614 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2615 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2616 | 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] | 2617 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2618 | 0 \ |
| 2619 | -c "Verifying peer X.509 certificate... ok" \ |
| 2620 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2621 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2622 | -s "key types: Opaque, Opaque" \ |
| 2623 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2624 | -S "error" \ |
| 2625 | -C "error" |
| 2626 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2627 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2628 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2629 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2630 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2631 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2632 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2633 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2634 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2635 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2636 | 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] | 2637 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2638 | 0 \ |
| 2639 | -c "Verifying peer X.509 certificate... ok" \ |
| 2640 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2641 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2642 | -s "key types: Opaque, Opaque" \ |
| 2643 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2644 | -S "error" \ |
| 2645 | -C "error" |
| 2646 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2647 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2648 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2649 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2650 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2651 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2652 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2653 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2654 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2655 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2656 | 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] | 2657 | 0 \ |
| 2658 | -c "key type: Opaque" \ |
| 2659 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2660 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2661 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2662 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2663 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2664 | -S "error" \ |
| 2665 | -C "error" |
| 2666 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2667 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2668 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2669 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2671 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2672 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2673 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2674 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2675 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2676 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2677 | 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] | 2678 | 0 \ |
| 2679 | -c "key type: Opaque" \ |
| 2680 | -c "Verifying peer X.509 certificate... ok" \ |
| 2681 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2682 | -s "key types: Opaque, none" \ |
| 2683 | -s "Verifying peer X.509 certificate... ok" \ |
| 2684 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2685 | -S "error" \ |
| 2686 | -C "error" |
| 2687 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2689 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2690 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2691 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2692 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2693 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2694 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2695 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2696 | 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] | 2697 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2698 | 0 \ |
| 2699 | -c "key type: Opaque" \ |
| 2700 | -c "Verifying peer X.509 certificate... ok" \ |
| 2701 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2702 | -s "key types: Opaque, none" \ |
| 2703 | -s "Verifying peer X.509 certificate... ok" \ |
| 2704 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2705 | -S "error" \ |
| 2706 | -C "error" |
| 2707 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2708 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2709 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2710 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2711 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2712 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2713 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2714 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2715 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2716 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2717 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2718 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2719 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2720 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2721 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2722 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2723 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2724 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2725 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2726 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2727 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2728 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2729 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2730 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2731 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2732 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2733 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2734 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2735 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2736 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2737 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2738 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2739 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2740 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2741 | ## 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] | 2742 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2743 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2744 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2745 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2746 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2747 | run_test_psa_force_curve "secp192k1" |
| 2748 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2749 | # Test current time in ServerHello |
| 2750 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2751 | run_test "ServerHello contains gmt_unix_time" \ |
| 2752 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2753 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2754 | 0 \ |
| 2755 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2756 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2757 | |
| 2758 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2759 | run_test "Unique IV in GCM" \ |
| 2760 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2761 | "$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] | 2762 | 0 \ |
| 2763 | -u "IV used" \ |
| 2764 | -U "IV used" |
| 2765 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2766 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2767 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2768 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2769 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2770 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2772 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2773 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2774 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2775 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2776 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2777 | "$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] | 2778 | 0 \ |
| 2779 | -c "Supported Signature Algorithm found: 04 03" |
| 2780 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2782 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2783 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2784 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2785 | requires_hash_alg SHA_256 |
| 2786 | run_test "Single supported algorithm sending: openssl client" \ |
| 2787 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2788 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2789 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2790 | 0 |
| 2791 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2792 | # Tests for certificate verification callback |
| 2793 | run_test "Configuration-specific CRT verification callback" \ |
| 2794 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2795 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2796 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2797 | -S "error" \ |
| 2798 | -c "Verify requested for " \ |
| 2799 | -c "Use configuration-specific verification callback" \ |
| 2800 | -C "Use context-specific verification callback" \ |
| 2801 | -C "error" |
| 2802 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2803 | run_test "Context-specific CRT verification callback" \ |
| 2804 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2805 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2806 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2807 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2808 | -c "Verify requested for " \ |
| 2809 | -c "Use context-specific verification callback" \ |
| 2810 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2811 | -C "error" |
| 2812 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2813 | # Tests for SHA-1 support |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2814 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2815 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2816 | "$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] | 2817 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2818 | 1 \ |
| 2819 | -c "The certificate is signed with an unacceptable hash" |
| 2820 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2821 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2822 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2823 | "$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] | 2824 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2825 | 0 |
| 2826 | |
| 2827 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2828 | "$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] | 2829 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2830 | 0 |
| 2831 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2832 | requires_hash_alg SHA_1 |
| 2833 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2834 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2835 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2836 | "$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] | 2837 | 1 \ |
| 2838 | -s "The certificate is signed with an unacceptable hash" |
| 2839 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2840 | requires_hash_alg SHA_1 |
| 2841 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2842 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2843 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2844 | "$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] | 2845 | 0 |
| 2846 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2847 | requires_config_enabled MBEDTLS_RSA_C |
| 2848 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2849 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2850 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2851 | "$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] | 2852 | 0 |
| 2853 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2854 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2856 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2857 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2858 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2859 | 0 \ |
| 2860 | -c "next record in same datagram" \ |
| 2861 | -s "next record in same datagram" |
| 2862 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2864 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2865 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2866 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2867 | 0 \ |
| 2868 | -s "next record in same datagram" \ |
| 2869 | -C "next record in same datagram" |
| 2870 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2872 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2873 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2874 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2875 | 0 \ |
| 2876 | -S "next record in same datagram" \ |
| 2877 | -c "next record in same datagram" |
| 2878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2880 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2881 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2882 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2883 | 0 \ |
| 2884 | -S "next record in same datagram" \ |
| 2885 | -C "next record in same datagram" |
| 2886 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2887 | # Tests for Context serialization |
| 2888 | |
| 2889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2890 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2891 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2892 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2893 | 0 \ |
| 2894 | -c "Deserializing connection..." \ |
| 2895 | -S "Deserializing connection..." |
| 2896 | |
| 2897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2898 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2899 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2900 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2901 | 0 \ |
| 2902 | -c "Deserializing connection..." \ |
| 2903 | -S "Deserializing connection..." |
| 2904 | |
| 2905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2906 | run_test "Context serialization, client serializes, GCM" \ |
| 2907 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2908 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2909 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2910 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2911 | -S "Deserializing connection..." |
| 2912 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2916 | run_test "Context serialization, client serializes, with CID" \ |
| 2917 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2918 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2919 | 0 \ |
| 2920 | -c "Deserializing connection..." \ |
| 2921 | -S "Deserializing connection..." |
| 2922 | |
| 2923 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2924 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2925 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2926 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2927 | 0 \ |
| 2928 | -C "Deserializing connection..." \ |
| 2929 | -s "Deserializing connection..." |
| 2930 | |
| 2931 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2932 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2933 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2934 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2935 | 0 \ |
| 2936 | -C "Deserializing connection..." \ |
| 2937 | -s "Deserializing connection..." |
| 2938 | |
| 2939 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2940 | run_test "Context serialization, server serializes, GCM" \ |
| 2941 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2942 | "$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] | 2943 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2944 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2945 | -s "Deserializing connection..." |
| 2946 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2950 | run_test "Context serialization, server serializes, with CID" \ |
| 2951 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2952 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2953 | 0 \ |
| 2954 | -C "Deserializing connection..." \ |
| 2955 | -s "Deserializing connection..." |
| 2956 | |
| 2957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2958 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2959 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2960 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2961 | 0 \ |
| 2962 | -c "Deserializing connection..." \ |
| 2963 | -s "Deserializing connection..." |
| 2964 | |
| 2965 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2966 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2967 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2968 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2969 | 0 \ |
| 2970 | -c "Deserializing connection..." \ |
| 2971 | -s "Deserializing connection..." |
| 2972 | |
| 2973 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2974 | run_test "Context serialization, both serialize, GCM" \ |
| 2975 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2976 | "$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] | 2977 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2978 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2979 | -s "Deserializing connection..." |
| 2980 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2982 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2983 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2984 | run_test "Context serialization, both serialize, with CID" \ |
| 2985 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2986 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2987 | 0 \ |
| 2988 | -c "Deserializing connection..." \ |
| 2989 | -s "Deserializing connection..." |
| 2990 | |
| 2991 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2992 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2993 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2994 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2995 | 0 \ |
| 2996 | -c "Deserializing connection..." \ |
| 2997 | -S "Deserializing connection..." |
| 2998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3000 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3001 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 3002 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3003 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3004 | 0 \ |
| 3005 | -c "Deserializing connection..." \ |
| 3006 | -S "Deserializing connection..." |
| 3007 | |
| 3008 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3009 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 3010 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3011 | "$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] | 3012 | 0 \ |
| 3013 | -c "Deserializing connection..." \ |
| 3014 | -S "Deserializing connection..." |
| 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3018 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3019 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 3020 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 3021 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3022 | 0 \ |
| 3023 | -c "Deserializing connection..." \ |
| 3024 | -S "Deserializing connection..." |
| 3025 | |
| 3026 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3027 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3028 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3029 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3030 | 0 \ |
| 3031 | -C "Deserializing connection..." \ |
| 3032 | -s "Deserializing connection..." |
| 3033 | |
| 3034 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3035 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 3036 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3037 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3038 | 0 \ |
| 3039 | -C "Deserializing connection..." \ |
| 3040 | -s "Deserializing connection..." |
| 3041 | |
| 3042 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3043 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 3044 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3045 | "$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] | 3046 | 0 \ |
| 3047 | -C "Deserializing connection..." \ |
| 3048 | -s "Deserializing connection..." |
| 3049 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3051 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3053 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 3054 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3055 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 3056 | 0 \ |
| 3057 | -C "Deserializing connection..." \ |
| 3058 | -s "Deserializing connection..." |
| 3059 | |
| 3060 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3061 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3062 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3063 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3064 | 0 \ |
| 3065 | -c "Deserializing connection..." \ |
| 3066 | -s "Deserializing connection..." |
| 3067 | |
| 3068 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3069 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3070 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3071 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3072 | 0 \ |
| 3073 | -c "Deserializing connection..." \ |
| 3074 | -s "Deserializing connection..." |
| 3075 | |
| 3076 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3077 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3078 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3079 | "$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] | 3080 | 0 \ |
| 3081 | -c "Deserializing connection..." \ |
| 3082 | -s "Deserializing connection..." |
| 3083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3085 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3086 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3087 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3088 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3089 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3090 | 0 \ |
| 3091 | -c "Deserializing connection..." \ |
| 3092 | -s "Deserializing connection..." |
| 3093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3095 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3096 | run_test "Saving the serialized context to a file" \ |
| 3097 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3098 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3099 | 0 \ |
| 3100 | -s "Save serialized context to a file... ok" \ |
| 3101 | -c "Save serialized context to a file... ok" |
| 3102 | rm -f context_srv.txt |
| 3103 | rm -f context_cli.txt |
| 3104 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3105 | # Tests for DTLS Connection ID extension |
| 3106 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3107 | # So far, the CID API isn't implemented, so we can't |
| 3108 | # grep for output witnessing its use. This needs to be |
| 3109 | # changed once the CID extension is implemented. |
| 3110 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3113 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3114 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3115 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3116 | 0 \ |
| 3117 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3118 | -s "found CID extension" \ |
| 3119 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3120 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3121 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3122 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3123 | -C "found CID extension" \ |
| 3124 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3125 | -C "Copy CIDs into SSL transform" \ |
| 3126 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3130 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3131 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3132 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3133 | 0 \ |
| 3134 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3135 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3136 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3137 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3138 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3139 | -C "found CID extension" \ |
| 3140 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3141 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3142 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3145 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3146 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3147 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3148 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3149 | 0 \ |
| 3150 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3151 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3152 | -c "client hello, adding CID extension" \ |
| 3153 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3154 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3155 | -s "server hello, adding CID extension" \ |
| 3156 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3157 | -c "Use of CID extension negotiated" \ |
| 3158 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3159 | -c "Copy CIDs into SSL transform" \ |
| 3160 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3161 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3162 | -s "Use of Connection ID has been negotiated" \ |
| 3163 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3167 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3168 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3169 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3170 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3171 | 0 \ |
| 3172 | -c "Enable use of CID extension." \ |
| 3173 | -s "Enable use of CID extension." \ |
| 3174 | -c "client hello, adding CID extension" \ |
| 3175 | -s "found CID extension" \ |
| 3176 | -s "Use of CID extension negotiated" \ |
| 3177 | -s "server hello, adding CID extension" \ |
| 3178 | -c "found CID extension" \ |
| 3179 | -c "Use of CID extension negotiated" \ |
| 3180 | -s "Copy CIDs into SSL transform" \ |
| 3181 | -c "Copy CIDs into SSL transform" \ |
| 3182 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3183 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3184 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3185 | -c "Use of Connection ID has been negotiated" \ |
| 3186 | -c "ignoring unexpected CID" \ |
| 3187 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3190 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3191 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3192 | -p "$P_PXY mtu=800" \ |
| 3193 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3194 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3195 | 0 \ |
| 3196 | -c "Enable use of CID extension." \ |
| 3197 | -s "Enable use of CID extension." \ |
| 3198 | -c "client hello, adding CID extension" \ |
| 3199 | -s "found CID extension" \ |
| 3200 | -s "Use of CID extension negotiated" \ |
| 3201 | -s "server hello, adding CID extension" \ |
| 3202 | -c "found CID extension" \ |
| 3203 | -c "Use of CID extension negotiated" \ |
| 3204 | -s "Copy CIDs into SSL transform" \ |
| 3205 | -c "Copy CIDs into SSL transform" \ |
| 3206 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3207 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3208 | -s "Use of Connection ID has been negotiated" \ |
| 3209 | -c "Use of Connection ID has been negotiated" |
| 3210 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3212 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3213 | 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] | 3214 | -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] | 3215 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3216 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3217 | 0 \ |
| 3218 | -c "Enable use of CID extension." \ |
| 3219 | -s "Enable use of CID extension." \ |
| 3220 | -c "client hello, adding CID extension" \ |
| 3221 | -s "found CID extension" \ |
| 3222 | -s "Use of CID extension negotiated" \ |
| 3223 | -s "server hello, adding CID extension" \ |
| 3224 | -c "found CID extension" \ |
| 3225 | -c "Use of CID extension negotiated" \ |
| 3226 | -s "Copy CIDs into SSL transform" \ |
| 3227 | -c "Copy CIDs into SSL transform" \ |
| 3228 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3229 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3230 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3231 | -c "Use of Connection ID has been negotiated" \ |
| 3232 | -c "ignoring unexpected CID" \ |
| 3233 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3234 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3237 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3238 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3239 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3240 | 0 \ |
| 3241 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3242 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3243 | -c "client hello, adding CID extension" \ |
| 3244 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3245 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3246 | -s "server hello, adding CID extension" \ |
| 3247 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3248 | -c "Use of CID extension negotiated" \ |
| 3249 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3250 | -c "Copy CIDs into SSL transform" \ |
| 3251 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3252 | -s "Peer CID (length 0 Bytes):" \ |
| 3253 | -s "Use of Connection ID has been negotiated" \ |
| 3254 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3257 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3258 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3259 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3260 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3261 | 0 \ |
| 3262 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3263 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3264 | -c "client hello, adding CID extension" \ |
| 3265 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3266 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3267 | -s "server hello, adding CID extension" \ |
| 3268 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3269 | -c "Use of CID extension negotiated" \ |
| 3270 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3271 | -c "Copy CIDs into SSL transform" \ |
| 3272 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3273 | -c "Peer CID (length 0 Bytes):" \ |
| 3274 | -s "Use of Connection ID has been negotiated" \ |
| 3275 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3276 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3278 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3279 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3280 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3281 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3282 | 0 \ |
| 3283 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3284 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3285 | -c "client hello, adding CID extension" \ |
| 3286 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3287 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3288 | -s "server hello, adding CID extension" \ |
| 3289 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3290 | -c "Use of CID extension negotiated" \ |
| 3291 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3292 | -c "Copy CIDs into SSL transform" \ |
| 3293 | -S "Use of Connection ID has been negotiated" \ |
| 3294 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3295 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3297 | 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] | 3298 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3299 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3300 | 0 \ |
| 3301 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3302 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3303 | -c "client hello, adding CID extension" \ |
| 3304 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3305 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3306 | -s "server hello, adding CID extension" \ |
| 3307 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3308 | -c "Use of CID extension negotiated" \ |
| 3309 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3310 | -c "Copy CIDs into SSL transform" \ |
| 3311 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3312 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3313 | -s "Use of Connection ID has been negotiated" \ |
| 3314 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3315 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3317 | 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] | 3318 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3319 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3320 | 0 \ |
| 3321 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3322 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3323 | -c "client hello, adding CID extension" \ |
| 3324 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3325 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3326 | -s "server hello, adding CID extension" \ |
| 3327 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3328 | -c "Use of CID extension negotiated" \ |
| 3329 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3330 | -c "Copy CIDs into SSL transform" \ |
| 3331 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3332 | -s "Peer CID (length 0 Bytes):" \ |
| 3333 | -s "Use of Connection ID has been negotiated" \ |
| 3334 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3335 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3336 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3337 | 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] | 3338 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3339 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3340 | 0 \ |
| 3341 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3342 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3343 | -c "client hello, adding CID extension" \ |
| 3344 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3345 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3346 | -s "server hello, adding CID extension" \ |
| 3347 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3348 | -c "Use of CID extension negotiated" \ |
| 3349 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3350 | -c "Copy CIDs into SSL transform" \ |
| 3351 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3352 | -c "Peer CID (length 0 Bytes):" \ |
| 3353 | -s "Use of Connection ID has been negotiated" \ |
| 3354 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3355 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3357 | 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] | 3358 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3359 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3360 | 0 \ |
| 3361 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3362 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3363 | -c "client hello, adding CID extension" \ |
| 3364 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3365 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3366 | -s "server hello, adding CID extension" \ |
| 3367 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3368 | -c "Use of CID extension negotiated" \ |
| 3369 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3370 | -c "Copy CIDs into SSL transform" \ |
| 3371 | -S "Use of Connection ID has been negotiated" \ |
| 3372 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3373 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3375 | 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] | 3376 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3377 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3378 | 0 \ |
| 3379 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3380 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3381 | -c "client hello, adding CID extension" \ |
| 3382 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3383 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3384 | -s "server hello, adding CID extension" \ |
| 3385 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3386 | -c "Use of CID extension negotiated" \ |
| 3387 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3388 | -c "Copy CIDs into SSL transform" \ |
| 3389 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3390 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3391 | -s "Use of Connection ID has been negotiated" \ |
| 3392 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3393 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3395 | 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] | 3396 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3397 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3398 | 0 \ |
| 3399 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3400 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3401 | -c "client hello, adding CID extension" \ |
| 3402 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3403 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3404 | -s "server hello, adding CID extension" \ |
| 3405 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3406 | -c "Use of CID extension negotiated" \ |
| 3407 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3408 | -c "Copy CIDs into SSL transform" \ |
| 3409 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3410 | -s "Peer CID (length 0 Bytes):" \ |
| 3411 | -s "Use of Connection ID has been negotiated" \ |
| 3412 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3413 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3415 | 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] | 3416 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3417 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3418 | 0 \ |
| 3419 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3420 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3421 | -c "client hello, adding CID extension" \ |
| 3422 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3423 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3424 | -s "server hello, adding CID extension" \ |
| 3425 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3426 | -c "Use of CID extension negotiated" \ |
| 3427 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3428 | -c "Copy CIDs into SSL transform" \ |
| 3429 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3430 | -c "Peer CID (length 0 Bytes):" \ |
| 3431 | -s "Use of Connection ID has been negotiated" \ |
| 3432 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3433 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3435 | 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] | 3436 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3437 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3438 | 0 \ |
| 3439 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3440 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3441 | -c "client hello, adding CID extension" \ |
| 3442 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3443 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3444 | -s "server hello, adding CID extension" \ |
| 3445 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3446 | -c "Use of CID extension negotiated" \ |
| 3447 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3448 | -c "Copy CIDs into SSL transform" \ |
| 3449 | -S "Use of Connection ID has been negotiated" \ |
| 3450 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3451 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3455 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3456 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3457 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3458 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3459 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3460 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3461 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3463 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3464 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3465 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3466 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3467 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3471 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3472 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3473 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3474 | 0 \ |
| 3475 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3476 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3477 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3478 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3479 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3480 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3481 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3482 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3487 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3488 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3489 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3490 | 0 \ |
| 3491 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3492 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3493 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3494 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3495 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3496 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3497 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3498 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3501 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3503 | 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] | 3504 | -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] | 3505 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3506 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3507 | 0 \ |
| 3508 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3509 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3510 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3511 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3512 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3513 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3514 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3515 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3516 | -c "ignoring unexpected CID" \ |
| 3517 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3520 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3522 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3523 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3524 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3525 | 0 \ |
| 3526 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3527 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3528 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3529 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3530 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3531 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3532 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3533 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3536 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3537 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3538 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3539 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3540 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3541 | 0 \ |
| 3542 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3543 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3544 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3545 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3546 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3547 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3548 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3549 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3552 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3554 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3555 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3556 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3557 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3558 | 0 \ |
| 3559 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3560 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3561 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3562 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3563 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3564 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3565 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3566 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3567 | -c "ignoring unexpected CID" \ |
| 3568 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3569 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3571 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3573 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3574 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3575 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3576 | 0 \ |
| 3577 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3578 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3579 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3580 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3581 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3582 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3587 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3588 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3589 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3590 | 0 \ |
| 3591 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3592 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3593 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3594 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3595 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3596 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3597 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3599 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3600 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3601 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3602 | -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] | 3603 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3604 | "$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" \ |
| 3605 | 0 \ |
| 3606 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3607 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3608 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3609 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3610 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3611 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3612 | -c "ignoring unexpected CID" \ |
| 3613 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3616 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3617 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3618 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3619 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3620 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3621 | 0 \ |
| 3622 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3623 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3624 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3625 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3626 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3627 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3628 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3629 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3630 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3633 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3635 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3636 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3637 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3638 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3639 | 0 \ |
| 3640 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3641 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3642 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3643 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3644 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3645 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3646 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3647 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3648 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3649 | -c "ignoring unexpected CID" \ |
| 3650 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3651 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3653 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3654 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3655 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3656 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3657 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3658 | 0 \ |
| 3659 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3660 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3661 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3662 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3663 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3664 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3665 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3666 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3667 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3670 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3672 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3673 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3674 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3675 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3676 | 0 \ |
| 3677 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3678 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3679 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3680 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3681 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3682 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3683 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3684 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3685 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3686 | -c "ignoring unexpected CID" \ |
| 3687 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3688 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3689 | # 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] | 3690 | # tests check that the buffer contents are reallocated when the message is |
| 3691 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3692 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3693 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3694 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3695 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3696 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3697 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3698 | 0 \ |
| 3699 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3700 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3701 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3702 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3703 | -s "Reallocating in_buf" \ |
| 3704 | -s "Reallocating out_buf" |
| 3705 | |
| 3706 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3707 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3708 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3709 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3710 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3711 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3712 | 0 \ |
| 3713 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3714 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3715 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3716 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3717 | -s "Reallocating in_buf" \ |
| 3718 | -s "Reallocating out_buf" |
| 3719 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3720 | # Tests for Encrypt-then-MAC extension |
| 3721 | |
| 3722 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3723 | "$P_SRV debug_level=3 \ |
| 3724 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3725 | "$P_CLI debug_level=3" \ |
| 3726 | 0 \ |
| 3727 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3728 | -s "found encrypt then mac extension" \ |
| 3729 | -s "server hello, adding encrypt then mac extension" \ |
| 3730 | -c "found encrypt_then_mac extension" \ |
| 3731 | -c "using encrypt then mac" \ |
| 3732 | -s "using encrypt then mac" |
| 3733 | |
| 3734 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3735 | "$P_SRV debug_level=3 etm=0 \ |
| 3736 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3737 | "$P_CLI debug_level=3 etm=1" \ |
| 3738 | 0 \ |
| 3739 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3740 | -s "found encrypt then mac extension" \ |
| 3741 | -S "server hello, adding encrypt then mac extension" \ |
| 3742 | -C "found encrypt_then_mac extension" \ |
| 3743 | -C "using encrypt then mac" \ |
| 3744 | -S "using encrypt then mac" |
| 3745 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3746 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3747 | "$P_SRV debug_level=3 etm=1 \ |
| 3748 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3749 | "$P_CLI debug_level=3 etm=1" \ |
| 3750 | 0 \ |
| 3751 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3752 | -s "found encrypt then mac extension" \ |
| 3753 | -S "server hello, adding encrypt then mac extension" \ |
| 3754 | -C "found encrypt_then_mac extension" \ |
| 3755 | -C "using encrypt then mac" \ |
| 3756 | -S "using encrypt then mac" |
| 3757 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3758 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3759 | "$P_SRV debug_level=3 etm=1 \ |
| 3760 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3761 | "$P_CLI debug_level=3 etm=0" \ |
| 3762 | 0 \ |
| 3763 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3764 | -S "found encrypt then mac extension" \ |
| 3765 | -S "server hello, adding encrypt then mac extension" \ |
| 3766 | -C "found encrypt_then_mac extension" \ |
| 3767 | -C "using encrypt then mac" \ |
| 3768 | -S "using encrypt then mac" |
| 3769 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3770 | # Tests for Extended Master Secret extension |
| 3771 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3772 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3773 | run_test "Extended Master Secret: default" \ |
| 3774 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3775 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3776 | 0 \ |
| 3777 | -c "client hello, adding extended_master_secret extension" \ |
| 3778 | -s "found extended master secret extension" \ |
| 3779 | -s "server hello, adding extended master secret extension" \ |
| 3780 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3781 | -c "session hash for extended master secret" \ |
| 3782 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3783 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3785 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3786 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3787 | "$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] | 3788 | 0 \ |
| 3789 | -c "client hello, adding extended_master_secret extension" \ |
| 3790 | -s "found extended master secret extension" \ |
| 3791 | -S "server hello, adding extended master secret extension" \ |
| 3792 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3793 | -C "session hash for extended master secret" \ |
| 3794 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3795 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3796 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3797 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3798 | "$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] | 3799 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3800 | 0 \ |
| 3801 | -C "client hello, adding extended_master_secret extension" \ |
| 3802 | -S "found extended master secret extension" \ |
| 3803 | -S "server hello, adding extended master secret extension" \ |
| 3804 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3805 | -C "session hash for extended master secret" \ |
| 3806 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3807 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3808 | # Test sending and receiving empty application data records |
| 3809 | |
| 3810 | run_test "Encrypt then MAC: empty application data record" \ |
| 3811 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3812 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3813 | 0 \ |
| 3814 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3815 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3816 | -c "0 bytes written in 1 fragments" |
| 3817 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3818 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3819 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3820 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3821 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3822 | 0 \ |
| 3823 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3824 | -c "0 bytes written in 1 fragments" |
| 3825 | |
| 3826 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3827 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3828 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3829 | 0 \ |
| 3830 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3831 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3832 | -c "0 bytes written in 1 fragments" |
| 3833 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3835 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3836 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3837 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3838 | 0 \ |
| 3839 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3840 | -c "0 bytes written in 1 fragments" |
| 3841 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3842 | # Tests for CBC 1/n-1 record splitting |
| 3843 | |
| 3844 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3845 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3846 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3847 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3848 | 0 \ |
| 3849 | -s "Read from client: 123 bytes read" \ |
| 3850 | -S "Read from client: 1 bytes read" \ |
| 3851 | -S "122 bytes read" |
| 3852 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3853 | # Tests for Session Tickets |
| 3854 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3855 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3856 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3857 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3858 | "$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] | 3859 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3860 | -c "client hello, adding session ticket extension" \ |
| 3861 | -s "found session ticket extension" \ |
| 3862 | -s "server hello, adding session ticket extension" \ |
| 3863 | -c "found session_ticket extension" \ |
| 3864 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3865 | -S "session successfully restored from cache" \ |
| 3866 | -s "session successfully restored from ticket" \ |
| 3867 | -s "a session has been resumed" \ |
| 3868 | -c "a session has been resumed" |
| 3869 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3871 | run_test "Session resume using tickets: manual rotation" \ |
| 3872 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3873 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3874 | 0 \ |
| 3875 | -c "client hello, adding session ticket extension" \ |
| 3876 | -s "found session ticket extension" \ |
| 3877 | -s "server hello, adding session ticket extension" \ |
| 3878 | -c "found session_ticket extension" \ |
| 3879 | -c "parse new session ticket" \ |
| 3880 | -S "session successfully restored from cache" \ |
| 3881 | -s "session successfully restored from ticket" \ |
| 3882 | -s "a session has been resumed" \ |
| 3883 | -c "a session has been resumed" |
| 3884 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3885 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3886 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3887 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3888 | "$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] | 3889 | 0 \ |
| 3890 | -c "client hello, adding session ticket extension" \ |
| 3891 | -s "found session ticket extension" \ |
| 3892 | -s "server hello, adding session ticket extension" \ |
| 3893 | -c "found session_ticket extension" \ |
| 3894 | -c "parse new session ticket" \ |
| 3895 | -S "session successfully restored from cache" \ |
| 3896 | -s "session successfully restored from ticket" \ |
| 3897 | -s "a session has been resumed" \ |
| 3898 | -c "a session has been resumed" |
| 3899 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3900 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3901 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3902 | "$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] | 3903 | "$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] | 3904 | 0 \ |
| 3905 | -c "client hello, adding session ticket extension" \ |
| 3906 | -s "found session ticket extension" \ |
| 3907 | -s "server hello, adding session ticket extension" \ |
| 3908 | -c "found session_ticket extension" \ |
| 3909 | -c "parse new session ticket" \ |
| 3910 | -S "session successfully restored from cache" \ |
| 3911 | -S "session successfully restored from ticket" \ |
| 3912 | -S "a session has been resumed" \ |
| 3913 | -C "a session has been resumed" |
| 3914 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3915 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3916 | run_test "Session resume using tickets: session copy" \ |
| 3917 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3918 | "$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] | 3919 | 0 \ |
| 3920 | -c "client hello, adding session ticket extension" \ |
| 3921 | -s "found session ticket extension" \ |
| 3922 | -s "server hello, adding session ticket extension" \ |
| 3923 | -c "found session_ticket extension" \ |
| 3924 | -c "parse new session ticket" \ |
| 3925 | -S "session successfully restored from cache" \ |
| 3926 | -s "session successfully restored from ticket" \ |
| 3927 | -s "a session has been resumed" \ |
| 3928 | -c "a session has been resumed" |
| 3929 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3931 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3932 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3933 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3934 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3935 | 0 \ |
| 3936 | -c "client hello, adding session ticket extension" \ |
| 3937 | -c "found session_ticket extension" \ |
| 3938 | -c "parse new session ticket" \ |
| 3939 | -c "a session has been resumed" |
| 3940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3942 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3943 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3944 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3945 | "( $O_CLI -sess_out $SESSION; \ |
| 3946 | $O_CLI -sess_in $SESSION; \ |
| 3947 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3948 | 0 \ |
| 3949 | -s "found session ticket extension" \ |
| 3950 | -s "server hello, adding session ticket extension" \ |
| 3951 | -S "session successfully restored from cache" \ |
| 3952 | -s "session successfully restored from ticket" \ |
| 3953 | -s "a session has been resumed" |
| 3954 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3955 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3956 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3957 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3958 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3959 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3960 | 0 \ |
| 3961 | -c "client hello, adding session ticket extension" \ |
| 3962 | -s "found session ticket extension" \ |
| 3963 | -s "server hello, adding session ticket extension" \ |
| 3964 | -c "found session_ticket extension" \ |
| 3965 | -c "parse new session ticket" \ |
| 3966 | -S "session successfully restored from cache" \ |
| 3967 | -s "session successfully restored from ticket" \ |
| 3968 | -s "a session has been resumed" \ |
| 3969 | -c "a session has been resumed" |
| 3970 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3971 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3972 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3973 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3974 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3975 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3976 | 0 \ |
| 3977 | -c "client hello, adding session ticket extension" \ |
| 3978 | -s "found session ticket extension" \ |
| 3979 | -s "server hello, adding session ticket extension" \ |
| 3980 | -c "found session_ticket extension" \ |
| 3981 | -c "parse new session ticket" \ |
| 3982 | -S "session successfully restored from cache" \ |
| 3983 | -s "session successfully restored from ticket" \ |
| 3984 | -s "a session has been resumed" \ |
| 3985 | -c "a session has been resumed" |
| 3986 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3987 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3988 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3989 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3990 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3991 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3992 | 0 \ |
| 3993 | -c "client hello, adding session ticket extension" \ |
| 3994 | -s "found session ticket extension" \ |
| 3995 | -s "server hello, adding session ticket extension" \ |
| 3996 | -c "found session_ticket extension" \ |
| 3997 | -c "parse new session ticket" \ |
| 3998 | -S "session successfully restored from cache" \ |
| 3999 | -s "session successfully restored from ticket" \ |
| 4000 | -s "a session has been resumed" \ |
| 4001 | -c "a session has been resumed" |
| 4002 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4003 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4004 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4005 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 4006 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4007 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4008 | 0 \ |
| 4009 | -c "client hello, adding session ticket extension" \ |
| 4010 | -s "found session ticket extension" \ |
| 4011 | -s "server hello, adding session ticket extension" \ |
| 4012 | -c "found session_ticket extension" \ |
| 4013 | -c "parse new session ticket" \ |
| 4014 | -S "session successfully restored from cache" \ |
| 4015 | -s "session successfully restored from ticket" \ |
| 4016 | -s "a session has been resumed" \ |
| 4017 | -c "a session has been resumed" |
| 4018 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4019 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4020 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4021 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 4022 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4023 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -c "client hello, adding session ticket extension" \ |
| 4026 | -s "found session ticket extension" \ |
| 4027 | -s "server hello, adding session ticket extension" \ |
| 4028 | -c "found session_ticket extension" \ |
| 4029 | -c "parse new session ticket" \ |
| 4030 | -S "session successfully restored from cache" \ |
| 4031 | -s "session successfully restored from ticket" \ |
| 4032 | -s "a session has been resumed" \ |
| 4033 | -c "a session has been resumed" |
| 4034 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4035 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4037 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 4038 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4039 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4040 | 0 \ |
| 4041 | -c "client hello, adding session ticket extension" \ |
| 4042 | -s "found session ticket extension" \ |
| 4043 | -s "server hello, adding session ticket extension" \ |
| 4044 | -c "found session_ticket extension" \ |
| 4045 | -c "parse new session ticket" \ |
| 4046 | -S "session successfully restored from cache" \ |
| 4047 | -s "session successfully restored from ticket" \ |
| 4048 | -s "a session has been resumed" \ |
| 4049 | -c "a session has been resumed" |
| 4050 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4051 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4053 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 4054 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4055 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4056 | 0 \ |
| 4057 | -c "client hello, adding session ticket extension" \ |
| 4058 | -s "found session ticket extension" \ |
| 4059 | -s "server hello, adding session ticket extension" \ |
| 4060 | -c "found session_ticket extension" \ |
| 4061 | -c "parse new session ticket" \ |
| 4062 | -S "session successfully restored from cache" \ |
| 4063 | -s "session successfully restored from ticket" \ |
| 4064 | -s "a session has been resumed" \ |
| 4065 | -c "a session has been resumed" |
| 4066 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4067 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4068 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4069 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4070 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4071 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4072 | 0 \ |
| 4073 | -c "client hello, adding session ticket extension" \ |
| 4074 | -s "found session ticket extension" \ |
| 4075 | -s "server hello, adding session ticket extension" \ |
| 4076 | -c "found session_ticket extension" \ |
| 4077 | -c "parse new session ticket" \ |
| 4078 | -S "session successfully restored from cache" \ |
| 4079 | -s "session successfully restored from ticket" \ |
| 4080 | -s "a session has been resumed" \ |
| 4081 | -c "a session has been resumed" |
| 4082 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4083 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4085 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4086 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4087 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4088 | 0 \ |
| 4089 | -c "client hello, adding session ticket extension" \ |
| 4090 | -s "found session ticket extension" \ |
| 4091 | -s "server hello, adding session ticket extension" \ |
| 4092 | -c "found session_ticket extension" \ |
| 4093 | -c "parse new session ticket" \ |
| 4094 | -S "session successfully restored from cache" \ |
| 4095 | -s "session successfully restored from ticket" \ |
| 4096 | -s "a session has been resumed" \ |
| 4097 | -c "a session has been resumed" |
| 4098 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4099 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4100 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4101 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4102 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4103 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4104 | 0 \ |
| 4105 | -c "client hello, adding session ticket extension" \ |
| 4106 | -s "found session ticket extension" \ |
| 4107 | -s "server hello, adding session ticket extension" \ |
| 4108 | -c "found session_ticket extension" \ |
| 4109 | -c "parse new session ticket" \ |
| 4110 | -S "session successfully restored from cache" \ |
| 4111 | -s "session successfully restored from ticket" \ |
| 4112 | -s "a session has been resumed" \ |
| 4113 | -c "a session has been resumed" |
| 4114 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4115 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4116 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4117 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4118 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4119 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4120 | 0 \ |
| 4121 | -c "client hello, adding session ticket extension" \ |
| 4122 | -s "found session ticket extension" \ |
| 4123 | -s "server hello, adding session ticket extension" \ |
| 4124 | -c "found session_ticket extension" \ |
| 4125 | -c "parse new session ticket" \ |
| 4126 | -S "session successfully restored from cache" \ |
| 4127 | -s "session successfully restored from ticket" \ |
| 4128 | -s "a session has been resumed" \ |
| 4129 | -c "a session has been resumed" |
| 4130 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4131 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4132 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4133 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4134 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4135 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4136 | 0 \ |
| 4137 | -c "client hello, adding session ticket extension" \ |
| 4138 | -s "found session ticket extension" \ |
| 4139 | -s "server hello, adding session ticket extension" \ |
| 4140 | -c "found session_ticket extension" \ |
| 4141 | -c "parse new session ticket" \ |
| 4142 | -S "session successfully restored from cache" \ |
| 4143 | -s "session successfully restored from ticket" \ |
| 4144 | -s "a session has been resumed" \ |
| 4145 | -c "a session has been resumed" |
| 4146 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4147 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4148 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4149 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4150 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4151 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4152 | 0 \ |
| 4153 | -c "client hello, adding session ticket extension" \ |
| 4154 | -s "found session ticket extension" \ |
| 4155 | -s "server hello, adding session ticket extension" \ |
| 4156 | -c "found session_ticket extension" \ |
| 4157 | -c "parse new session ticket" \ |
| 4158 | -S "session successfully restored from cache" \ |
| 4159 | -s "session successfully restored from ticket" \ |
| 4160 | -s "a session has been resumed" \ |
| 4161 | -c "a session has been resumed" |
| 4162 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4163 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4164 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4165 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4166 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4167 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4168 | 0 \ |
| 4169 | -c "client hello, adding session ticket extension" \ |
| 4170 | -s "found session ticket extension" \ |
| 4171 | -s "server hello, adding session ticket extension" \ |
| 4172 | -c "found session_ticket extension" \ |
| 4173 | -c "parse new session ticket" \ |
| 4174 | -S "session successfully restored from cache" \ |
| 4175 | -s "session successfully restored from ticket" \ |
| 4176 | -s "a session has been resumed" \ |
| 4177 | -c "a session has been resumed" |
| 4178 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4179 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4180 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4181 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4182 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4183 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4184 | 0 \ |
| 4185 | -c "client hello, adding session ticket extension" \ |
| 4186 | -s "found session ticket extension" \ |
| 4187 | -s "server hello, adding session ticket extension" \ |
| 4188 | -c "found session_ticket extension" \ |
| 4189 | -c "parse new session ticket" \ |
| 4190 | -S "session successfully restored from cache" \ |
| 4191 | -s "session successfully restored from ticket" \ |
| 4192 | -s "a session has been resumed" \ |
| 4193 | -c "a session has been resumed" |
| 4194 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4195 | # Tests for Session Tickets with DTLS |
| 4196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4198 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4199 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4200 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4201 | "$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] | 4202 | 0 \ |
| 4203 | -c "client hello, adding session ticket extension" \ |
| 4204 | -s "found session ticket extension" \ |
| 4205 | -s "server hello, adding session ticket extension" \ |
| 4206 | -c "found session_ticket extension" \ |
| 4207 | -c "parse new session ticket" \ |
| 4208 | -S "session successfully restored from cache" \ |
| 4209 | -s "session successfully restored from ticket" \ |
| 4210 | -s "a session has been resumed" \ |
| 4211 | -c "a session has been resumed" |
| 4212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4214 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4215 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4216 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4217 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4218 | 0 \ |
| 4219 | -c "client hello, adding session ticket extension" \ |
| 4220 | -s "found session ticket extension" \ |
| 4221 | -s "server hello, adding session ticket extension" \ |
| 4222 | -c "found session_ticket extension" \ |
| 4223 | -c "parse new session ticket" \ |
| 4224 | -S "session successfully restored from cache" \ |
| 4225 | -s "session successfully restored from ticket" \ |
| 4226 | -s "a session has been resumed" \ |
| 4227 | -c "a session has been resumed" |
| 4228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4230 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4231 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4232 | "$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] | 4233 | "$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] | 4234 | 0 \ |
| 4235 | -c "client hello, adding session ticket extension" \ |
| 4236 | -s "found session ticket extension" \ |
| 4237 | -s "server hello, adding session ticket extension" \ |
| 4238 | -c "found session_ticket extension" \ |
| 4239 | -c "parse new session ticket" \ |
| 4240 | -S "session successfully restored from cache" \ |
| 4241 | -S "session successfully restored from ticket" \ |
| 4242 | -S "a session has been resumed" \ |
| 4243 | -C "a session has been resumed" |
| 4244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4246 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4247 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4248 | "$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] | 4249 | "$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] | 4250 | 0 \ |
| 4251 | -c "client hello, adding session ticket extension" \ |
| 4252 | -s "found session ticket extension" \ |
| 4253 | -s "server hello, adding session ticket extension" \ |
| 4254 | -c "found session_ticket extension" \ |
| 4255 | -c "parse new session ticket" \ |
| 4256 | -S "session successfully restored from cache" \ |
| 4257 | -s "session successfully restored from ticket" \ |
| 4258 | -s "a session has been resumed" \ |
| 4259 | -c "a session has been resumed" |
| 4260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4262 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4263 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4264 | "$O_SRV -dtls" \ |
| 4265 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4266 | 0 \ |
| 4267 | -c "client hello, adding session ticket extension" \ |
| 4268 | -c "found session_ticket extension" \ |
| 4269 | -c "parse new session ticket" \ |
| 4270 | -c "a session has been resumed" |
| 4271 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4272 | # 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] | 4273 | # 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] | 4274 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4277 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4278 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4279 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4280 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4281 | rm -f $SESSION )" \ |
| 4282 | 0 \ |
| 4283 | -s "found session ticket extension" \ |
| 4284 | -s "server hello, adding session ticket extension" \ |
| 4285 | -S "session successfully restored from cache" \ |
| 4286 | -s "session successfully restored from ticket" \ |
| 4287 | -s "a session has been resumed" |
| 4288 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4289 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4290 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4292 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4293 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4294 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4295 | "$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] | 4296 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4297 | -c "client hello, adding session ticket extension" \ |
| 4298 | -s "found session ticket extension" \ |
| 4299 | -S "server hello, adding session ticket extension" \ |
| 4300 | -C "found session_ticket extension" \ |
| 4301 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4302 | -s "session successfully restored from cache" \ |
| 4303 | -S "session successfully restored from ticket" \ |
| 4304 | -s "a session has been resumed" \ |
| 4305 | -c "a session has been resumed" |
| 4306 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4307 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4308 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4309 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4310 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4311 | "$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] | 4312 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4313 | -C "client hello, adding session ticket extension" \ |
| 4314 | -S "found session ticket extension" \ |
| 4315 | -S "server hello, adding session ticket extension" \ |
| 4316 | -C "found session_ticket extension" \ |
| 4317 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4318 | -s "session successfully restored from cache" \ |
| 4319 | -S "session successfully restored from ticket" \ |
| 4320 | -s "a session has been resumed" \ |
| 4321 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4322 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4324 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4325 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4326 | "$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] | 4327 | 0 \ |
| 4328 | -S "session successfully restored from cache" \ |
| 4329 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4330 | -S "a session has been resumed" \ |
| 4331 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4332 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4333 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4334 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4335 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4336 | "$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] | 4337 | 0 \ |
| 4338 | -s "session successfully restored from cache" \ |
| 4339 | -S "session successfully restored from ticket" \ |
| 4340 | -s "a session has been resumed" \ |
| 4341 | -c "a session has been resumed" |
| 4342 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4343 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4344 | run_test "Session resume using cache: cache removed" \ |
| 4345 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4346 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4347 | 0 \ |
| 4348 | -C "client hello, adding session ticket extension" \ |
| 4349 | -S "found session ticket extension" \ |
| 4350 | -S "server hello, adding session ticket extension" \ |
| 4351 | -C "found session_ticket extension" \ |
| 4352 | -C "parse new session ticket" \ |
| 4353 | -S "session successfully restored from cache" \ |
| 4354 | -S "session successfully restored from ticket" \ |
| 4355 | -S "a session has been resumed" \ |
| 4356 | -C "a session has been resumed" |
| 4357 | |
| 4358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4359 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4360 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4361 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4362 | "$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] | 4363 | 0 \ |
| 4364 | -s "session successfully restored from cache" \ |
| 4365 | -S "session successfully restored from ticket" \ |
| 4366 | -s "a session has been resumed" \ |
| 4367 | -c "a session has been resumed" |
| 4368 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4370 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4371 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4372 | "$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] | 4373 | 0 \ |
| 4374 | -S "session successfully restored from cache" \ |
| 4375 | -S "session successfully restored from ticket" \ |
| 4376 | -S "a session has been resumed" \ |
| 4377 | -C "a session has been resumed" |
| 4378 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4379 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4380 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4381 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4382 | "$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] | 4383 | 0 \ |
| 4384 | -s "session successfully restored from cache" \ |
| 4385 | -S "session successfully restored from ticket" \ |
| 4386 | -s "a session has been resumed" \ |
| 4387 | -c "a session has been resumed" |
| 4388 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4389 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4390 | run_test "Session resume using cache: session copy" \ |
| 4391 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4392 | "$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] | 4393 | 0 \ |
| 4394 | -s "session successfully restored from cache" \ |
| 4395 | -S "session successfully restored from ticket" \ |
| 4396 | -s "a session has been resumed" \ |
| 4397 | -c "a session has been resumed" |
| 4398 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4399 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4400 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4401 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4402 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4403 | "( $O_CLI -sess_out $SESSION; \ |
| 4404 | $O_CLI -sess_in $SESSION; \ |
| 4405 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4406 | 0 \ |
| 4407 | -s "found session ticket extension" \ |
| 4408 | -S "server hello, adding session ticket extension" \ |
| 4409 | -s "session successfully restored from cache" \ |
| 4410 | -S "session successfully restored from ticket" \ |
| 4411 | -s "a session has been resumed" |
| 4412 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4415 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4416 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4417 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4418 | 0 \ |
| 4419 | -C "found session_ticket extension" \ |
| 4420 | -C "parse new session ticket" \ |
| 4421 | -c "a session has been resumed" |
| 4422 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4423 | # Tests for Session resume and extensions |
| 4424 | |
| 4425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4426 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4427 | run_test "Session resume and connection ID" \ |
| 4428 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4429 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4430 | 0 \ |
| 4431 | -c "Enable use of CID extension." \ |
| 4432 | -s "Enable use of CID extension." \ |
| 4433 | -c "client hello, adding CID extension" \ |
| 4434 | -s "found CID extension" \ |
| 4435 | -s "Use of CID extension negotiated" \ |
| 4436 | -s "server hello, adding CID extension" \ |
| 4437 | -c "found CID extension" \ |
| 4438 | -c "Use of CID extension negotiated" \ |
| 4439 | -s "Copy CIDs into SSL transform" \ |
| 4440 | -c "Copy CIDs into SSL transform" \ |
| 4441 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4442 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4443 | -s "Use of Connection ID has been negotiated" \ |
| 4444 | -c "Use of Connection ID has been negotiated" |
| 4445 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4446 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4447 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4449 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4451 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4452 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4453 | "$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] | 4454 | 0 \ |
| 4455 | -c "client hello, adding session ticket extension" \ |
| 4456 | -s "found session ticket extension" \ |
| 4457 | -S "server hello, adding session ticket extension" \ |
| 4458 | -C "found session_ticket extension" \ |
| 4459 | -C "parse new session ticket" \ |
| 4460 | -s "session successfully restored from cache" \ |
| 4461 | -S "session successfully restored from ticket" \ |
| 4462 | -s "a session has been resumed" \ |
| 4463 | -c "a session has been resumed" |
| 4464 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4466 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4467 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4468 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4469 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4470 | "$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] | 4471 | 0 \ |
| 4472 | -C "client hello, adding session ticket extension" \ |
| 4473 | -S "found session ticket extension" \ |
| 4474 | -S "server hello, adding session ticket extension" \ |
| 4475 | -C "found session_ticket extension" \ |
| 4476 | -C "parse new session ticket" \ |
| 4477 | -s "session successfully restored from cache" \ |
| 4478 | -S "session successfully restored from ticket" \ |
| 4479 | -s "a session has been resumed" \ |
| 4480 | -c "a session has been resumed" |
| 4481 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4484 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4485 | "$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] | 4486 | "$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] | 4487 | 0 \ |
| 4488 | -S "session successfully restored from cache" \ |
| 4489 | -S "session successfully restored from ticket" \ |
| 4490 | -S "a session has been resumed" \ |
| 4491 | -C "a session has been resumed" |
| 4492 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4494 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4495 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4496 | "$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] | 4497 | "$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] | 4498 | 0 \ |
| 4499 | -s "session successfully restored from cache" \ |
| 4500 | -S "session successfully restored from ticket" \ |
| 4501 | -s "a session has been resumed" \ |
| 4502 | -c "a session has been resumed" |
| 4503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4505 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4506 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4507 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4508 | "$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] | 4509 | 0 \ |
| 4510 | -s "session successfully restored from cache" \ |
| 4511 | -S "session successfully restored from ticket" \ |
| 4512 | -s "a session has been resumed" \ |
| 4513 | -c "a session has been resumed" |
| 4514 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4516 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4517 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4518 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4519 | "$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] | 4520 | 0 \ |
| 4521 | -S "session successfully restored from cache" \ |
| 4522 | -S "session successfully restored from ticket" \ |
| 4523 | -S "a session has been resumed" \ |
| 4524 | -C "a session has been resumed" |
| 4525 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4527 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4528 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4529 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4530 | "$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] | 4531 | 0 \ |
| 4532 | -s "session successfully restored from cache" \ |
| 4533 | -S "session successfully restored from ticket" \ |
| 4534 | -s "a session has been resumed" \ |
| 4535 | -c "a session has been resumed" |
| 4536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4538 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4539 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4540 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4541 | "$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] | 4542 | 0 \ |
| 4543 | -s "session successfully restored from cache" \ |
| 4544 | -S "session successfully restored from ticket" \ |
| 4545 | -s "a session has been resumed" \ |
| 4546 | -c "a session has been resumed" |
| 4547 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4548 | # 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] | 4549 | # 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] | 4550 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4553 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4554 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4555 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4556 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4557 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4558 | rm -f $SESSION )" \ |
| 4559 | 0 \ |
| 4560 | -s "found session ticket extension" \ |
| 4561 | -S "server hello, adding session ticket extension" \ |
| 4562 | -s "session successfully restored from cache" \ |
| 4563 | -S "session successfully restored from ticket" \ |
| 4564 | -s "a session has been resumed" |
| 4565 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4567 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4568 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4569 | "$O_SRV -dtls" \ |
| 4570 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4571 | 0 \ |
| 4572 | -C "found session_ticket extension" \ |
| 4573 | -C "parse new session ticket" \ |
| 4574 | -c "a session has been resumed" |
| 4575 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4576 | # Tests for Max Fragment Length extension |
| 4577 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4580 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4581 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4582 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4583 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4584 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4585 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4586 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4587 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4588 | -C "client hello, adding max_fragment_length extension" \ |
| 4589 | -S "found max fragment length extension" \ |
| 4590 | -S "server hello, max_fragment_length extension" \ |
| 4591 | -C "found max_fragment_length extension" |
| 4592 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4593 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4595 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4596 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4597 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4598 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4599 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4600 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4601 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4602 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4603 | -C "client hello, adding max_fragment_length extension" \ |
| 4604 | -S "found max fragment length extension" \ |
| 4605 | -S "server hello, max_fragment_length extension" \ |
| 4606 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4607 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4608 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4609 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4610 | |
| 4611 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4613 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4614 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4615 | "$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] | 4616 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4617 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4618 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4619 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4620 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4621 | -C "client hello, adding max_fragment_length extension" \ |
| 4622 | -S "found max fragment length extension" \ |
| 4623 | -S "server hello, max_fragment_length extension" \ |
| 4624 | -C "found max_fragment_length extension" \ |
| 4625 | -c "fragment larger than.*maximum " |
| 4626 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4627 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4628 | # (session fragment length will be 16384 regardless of mbedtls |
| 4629 | # content length configuration.) |
| 4630 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4631 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4633 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4634 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4635 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4636 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4637 | -C "Maximum incoming record payload length is 16384" \ |
| 4638 | -C "Maximum outgoing record payload length is 16384" \ |
| 4639 | -S "Maximum incoming record payload length is 16384" \ |
| 4640 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4641 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4642 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4643 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4644 | |
| 4645 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4647 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4648 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4649 | "$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] | 4650 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4651 | -C "Maximum incoming record payload length is 16384" \ |
| 4652 | -C "Maximum outgoing record payload length is 16384" \ |
| 4653 | -S "Maximum incoming record payload length is 16384" \ |
| 4654 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4655 | -c "fragment larger than.*maximum " |
| 4656 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4657 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4658 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4659 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4660 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4661 | "$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] | 4662 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4663 | -c "Maximum incoming record payload length is 4096" \ |
| 4664 | -c "Maximum outgoing record payload length is 4096" \ |
| 4665 | -s "Maximum incoming record payload length is 4096" \ |
| 4666 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4667 | -c "client hello, adding max_fragment_length extension" \ |
| 4668 | -s "found max fragment length extension" \ |
| 4669 | -s "server hello, max_fragment_length extension" \ |
| 4670 | -c "found max_fragment_length extension" |
| 4671 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4672 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4674 | run_test "Max fragment length: client 512, server 1024" \ |
| 4675 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4676 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4677 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4678 | -c "Maximum incoming record payload length is 512" \ |
| 4679 | -c "Maximum outgoing record payload length is 512" \ |
| 4680 | -s "Maximum incoming record payload length is 512" \ |
| 4681 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4682 | -c "client hello, adding max_fragment_length extension" \ |
| 4683 | -s "found max fragment length extension" \ |
| 4684 | -s "server hello, max_fragment_length extension" \ |
| 4685 | -c "found max_fragment_length extension" |
| 4686 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4687 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4688 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4689 | run_test "Max fragment length: client 512, server 2048" \ |
| 4690 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4691 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4692 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4693 | -c "Maximum incoming record payload length is 512" \ |
| 4694 | -c "Maximum outgoing record payload length is 512" \ |
| 4695 | -s "Maximum incoming record payload length is 512" \ |
| 4696 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4697 | -c "client hello, adding max_fragment_length extension" \ |
| 4698 | -s "found max fragment length extension" \ |
| 4699 | -s "server hello, max_fragment_length extension" \ |
| 4700 | -c "found max_fragment_length extension" |
| 4701 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4702 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4703 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4704 | run_test "Max fragment length: client 512, server 4096" \ |
| 4705 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4706 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4707 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4708 | -c "Maximum incoming record payload length is 512" \ |
| 4709 | -c "Maximum outgoing record payload length is 512" \ |
| 4710 | -s "Maximum incoming record payload length is 512" \ |
| 4711 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4712 | -c "client hello, adding max_fragment_length extension" \ |
| 4713 | -s "found max fragment length extension" \ |
| 4714 | -s "server hello, max_fragment_length extension" \ |
| 4715 | -c "found max_fragment_length extension" |
| 4716 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4717 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4718 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4719 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4720 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4721 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4722 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4723 | -c "Maximum incoming record payload length is 1024" \ |
| 4724 | -c "Maximum outgoing record payload length is 1024" \ |
| 4725 | -s "Maximum incoming record payload length is 1024" \ |
| 4726 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4727 | -c "client hello, adding max_fragment_length extension" \ |
| 4728 | -s "found max fragment length extension" \ |
| 4729 | -s "server hello, max_fragment_length extension" \ |
| 4730 | -c "found max_fragment_length extension" |
| 4731 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4732 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4733 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4734 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4735 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4736 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4737 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4738 | -c "Maximum incoming record payload length is 1024" \ |
| 4739 | -c "Maximum outgoing record payload length is 1024" \ |
| 4740 | -s "Maximum incoming record payload length is 1024" \ |
| 4741 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4742 | -c "client hello, adding max_fragment_length extension" \ |
| 4743 | -s "found max fragment length extension" \ |
| 4744 | -s "server hello, max_fragment_length extension" \ |
| 4745 | -c "found max_fragment_length extension" |
| 4746 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4747 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4748 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4749 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4750 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4751 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4752 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4753 | -c "Maximum incoming record payload length is 1024" \ |
| 4754 | -c "Maximum outgoing record payload length is 1024" \ |
| 4755 | -s "Maximum incoming record payload length is 1024" \ |
| 4756 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4757 | -c "client hello, adding max_fragment_length extension" \ |
| 4758 | -s "found max fragment length extension" \ |
| 4759 | -s "server hello, max_fragment_length extension" \ |
| 4760 | -c "found max_fragment_length extension" |
| 4761 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4762 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4763 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4764 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4765 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4766 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4767 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4768 | -c "Maximum incoming record payload length is 2048" \ |
| 4769 | -c "Maximum outgoing record payload length is 2048" \ |
| 4770 | -s "Maximum incoming record payload length is 2048" \ |
| 4771 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4772 | -c "client hello, adding max_fragment_length extension" \ |
| 4773 | -s "found max fragment length extension" \ |
| 4774 | -s "server hello, max_fragment_length extension" \ |
| 4775 | -c "found max_fragment_length extension" |
| 4776 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4777 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4778 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4779 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4780 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4781 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4782 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4783 | -c "Maximum incoming record payload length is 2048" \ |
| 4784 | -c "Maximum outgoing record payload length is 2048" \ |
| 4785 | -s "Maximum incoming record payload length is 2048" \ |
| 4786 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4787 | -c "client hello, adding max_fragment_length extension" \ |
| 4788 | -s "found max fragment length extension" \ |
| 4789 | -s "server hello, max_fragment_length extension" \ |
| 4790 | -c "found max_fragment_length extension" |
| 4791 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4792 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4793 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4794 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4795 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4796 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4797 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4798 | -c "Maximum incoming record payload length is 2048" \ |
| 4799 | -c "Maximum outgoing record payload length is 2048" \ |
| 4800 | -s "Maximum incoming record payload length is 2048" \ |
| 4801 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4802 | -c "client hello, adding max_fragment_length extension" \ |
| 4803 | -s "found max fragment length extension" \ |
| 4804 | -s "server hello, max_fragment_length extension" \ |
| 4805 | -c "found max_fragment_length extension" |
| 4806 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4807 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4808 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4809 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4810 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4811 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4812 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4813 | -c "Maximum incoming record payload length is 4096" \ |
| 4814 | -c "Maximum outgoing record payload length is 4096" \ |
| 4815 | -s "Maximum incoming record payload length is 4096" \ |
| 4816 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4817 | -c "client hello, adding max_fragment_length extension" \ |
| 4818 | -s "found max fragment length extension" \ |
| 4819 | -s "server hello, max_fragment_length extension" \ |
| 4820 | -c "found max_fragment_length extension" |
| 4821 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4822 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4824 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4825 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4826 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4827 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4828 | -c "Maximum incoming record payload length is 4096" \ |
| 4829 | -c "Maximum outgoing record payload length is 4096" \ |
| 4830 | -s "Maximum incoming record payload length is 4096" \ |
| 4831 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4832 | -c "client hello, adding max_fragment_length extension" \ |
| 4833 | -s "found max fragment length extension" \ |
| 4834 | -s "server hello, max_fragment_length extension" \ |
| 4835 | -c "found max_fragment_length extension" |
| 4836 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4837 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4838 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4839 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4840 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4841 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4842 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4843 | -c "Maximum incoming record payload length is 4096" \ |
| 4844 | -c "Maximum outgoing record payload length is 4096" \ |
| 4845 | -s "Maximum incoming record payload length is 4096" \ |
| 4846 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4847 | -c "client hello, adding max_fragment_length extension" \ |
| 4848 | -s "found max fragment length extension" \ |
| 4849 | -s "server hello, max_fragment_length extension" \ |
| 4850 | -c "found max_fragment_length extension" |
| 4851 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4852 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4854 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4855 | "$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] | 4856 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4857 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4858 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4859 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4860 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4861 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4862 | -C "client hello, adding max_fragment_length extension" \ |
| 4863 | -S "found max fragment length extension" \ |
| 4864 | -S "server hello, max_fragment_length extension" \ |
| 4865 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4866 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4867 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4868 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4869 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4871 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4872 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4873 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4874 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4875 | -c "Maximum incoming record payload length is 4096" \ |
| 4876 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4877 | -c "client hello, adding max_fragment_length extension" \ |
| 4878 | -c "found max_fragment_length extension" |
| 4879 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4880 | requires_max_content_len 2048 |
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 | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4882 | run_test "Max fragment length: client, message just fits" \ |
| 4883 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4884 | "$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] | 4885 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4886 | -c "Maximum incoming record payload length is 2048" \ |
| 4887 | -c "Maximum outgoing record payload length is 2048" \ |
| 4888 | -s "Maximum incoming record payload length is 2048" \ |
| 4889 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4890 | -c "client hello, adding max_fragment_length extension" \ |
| 4891 | -s "found max fragment length extension" \ |
| 4892 | -s "server hello, max_fragment_length extension" \ |
| 4893 | -c "found max_fragment_length extension" \ |
| 4894 | -c "2048 bytes written in 1 fragments" \ |
| 4895 | -s "2048 bytes read" |
| 4896 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4897 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4898 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4899 | run_test "Max fragment length: client, larger message" \ |
| 4900 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4901 | "$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] | 4902 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4903 | -c "Maximum incoming record payload length is 2048" \ |
| 4904 | -c "Maximum outgoing record payload length is 2048" \ |
| 4905 | -s "Maximum incoming record payload length is 2048" \ |
| 4906 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4907 | -c "client hello, adding max_fragment_length extension" \ |
| 4908 | -s "found max fragment length extension" \ |
| 4909 | -s "server hello, max_fragment_length extension" \ |
| 4910 | -c "found max_fragment_length extension" \ |
| 4911 | -c "2345 bytes written in 2 fragments" \ |
| 4912 | -s "2048 bytes read" \ |
| 4913 | -s "297 bytes read" |
| 4914 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4915 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4916 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4918 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4919 | "$P_SRV debug_level=3 dtls=1" \ |
| 4920 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4921 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4922 | -c "Maximum incoming record payload length is 2048" \ |
| 4923 | -c "Maximum outgoing record payload length is 2048" \ |
| 4924 | -s "Maximum incoming record payload length is 2048" \ |
| 4925 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4926 | -c "client hello, adding max_fragment_length extension" \ |
| 4927 | -s "found max fragment length extension" \ |
| 4928 | -s "server hello, max_fragment_length extension" \ |
| 4929 | -c "found max_fragment_length extension" \ |
| 4930 | -c "fragment larger than.*maximum" |
| 4931 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4932 | # Tests for Record Size Limit extension |
| 4933 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4934 | requires_gnutls_tls1_3 |
| 4935 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4936 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4937 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4938 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4939 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4940 | 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] | 4941 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4942 | "$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] | 4943 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4944 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4945 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4946 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4947 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4948 | |
| 4949 | requires_gnutls_tls1_3 |
| 4950 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4951 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 4952 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4953 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4954 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4955 | 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] | 4956 | "$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] | 4957 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4958 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4959 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4960 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4961 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4962 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4963 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4964 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4965 | # maximum record size using gnutls_record_set_max_size() |
| 4966 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4967 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4968 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4969 | # more recent function gnutls_record_set_max_recv_size() |
| 4970 | # (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] | 4971 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4972 | # 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] | 4973 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4974 | # Also, the value sent in the extension will be one larger than the value |
| 4975 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4976 | # 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] | 4977 | |
| 4978 | # 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] | 4979 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4980 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4981 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4982 | requires_gnutls_tls1_3 |
| 4983 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4984 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4985 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4987 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4988 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4989 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4990 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4991 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4992 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4993 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4994 | 0 \ |
| 4995 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4996 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4997 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4998 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4999 | -s "Maximum outgoing record payload length is 511" \ |
| 5000 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5001 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5002 | requires_gnutls_tls1_3 |
| 5003 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5005 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5006 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5007 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5008 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 5009 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5010 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5011 | response_size=768" \ |
| 5012 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5013 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5014 | 0 \ |
| 5015 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5016 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5017 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5018 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5019 | -s "Maximum outgoing record payload length is 511" \ |
| 5020 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5021 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5022 | requires_gnutls_tls1_3 |
| 5023 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5024 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5025 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5026 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5027 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5028 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 5029 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5030 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5031 | response_size=1280" \ |
| 5032 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5033 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5034 | 0 \ |
| 5035 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5036 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5037 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5038 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5039 | -s "Maximum outgoing record payload length is 511" \ |
| 5040 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5041 | |
| 5042 | requires_gnutls_tls1_3 |
| 5043 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5044 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5045 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5046 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5048 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 5049 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 5050 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5051 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5052 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5053 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5054 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5055 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5056 | -s "Maximum outgoing record payload length is 1023" \ |
| 5057 | -s "512 bytes written in 1 fragments" |
| 5058 | |
| 5059 | requires_gnutls_tls1_3 |
| 5060 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5061 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5062 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5063 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5064 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5065 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 5066 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5067 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5068 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5069 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5070 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5071 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5072 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5073 | -s "Maximum outgoing record payload length is 1023" \ |
| 5074 | -s "1536 bytes written in 2 fragments" |
| 5075 | |
| 5076 | requires_gnutls_tls1_3 |
| 5077 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5078 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5079 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5080 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5081 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5082 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5083 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5084 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5085 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5086 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5087 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5088 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5089 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5090 | -s "Maximum outgoing record payload length is 1023" \ |
| 5091 | -s "2560 bytes written in 3 fragments" |
| 5092 | |
| 5093 | requires_gnutls_tls1_3 |
| 5094 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5095 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5096 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5099 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5100 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5101 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5102 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5103 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5104 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5105 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5106 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5107 | -s "Maximum outgoing record payload length is 4095" \ |
| 5108 | -s "2048 bytes written in 1 fragments" |
| 5109 | |
| 5110 | requires_gnutls_tls1_3 |
| 5111 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5112 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5113 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5114 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5115 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5116 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5117 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5118 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5119 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5120 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5121 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5122 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5123 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5124 | -s "Maximum outgoing record payload length is 4095" \ |
| 5125 | -s "6144 bytes written in 2 fragments" |
| 5126 | |
| 5127 | requires_gnutls_tls1_3 |
| 5128 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5129 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5130 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5131 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5133 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5134 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5135 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5136 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5137 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5138 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5139 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5140 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5141 | -s "Maximum outgoing record payload length is 4095" \ |
| 5142 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5143 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5144 | requires_gnutls_tls1_3 |
| 5145 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5146 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5147 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5149 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5150 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5151 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5152 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5153 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5154 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5155 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5156 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5157 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5158 | -c "Maximum outgoing record payload length is 511" \ |
| 5159 | -c "256 bytes written in 1 fragments" |
| 5160 | |
| 5161 | requires_gnutls_tls1_3 |
| 5162 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5163 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5164 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5165 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5166 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5167 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5168 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5169 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5170 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5171 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5172 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5173 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5174 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5175 | -c "Maximum outgoing record payload length is 511" \ |
| 5176 | -c "768 bytes written in 2 fragments" |
| 5177 | |
| 5178 | requires_gnutls_tls1_3 |
| 5179 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5180 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5181 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5183 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5184 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5185 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5186 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5187 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5188 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5189 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5190 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5191 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5192 | -c "Maximum outgoing record payload length is 511" \ |
| 5193 | -c "1280 bytes written in 3 fragments" |
| 5194 | |
| 5195 | requires_gnutls_tls1_3 |
| 5196 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5197 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5198 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5199 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5200 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5201 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5202 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5203 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5204 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5205 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5206 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5207 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5208 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5209 | -c "Maximum outgoing record payload length is 1023" \ |
| 5210 | -c "512 bytes written in 1 fragments" |
| 5211 | |
| 5212 | requires_gnutls_tls1_3 |
| 5213 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5214 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5215 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5216 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5217 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5218 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5219 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5220 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5221 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5222 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5223 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5224 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5225 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5226 | -c "Maximum outgoing record payload length is 1023" \ |
| 5227 | -c "1536 bytes written in 2 fragments" |
| 5228 | |
| 5229 | requires_gnutls_tls1_3 |
| 5230 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5231 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5232 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5233 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5234 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5235 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5236 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5237 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5238 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5239 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5240 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5241 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5242 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5243 | -c "Maximum outgoing record payload length is 1023" \ |
| 5244 | -c "2560 bytes written in 3 fragments" |
| 5245 | |
| 5246 | requires_gnutls_tls1_3 |
| 5247 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5248 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5249 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5250 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5251 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5252 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5253 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5254 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5255 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5256 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5257 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5258 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5259 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5260 | -c "Maximum outgoing record payload length is 4095" \ |
| 5261 | -c "2048 bytes written in 1 fragments" |
| 5262 | |
| 5263 | requires_gnutls_tls1_3 |
| 5264 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5265 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5266 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5267 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5268 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5269 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5270 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5271 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5272 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5273 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5274 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5275 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5276 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5277 | -c "Maximum outgoing record payload length is 4095" \ |
| 5278 | -c "6144 bytes written in 2 fragments" |
| 5279 | |
| 5280 | requires_gnutls_tls1_3 |
| 5281 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5282 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5283 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5285 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5286 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5287 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5288 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5289 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5290 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5291 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5292 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5293 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5294 | -c "Maximum outgoing record payload length is 4095" \ |
| 5295 | -c "10240 bytes written in 3 fragments" |
| 5296 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5297 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5298 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5299 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5300 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5302 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5303 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5304 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5306 | 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] | 5307 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5308 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5309 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5310 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5311 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5312 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5313 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5314 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5315 | -s "Maximum incoming record payload length is 16384" |
| 5316 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5317 | # End of Record size limit tests |
| 5318 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5319 | # Tests for renegotiation |
| 5320 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5321 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5322 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5323 | # TLS 1.3 extensions in the initial handshake. |
| 5324 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5325 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5326 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5327 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5328 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5329 | 0 \ |
| 5330 | -C "client hello, adding renegotiation extension" \ |
| 5331 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5332 | -S "found renegotiation extension" \ |
| 5333 | -s "server hello, secure renegotiation extension" \ |
| 5334 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5335 | -C "=> renegotiate" \ |
| 5336 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5337 | -S "write hello request" |
| 5338 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5340 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5341 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5342 | "$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] | 5343 | 0 \ |
| 5344 | -c "client hello, adding renegotiation extension" \ |
| 5345 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5346 | -s "found renegotiation extension" \ |
| 5347 | -s "server hello, secure renegotiation extension" \ |
| 5348 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5349 | -c "=> renegotiate" \ |
| 5350 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5351 | -S "write hello request" |
| 5352 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5354 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5355 | "$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] | 5356 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5357 | 0 \ |
| 5358 | -c "client hello, adding renegotiation extension" \ |
| 5359 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5360 | -s "found renegotiation extension" \ |
| 5361 | -s "server hello, secure renegotiation extension" \ |
| 5362 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5363 | -c "=> renegotiate" \ |
| 5364 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5365 | -s "write hello request" |
| 5366 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5367 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5368 | # 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] | 5369 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5371 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5372 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5373 | "$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] | 5374 | 0 \ |
| 5375 | -c "client hello, adding renegotiation extension" \ |
| 5376 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5377 | -s "found renegotiation extension" \ |
| 5378 | -s "server hello, secure renegotiation extension" \ |
| 5379 | -c "found renegotiation extension" \ |
| 5380 | -c "=> renegotiate" \ |
| 5381 | -s "=> renegotiate" \ |
| 5382 | -S "write hello request" \ |
| 5383 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5384 | |
| 5385 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5386 | # 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] | 5387 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5388 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5389 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5390 | "$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] | 5391 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5392 | 0 \ |
| 5393 | -c "client hello, adding renegotiation extension" \ |
| 5394 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5395 | -s "found renegotiation extension" \ |
| 5396 | -s "server hello, secure renegotiation extension" \ |
| 5397 | -c "found renegotiation extension" \ |
| 5398 | -c "=> renegotiate" \ |
| 5399 | -s "=> renegotiate" \ |
| 5400 | -s "write hello request" \ |
| 5401 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5402 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5403 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5405 | "$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] | 5406 | "$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] | 5407 | 0 \ |
| 5408 | -c "client hello, adding renegotiation extension" \ |
| 5409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5410 | -s "found renegotiation extension" \ |
| 5411 | -s "server hello, secure renegotiation extension" \ |
| 5412 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5413 | -c "=> renegotiate" \ |
| 5414 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5415 | -s "write hello request" |
| 5416 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5418 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5419 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5420 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5421 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5422 | "$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" \ |
| 5423 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5424 | -c "Maximum incoming record payload length is 2048" \ |
| 5425 | -c "Maximum outgoing record payload length is 2048" \ |
| 5426 | -s "Maximum incoming record payload length is 2048" \ |
| 5427 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5428 | -c "client hello, adding max_fragment_length extension" \ |
| 5429 | -s "found max fragment length extension" \ |
| 5430 | -s "server hello, max_fragment_length extension" \ |
| 5431 | -c "found max_fragment_length extension" \ |
| 5432 | -c "client hello, adding renegotiation extension" \ |
| 5433 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5434 | -s "found renegotiation extension" \ |
| 5435 | -s "server hello, secure renegotiation extension" \ |
| 5436 | -c "found renegotiation extension" \ |
| 5437 | -c "=> renegotiate" \ |
| 5438 | -s "=> renegotiate" \ |
| 5439 | -s "write hello request" |
| 5440 | |
| 5441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5442 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5443 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5444 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5445 | 1 \ |
| 5446 | -c "client hello, adding renegotiation extension" \ |
| 5447 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5448 | -S "found renegotiation extension" \ |
| 5449 | -s "server hello, secure renegotiation extension" \ |
| 5450 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5451 | -c "=> renegotiate" \ |
| 5452 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5453 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5454 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5455 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5456 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5457 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5458 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5459 | "$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] | 5460 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5461 | 0 \ |
| 5462 | -C "client hello, adding renegotiation extension" \ |
| 5463 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5464 | -S "found renegotiation extension" \ |
| 5465 | -s "server hello, secure renegotiation extension" \ |
| 5466 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5467 | -C "=> renegotiate" \ |
| 5468 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5469 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5470 | -S "SSL - An unexpected message was received from our peer" \ |
| 5471 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5472 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5473 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5474 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5475 | "$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] | 5476 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5477 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5478 | 0 \ |
| 5479 | -C "client hello, adding renegotiation extension" \ |
| 5480 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5481 | -S "found renegotiation extension" \ |
| 5482 | -s "server hello, secure renegotiation extension" \ |
| 5483 | -c "found renegotiation extension" \ |
| 5484 | -C "=> renegotiate" \ |
| 5485 | -S "=> renegotiate" \ |
| 5486 | -s "write hello request" \ |
| 5487 | -S "SSL - An unexpected message was received from our peer" \ |
| 5488 | -S "failed" |
| 5489 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5490 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5491 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5492 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5493 | "$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] | 5494 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5495 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5496 | 0 \ |
| 5497 | -C "client hello, adding renegotiation extension" \ |
| 5498 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5499 | -S "found renegotiation extension" \ |
| 5500 | -s "server hello, secure renegotiation extension" \ |
| 5501 | -c "found renegotiation extension" \ |
| 5502 | -C "=> renegotiate" \ |
| 5503 | -S "=> renegotiate" \ |
| 5504 | -s "write hello request" \ |
| 5505 | -S "SSL - An unexpected message was received from our peer" \ |
| 5506 | -S "failed" |
| 5507 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5508 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5509 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5510 | "$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] | 5511 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5512 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5513 | 0 \ |
| 5514 | -C "client hello, adding renegotiation extension" \ |
| 5515 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5516 | -S "found renegotiation extension" \ |
| 5517 | -s "server hello, secure renegotiation extension" \ |
| 5518 | -c "found renegotiation extension" \ |
| 5519 | -C "=> renegotiate" \ |
| 5520 | -S "=> renegotiate" \ |
| 5521 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5522 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5523 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5524 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5525 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5526 | "$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] | 5527 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5528 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5529 | 0 \ |
| 5530 | -c "client hello, adding renegotiation extension" \ |
| 5531 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5532 | -s "found renegotiation extension" \ |
| 5533 | -s "server hello, secure renegotiation extension" \ |
| 5534 | -c "found renegotiation extension" \ |
| 5535 | -c "=> renegotiate" \ |
| 5536 | -s "=> renegotiate" \ |
| 5537 | -s "write hello request" \ |
| 5538 | -S "SSL - An unexpected message was received from our peer" \ |
| 5539 | -S "failed" |
| 5540 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5542 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5543 | "$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] | 5544 | "$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] | 5545 | 0 \ |
| 5546 | -C "client hello, adding renegotiation extension" \ |
| 5547 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5548 | -S "found renegotiation extension" \ |
| 5549 | -s "server hello, secure renegotiation extension" \ |
| 5550 | -c "found renegotiation extension" \ |
| 5551 | -S "record counter limit reached: renegotiate" \ |
| 5552 | -C "=> renegotiate" \ |
| 5553 | -S "=> renegotiate" \ |
| 5554 | -S "write hello request" \ |
| 5555 | -S "SSL - An unexpected message was received from our peer" \ |
| 5556 | -S "failed" |
| 5557 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5558 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5560 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5561 | "$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] | 5562 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5563 | 0 \ |
| 5564 | -c "client hello, adding renegotiation extension" \ |
| 5565 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5566 | -s "found renegotiation extension" \ |
| 5567 | -s "server hello, secure renegotiation extension" \ |
| 5568 | -c "found renegotiation extension" \ |
| 5569 | -s "record counter limit reached: renegotiate" \ |
| 5570 | -c "=> renegotiate" \ |
| 5571 | -s "=> renegotiate" \ |
| 5572 | -s "write hello request" \ |
| 5573 | -S "SSL - An unexpected message was received from our peer" \ |
| 5574 | -S "failed" |
| 5575 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5577 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5578 | "$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] | 5579 | "$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] | 5580 | 0 \ |
| 5581 | -c "client hello, adding renegotiation extension" \ |
| 5582 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5583 | -s "found renegotiation extension" \ |
| 5584 | -s "server hello, secure renegotiation extension" \ |
| 5585 | -c "found renegotiation extension" \ |
| 5586 | -s "record counter limit reached: renegotiate" \ |
| 5587 | -c "=> renegotiate" \ |
| 5588 | -s "=> renegotiate" \ |
| 5589 | -s "write hello request" \ |
| 5590 | -S "SSL - An unexpected message was received from our peer" \ |
| 5591 | -S "failed" |
| 5592 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5593 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5594 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5595 | "$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] | 5596 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5597 | 0 \ |
| 5598 | -C "client hello, adding renegotiation extension" \ |
| 5599 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5600 | -S "found renegotiation extension" \ |
| 5601 | -s "server hello, secure renegotiation extension" \ |
| 5602 | -c "found renegotiation extension" \ |
| 5603 | -S "record counter limit reached: renegotiate" \ |
| 5604 | -C "=> renegotiate" \ |
| 5605 | -S "=> renegotiate" \ |
| 5606 | -S "write hello request" \ |
| 5607 | -S "SSL - An unexpected message was received from our peer" \ |
| 5608 | -S "failed" |
| 5609 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5610 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5611 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5612 | "$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] | 5613 | "$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] | 5614 | 0 \ |
| 5615 | -c "client hello, adding renegotiation extension" \ |
| 5616 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5617 | -s "found renegotiation extension" \ |
| 5618 | -s "server hello, secure renegotiation extension" \ |
| 5619 | -c "found renegotiation extension" \ |
| 5620 | -c "=> renegotiate" \ |
| 5621 | -s "=> renegotiate" \ |
| 5622 | -S "write hello request" |
| 5623 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5625 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5626 | "$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] | 5627 | "$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] | 5628 | 0 \ |
| 5629 | -c "client hello, adding renegotiation extension" \ |
| 5630 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5631 | -s "found renegotiation extension" \ |
| 5632 | -s "server hello, secure renegotiation extension" \ |
| 5633 | -c "found renegotiation extension" \ |
| 5634 | -c "=> renegotiate" \ |
| 5635 | -s "=> renegotiate" \ |
| 5636 | -s "write hello request" |
| 5637 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5638 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5640 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5641 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5642 | "$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] | 5643 | 0 \ |
| 5644 | -c "client hello, adding renegotiation extension" \ |
| 5645 | -c "found renegotiation extension" \ |
| 5646 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5647 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5648 | -C "error" \ |
| 5649 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5650 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5651 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5652 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5654 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5655 | "$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] | 5656 | "$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] | 5657 | 0 \ |
| 5658 | -c "client hello, adding renegotiation extension" \ |
| 5659 | -c "found renegotiation extension" \ |
| 5660 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5661 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5662 | -C "error" \ |
| 5663 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5664 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5665 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5668 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5669 | "$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] | 5670 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5671 | 1 \ |
| 5672 | -c "client hello, adding renegotiation extension" \ |
| 5673 | -C "found renegotiation extension" \ |
| 5674 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5675 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5676 | -c "error" \ |
| 5677 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5678 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5679 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5680 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5682 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5683 | "$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] | 5684 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5685 | allow_legacy=0" \ |
| 5686 | 1 \ |
| 5687 | -c "client hello, adding renegotiation extension" \ |
| 5688 | -C "found renegotiation extension" \ |
| 5689 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5690 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5691 | -c "error" \ |
| 5692 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5693 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5694 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5695 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5697 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5698 | "$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] | 5699 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5700 | allow_legacy=1" \ |
| 5701 | 0 \ |
| 5702 | -c "client hello, adding renegotiation extension" \ |
| 5703 | -C "found renegotiation extension" \ |
| 5704 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5705 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5706 | -C "error" \ |
| 5707 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5708 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5709 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5711 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5712 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5713 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5714 | 0 \ |
| 5715 | -c "client hello, adding renegotiation extension" \ |
| 5716 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5717 | -s "found renegotiation extension" \ |
| 5718 | -s "server hello, secure renegotiation extension" \ |
| 5719 | -c "found renegotiation extension" \ |
| 5720 | -c "=> renegotiate" \ |
| 5721 | -s "=> renegotiate" \ |
| 5722 | -S "write hello request" |
| 5723 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5726 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5727 | "$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] | 5728 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5729 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5730 | 0 \ |
| 5731 | -c "client hello, adding renegotiation extension" \ |
| 5732 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5733 | -s "found renegotiation extension" \ |
| 5734 | -s "server hello, secure renegotiation extension" \ |
| 5735 | -c "found renegotiation extension" \ |
| 5736 | -c "=> renegotiate" \ |
| 5737 | -s "=> renegotiate" \ |
| 5738 | -s "write hello request" |
| 5739 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5742 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5743 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5744 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5745 | 0 \ |
| 5746 | -c "client hello, adding renegotiation extension" \ |
| 5747 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5748 | -s "found renegotiation extension" \ |
| 5749 | -s "server hello, secure renegotiation extension" \ |
| 5750 | -s "record counter limit reached: renegotiate" \ |
| 5751 | -c "=> renegotiate" \ |
| 5752 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5753 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5754 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5755 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5758 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5759 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5760 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5761 | 0 \ |
| 5762 | -c "client hello, adding renegotiation extension" \ |
| 5763 | -c "found renegotiation extension" \ |
| 5764 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5765 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5766 | -C "error" \ |
| 5767 | -s "Extra-header:" |
| 5768 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5769 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5770 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5771 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5772 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5774 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5775 | "$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] | 5776 | "$P_CLI debug_level=3" \ |
| 5777 | 0 \ |
| 5778 | -c "found renegotiation extension" \ |
| 5779 | -C "error" \ |
| 5780 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5781 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5782 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5783 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5785 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5786 | "$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] | 5787 | "$P_CLI debug_level=3" \ |
| 5788 | 0 \ |
| 5789 | -C "found renegotiation extension" \ |
| 5790 | -C "error" \ |
| 5791 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5792 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5793 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5794 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5796 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5797 | "$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] | 5798 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5799 | 1 \ |
| 5800 | -C "found renegotiation extension" \ |
| 5801 | -c "error" \ |
| 5802 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5803 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5804 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5807 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5808 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5809 | "$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] | 5810 | 0 \ |
| 5811 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5812 | -s "server hello, secure renegotiation extension" |
| 5813 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5814 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5815 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5817 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5818 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5819 | "$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] | 5820 | 0 \ |
| 5821 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5822 | -S "server hello, secure renegotiation extension" |
| 5823 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5824 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5825 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5827 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5828 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5829 | "$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] | 5830 | 1 \ |
| 5831 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5832 | -S "server hello, secure renegotiation extension" |
| 5833 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5834 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5835 | |
| 5836 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5838 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5839 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5840 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5841 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5842 | 0 \ |
| 5843 | -c "Handshake was completed" \ |
| 5844 | |
| 5845 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5847 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5848 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5849 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5850 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5851 | 0 \ |
| 5852 | -c "Handshake was completed" \ |
| 5853 | |
| 5854 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5856 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5857 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5858 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5859 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5860 | 0 \ |
| 5861 | -c "Handshake was completed" \ |
| 5862 | |
| 5863 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5865 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5866 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5867 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5868 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5869 | 0 \ |
| 5870 | -c "Handshake was completed" \ |
| 5871 | |
| 5872 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5874 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5875 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5876 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5877 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -c "Handshake was completed" \ |
| 5880 | |
| 5881 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5883 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5884 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5885 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5886 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5887 | 0 \ |
| 5888 | -c "Handshake was completed" \ |
| 5889 | |
| 5890 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5892 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5893 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5894 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5895 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5896 | 0 \ |
| 5897 | -c "Handshake was completed" \ |
| 5898 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5899 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5900 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5901 | |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5902 | # 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] | 5903 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5904 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5905 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5906 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5907 | 1 \ |
| 5908 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5909 | -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] | 5910 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5911 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5912 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5913 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5914 | # We don't check that the server receives the alert because it might |
| 5915 | # detect that its write end of the connection is closed and abort |
| 5916 | # before reading the alert message. |
| 5917 | |
| 5918 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5919 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5920 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5921 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5922 | 1 \ |
| 5923 | -c "x509_verify_cert() returned" \ |
| 5924 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5925 | -c "! mbedtls_ssl_handshake returned" \ |
| 5926 | -c "send alert level=2 message=48" \ |
| 5927 | -c "X509 - Certificate verification failed" |
| 5928 | # 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] | 5929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5930 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5931 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5932 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5933 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5934 | 0 \ |
| 5935 | -c "x509_verify_cert() returned" \ |
| 5936 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5937 | -C "! mbedtls_ssl_handshake returned" \ |
| 5938 | -C "send alert level=2 message=48" \ |
| 5939 | -C "X509 - Certificate verification failed" |
| 5940 | |
| 5941 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5942 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5943 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5944 | "$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] | 5945 | 0 \ |
| 5946 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5947 | -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] | 5948 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5949 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5950 | -C "X509 - Certificate verification failed" |
| 5951 | |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5952 | run_test "Authentication: server badcert, client none" \ |
| 5953 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5954 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5955 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5956 | 0 \ |
| 5957 | -C "x509_verify_cert() returned" \ |
| 5958 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5959 | -C "! mbedtls_ssl_handshake returned" \ |
| 5960 | -C "send alert level=2 message=48" \ |
| 5961 | -C "X509 - Certificate verification failed" |
| 5962 | |
| 5963 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5964 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5965 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5966 | "$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] | 5967 | 0 \ |
| 5968 | -C "x509_verify_cert() returned" \ |
| 5969 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5970 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5971 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5972 | -C "X509 - Certificate verification failed" |
| 5973 | |
Manuel Pégourié-Gonnard | 18dd213 | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5974 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5975 | "$P_SRV" \ |
| 5976 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5977 | 1 \ |
| 5978 | -c "x509_verify_cert() returned" \ |
| 5979 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5980 | -c "! Certificate verification flags"\ |
| 5981 | -c "! mbedtls_ssl_handshake returned" \ |
| 5982 | -c "SSL - No CA Chain is set, but required to operate" |
| 5983 | |
| 5984 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5985 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5986 | "$P_SRV force_version=tls12" \ |
| 5987 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5988 | 1 \ |
| 5989 | -c "x509_verify_cert() returned" \ |
| 5990 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5991 | -c "! Certificate verification flags"\ |
| 5992 | -c "! mbedtls_ssl_handshake returned" \ |
| 5993 | -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] | 5994 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5995 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5996 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5997 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5998 | 0 \ |
| 5999 | -c "x509_verify_cert() returned" \ |
| 6000 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6001 | -c "! Certificate verification flags"\ |
| 6002 | -C "! mbedtls_ssl_handshake returned" \ |
| 6003 | -C "X509 - Certificate verification failed" \ |
| 6004 | -C "SSL - No CA Chain is set, but required to operate" |
| 6005 | |
| 6006 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6007 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 6008 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6009 | "$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] | 6010 | 0 \ |
| 6011 | -c "x509_verify_cert() returned" \ |
| 6012 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6013 | -c "! Certificate verification flags"\ |
| 6014 | -C "! mbedtls_ssl_handshake returned" \ |
| 6015 | -C "X509 - Certificate verification failed" \ |
| 6016 | -C "SSL - No CA Chain is set, but required to operate" |
| 6017 | |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 6018 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 6019 | "$P_SRV" \ |
| 6020 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6021 | 0 \ |
| 6022 | -C "x509_verify_cert() returned" \ |
| 6023 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6024 | -C "! Certificate verification flags"\ |
| 6025 | -C "! mbedtls_ssl_handshake returned" \ |
| 6026 | -C "X509 - Certificate verification failed" \ |
| 6027 | -C "SSL - No CA Chain is set, but required to operate" |
| 6028 | |
| 6029 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6030 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 6031 | "$P_SRV" \ |
| 6032 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6033 | 0 \ |
| 6034 | -C "x509_verify_cert() returned" \ |
| 6035 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6036 | -C "! Certificate verification flags"\ |
| 6037 | -C "! mbedtls_ssl_handshake returned" \ |
| 6038 | -C "X509 - Certificate verification failed" \ |
| 6039 | -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] | 6040 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6041 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6042 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6043 | # the client informs the server about the supported curves - it does, though, in the |
| 6044 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6045 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6046 | # different means to have the server ignoring the client's supported curve list. |
| 6047 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6048 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6049 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6050 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6051 | "$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] | 6052 | 1 \ |
| 6053 | -c "bad certificate (EC key curve)"\ |
| 6054 | -c "! Certificate verification flags"\ |
| 6055 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6056 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6057 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6058 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6059 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6060 | "$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] | 6061 | 1 \ |
| 6062 | -c "bad certificate (EC key curve)"\ |
| 6063 | -c "! Certificate verification flags"\ |
| 6064 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6065 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6066 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6067 | run_test "Authentication: client SHA256, server required" \ |
| 6068 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6069 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6070 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6071 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6072 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6073 | -c "Supported Signature Algorithm found: 04 " \ |
| 6074 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6075 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6076 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6077 | run_test "Authentication: client SHA384, server required" \ |
| 6078 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6079 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6080 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6081 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6082 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6083 | -c "Supported Signature Algorithm found: 04 " \ |
| 6084 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6085 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6086 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6087 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6088 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6089 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6090 | 1 \ |
| 6091 | -S "skip write certificate request" \ |
| 6092 | -C "skip parse certificate request" \ |
| 6093 | -c "got a certificate request" \ |
| 6094 | -c "= write certificate$" \ |
| 6095 | -C "skip write certificate$" \ |
| 6096 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6097 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6098 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6099 | -s "No client certification received from the client, but required by the authentication mode" |
| 6100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6101 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6102 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6103 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6104 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6105 | 1 \ |
| 6106 | -S "skip write certificate request" \ |
| 6107 | -C "skip parse certificate request" \ |
| 6108 | -c "got a certificate request" \ |
| 6109 | -C "skip write certificate" \ |
| 6110 | -C "skip write certificate verify" \ |
| 6111 | -S "skip parse certificate verify" \ |
| 6112 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6113 | -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] | 6114 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6115 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6116 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6117 | # We don't check that the client receives the alert because it might |
| 6118 | # detect that its write end of the connection is closed and abort |
| 6119 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6120 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6121 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6122 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6123 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6124 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6125 | 0 \ |
| 6126 | -S "skip write certificate request" \ |
| 6127 | -C "skip parse certificate request" \ |
| 6128 | -c "got a certificate request" \ |
| 6129 | -C "skip write certificate" \ |
| 6130 | -C "skip write certificate verify" \ |
| 6131 | -S "skip parse certificate verify" \ |
| 6132 | -S "x509_verify_cert() returned" \ |
| 6133 | -S "! The certificate is not correctly signed" \ |
| 6134 | -S "X509 - Certificate verification failed" |
| 6135 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6136 | run_test "Authentication: client cert not trusted, server required" \ |
| 6137 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6138 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6139 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6140 | 1 \ |
| 6141 | -S "skip write certificate request" \ |
| 6142 | -C "skip parse certificate request" \ |
| 6143 | -c "got a certificate request" \ |
| 6144 | -C "skip write certificate" \ |
| 6145 | -C "skip write certificate verify" \ |
| 6146 | -S "skip parse certificate verify" \ |
| 6147 | -s "x509_verify_cert() returned" \ |
| 6148 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6149 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6150 | -s "X509 - Certificate verification failed" |
| 6151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6152 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6153 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6154 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6155 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6156 | 0 \ |
| 6157 | -S "skip write certificate request" \ |
| 6158 | -C "skip parse certificate request" \ |
| 6159 | -c "got a certificate request" \ |
| 6160 | -C "skip write certificate" \ |
| 6161 | -C "skip write certificate verify" \ |
| 6162 | -S "skip parse certificate verify" \ |
| 6163 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6164 | -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] | 6165 | -S "! mbedtls_ssl_handshake returned" \ |
| 6166 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6167 | -S "X509 - Certificate verification failed" |
| 6168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6169 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6170 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6171 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6172 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6173 | 0 \ |
| 6174 | -s "skip write certificate request" \ |
| 6175 | -C "skip parse certificate request" \ |
| 6176 | -c "got no certificate request" \ |
| 6177 | -c "skip write certificate" \ |
| 6178 | -c "skip write certificate verify" \ |
| 6179 | -s "skip parse certificate verify" \ |
| 6180 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6181 | -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] | 6182 | -S "! mbedtls_ssl_handshake returned" \ |
| 6183 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6184 | -S "X509 - Certificate verification failed" |
| 6185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6186 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6187 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6188 | "$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] | 6189 | 0 \ |
| 6190 | -S "skip write certificate request" \ |
| 6191 | -C "skip parse certificate request" \ |
| 6192 | -c "got a certificate request" \ |
| 6193 | -C "skip write certificate$" \ |
| 6194 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6195 | -c "skip write certificate verify" \ |
| 6196 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6197 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6198 | -S "! mbedtls_ssl_handshake returned" \ |
| 6199 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6200 | -S "X509 - Certificate verification failed" |
| 6201 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6202 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6203 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6204 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6205 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6206 | 0 \ |
| 6207 | -S "skip write certificate request" \ |
| 6208 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6209 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6210 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6211 | -S "X509 - Certificate verification failed" |
| 6212 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6214 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6215 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6216 | "$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] | 6217 | 0 \ |
| 6218 | -C "skip parse certificate request" \ |
| 6219 | -c "got a certificate request" \ |
| 6220 | -C "skip write certificate$" \ |
| 6221 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6222 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6225 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6226 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6227 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6228 | 1 \ |
| 6229 | -C "skip parse certificate request" \ |
| 6230 | -c "got a certificate request" \ |
| 6231 | -C "skip write certificate$" \ |
| 6232 | -c "skip write certificate verify" \ |
| 6233 | -c "! mbedtls_ssl_handshake returned" |
| 6234 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6235 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6236 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6237 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6238 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6239 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6240 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6241 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6242 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6243 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6244 | # 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] | 6245 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6246 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6247 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6248 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6249 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6250 | "$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] | 6251 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6252 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6253 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6254 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6255 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6256 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6257 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6258 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6259 | "$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] | 6260 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6261 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6262 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6263 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6264 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6265 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6266 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6267 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6268 | "$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] | 6269 | auth_mode=optional" \ |
| 6270 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6271 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6272 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6273 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6274 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6275 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6276 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6277 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6278 | "$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] | 6279 | auth_mode=none" \ |
| 6280 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6281 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6282 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6283 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6284 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6285 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6286 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6287 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6288 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6289 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6290 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6291 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6292 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6293 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6294 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6295 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6296 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6297 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6298 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6299 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6300 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6301 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6302 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6303 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6304 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6305 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6306 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6307 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6308 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6309 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6310 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6311 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6312 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6313 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6314 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6315 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6316 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6317 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6318 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6319 | # Tests for CA list in CertificateRequest messages |
| 6320 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6321 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6322 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6323 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6324 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6325 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6326 | 0 \ |
| 6327 | -s "requested DN" |
| 6328 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6329 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6330 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6331 | "$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] | 6332 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6333 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6334 | 0 \ |
| 6335 | -S "requested DN" |
| 6336 | |
| 6337 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6338 | "$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] | 6339 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6340 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6341 | 1 \ |
| 6342 | -S "requested DN" \ |
| 6343 | -s "x509_verify_cert() returned" \ |
| 6344 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6345 | -s "! mbedtls_ssl_handshake returned" \ |
| 6346 | -c "! mbedtls_ssl_handshake returned" \ |
| 6347 | -s "X509 - Certificate verification failed" |
| 6348 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6349 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6350 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6351 | "$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] | 6352 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6353 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6354 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6355 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6356 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6357 | 0 \ |
| 6358 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6359 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6360 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6361 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6362 | "$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] | 6363 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6364 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6365 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6366 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6367 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6368 | 0 \ |
| 6369 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6370 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6371 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6372 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6373 | "$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] | 6374 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6375 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6376 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6377 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6378 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6379 | 0 \ |
| 6380 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6381 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6382 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6383 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6384 | |
| 6385 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6386 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6387 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6388 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6389 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6390 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6391 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6392 | -c "x509_verify_cert() returned" \ |
| 6393 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6394 | -c "! mbedtls_ssl_handshake returned" \ |
| 6395 | -c "X509 - Certificate verification failed" |
| 6396 | |
| 6397 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6398 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6399 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6400 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6401 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6402 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6403 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6404 | -c "x509_verify_cert() returned" \ |
| 6405 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6406 | -C "! mbedtls_ssl_handshake returned" \ |
| 6407 | -C "X509 - Certificate verification failed" |
| 6408 | |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6410 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6411 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6412 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6413 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6414 | 0 \ |
| 6415 | -C "use CA callback for X.509 CRT verification" \ |
| 6416 | -C "x509_verify_cert() returned" \ |
| 6417 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6418 | -C "! mbedtls_ssl_handshake returned" \ |
| 6419 | -C "X509 - Certificate verification failed" |
| 6420 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6421 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6422 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6423 | # the client informs the server about the supported curves - it does, though, in the |
| 6424 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6425 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6426 | # different means to have the server ignoring the client's supported curve list. |
| 6427 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6428 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6429 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6430 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6431 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6432 | "$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] | 6433 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6434 | -c "use CA callback for X.509 CRT verification" \ |
| 6435 | -c "bad certificate (EC key curve)" \ |
| 6436 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6437 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6438 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6440 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6441 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6442 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6443 | "$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] | 6444 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6445 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6446 | -c "bad certificate (EC key curve)"\ |
| 6447 | -c "! Certificate verification flags"\ |
| 6448 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6449 | |
| 6450 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6451 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6452 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6453 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6454 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6455 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6456 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6457 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6458 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6459 | -c "Supported Signature Algorithm found: 04 " \ |
| 6460 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6461 | |
| 6462 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6463 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6464 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6465 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6466 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6467 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6468 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6469 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6470 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6471 | -c "Supported Signature Algorithm found: 04 " \ |
| 6472 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6473 | |
| 6474 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6475 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6476 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6477 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6478 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6479 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6480 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6481 | -S "skip write certificate request" \ |
| 6482 | -C "skip parse certificate request" \ |
| 6483 | -c "got a certificate request" \ |
| 6484 | -C "skip write certificate" \ |
| 6485 | -C "skip write certificate verify" \ |
| 6486 | -S "skip parse certificate verify" \ |
| 6487 | -s "x509_verify_cert() returned" \ |
| 6488 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6489 | -s "! mbedtls_ssl_handshake returned" \ |
| 6490 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6491 | -s "X509 - Certificate verification failed" |
| 6492 | # We don't check that the client receives the alert because it might |
| 6493 | # detect that its write end of the connection is closed and abort |
| 6494 | # before reading the alert message. |
| 6495 | |
| 6496 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6497 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6498 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6499 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6500 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6501 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6502 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6503 | -S "skip write certificate request" \ |
| 6504 | -C "skip parse certificate request" \ |
| 6505 | -c "got a certificate request" \ |
| 6506 | -C "skip write certificate" \ |
| 6507 | -C "skip write certificate verify" \ |
| 6508 | -S "skip parse certificate verify" \ |
| 6509 | -s "x509_verify_cert() returned" \ |
| 6510 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6511 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6512 | -s "X509 - Certificate verification failed" |
| 6513 | |
| 6514 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6515 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6516 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6517 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6518 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6519 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6520 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6521 | -S "skip write certificate request" \ |
| 6522 | -C "skip parse certificate request" \ |
| 6523 | -c "got a certificate request" \ |
| 6524 | -C "skip write certificate" \ |
| 6525 | -C "skip write certificate verify" \ |
| 6526 | -S "skip parse certificate verify" \ |
| 6527 | -s "x509_verify_cert() returned" \ |
| 6528 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6529 | -S "! mbedtls_ssl_handshake returned" \ |
| 6530 | -C "! mbedtls_ssl_handshake returned" \ |
| 6531 | -S "X509 - Certificate verification failed" |
| 6532 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6533 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6534 | requires_full_size_output_buffer |
| 6535 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6536 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6537 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6538 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6539 | "$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] | 6540 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6541 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6542 | -C "X509 - A fatal error occurred" |
| 6543 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6544 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6545 | requires_full_size_output_buffer |
| 6546 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6547 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6548 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6549 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6550 | "$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] | 6551 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6552 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6553 | -c "X509 - A fatal error occurred" |
| 6554 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6555 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6556 | requires_full_size_output_buffer |
| 6557 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6558 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6559 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6560 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6561 | "$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] | 6562 | debug_level=3 auth_mode=optional" \ |
| 6563 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6564 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6565 | -c "X509 - A fatal error occurred" |
| 6566 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6567 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6568 | requires_full_size_output_buffer |
| 6569 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6570 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6571 | "$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] | 6572 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6573 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6574 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6575 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6576 | -s "X509 - A fatal error occurred" |
| 6577 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6578 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6579 | requires_full_size_output_buffer |
| 6580 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6581 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6582 | "$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] | 6583 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6584 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6585 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6586 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6587 | -s "X509 - A fatal error occurred" |
| 6588 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6589 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6590 | requires_full_size_output_buffer |
| 6591 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6592 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6593 | "$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] | 6594 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6595 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6596 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6597 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6598 | -S "X509 - A fatal error occurred" |
| 6599 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6600 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6601 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6602 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6603 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6604 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6605 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6606 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6607 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6608 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6609 | 0 \ |
| 6610 | -c "signed using.*ECDSA with SHA256" \ |
| 6611 | -C "signed using.*ECDSA with SHA1" |
| 6612 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6613 | # tests for SNI |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6616 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6617 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6618 | 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] | 6619 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6620 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6621 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6622 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6623 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6624 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6625 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6626 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6627 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6628 | 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] | 6629 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6630 | 0 \ |
| 6631 | -s "parse ServerName extension" \ |
| 6632 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6633 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6634 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6635 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6636 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6637 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6638 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6639 | 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] | 6640 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6641 | 0 \ |
| 6642 | -s "parse ServerName extension" \ |
| 6643 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6644 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6645 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6646 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6647 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6648 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6649 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6650 | 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] | 6651 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6652 | 1 \ |
| 6653 | -s "parse ServerName extension" \ |
| 6654 | -s "ssl_sni_wrapper() returned" \ |
| 6655 | -s "mbedtls_ssl_handshake returned" \ |
| 6656 | -c "mbedtls_ssl_handshake returned" \ |
| 6657 | -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] | 6658 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6659 | run_test "SNI: client auth no override: optional" \ |
| 6660 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6661 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6662 | 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] | 6663 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6664 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6665 | -S "skip write certificate request" \ |
| 6666 | -C "skip parse certificate request" \ |
| 6667 | -c "got a certificate request" \ |
| 6668 | -C "skip write certificate" \ |
| 6669 | -C "skip write certificate verify" \ |
| 6670 | -S "skip parse certificate verify" |
| 6671 | |
| 6672 | run_test "SNI: client auth override: none -> optional" \ |
| 6673 | "$P_SRV debug_level=3 auth_mode=none \ |
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,-,-,optional" \ |
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: optional -> none" \ |
| 6686 | "$P_SRV debug_level=3 auth_mode=optional \ |
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,-,-,none" \ |
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 no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6694 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6695 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6696 | run_test "SNI: CA no override" \ |
| 6697 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6698 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6699 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6700 | 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] | 6701 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6702 | 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] | 6703 | 1 \ |
| 6704 | -S "skip write certificate request" \ |
| 6705 | -C "skip parse certificate request" \ |
| 6706 | -c "got a certificate request" \ |
| 6707 | -C "skip write certificate" \ |
| 6708 | -C "skip write certificate verify" \ |
| 6709 | -S "skip parse certificate verify" \ |
| 6710 | -s "x509_verify_cert() returned" \ |
| 6711 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6712 | -S "The certificate has been revoked (is on a CRL)" |
| 6713 | |
| 6714 | run_test "SNI: CA override" \ |
| 6715 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6716 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6717 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6718 | 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] | 6719 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6720 | 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] | 6721 | 0 \ |
| 6722 | -S "skip write certificate request" \ |
| 6723 | -C "skip parse certificate request" \ |
| 6724 | -c "got a certificate request" \ |
| 6725 | -C "skip write certificate" \ |
| 6726 | -C "skip write certificate verify" \ |
| 6727 | -S "skip parse certificate verify" \ |
| 6728 | -S "x509_verify_cert() returned" \ |
| 6729 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6730 | -S "The certificate has been revoked (is on a CRL)" |
| 6731 | |
| 6732 | run_test "SNI: CA override with CRL" \ |
| 6733 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6734 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6735 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6736 | 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] | 6737 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6738 | 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] | 6739 | 1 \ |
| 6740 | -S "skip write certificate request" \ |
| 6741 | -C "skip parse certificate request" \ |
| 6742 | -c "got a certificate request" \ |
| 6743 | -C "skip write certificate" \ |
| 6744 | -C "skip write certificate verify" \ |
| 6745 | -S "skip parse certificate verify" \ |
| 6746 | -s "x509_verify_cert() returned" \ |
| 6747 | -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] | 6748 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6749 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6750 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6751 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6752 | # Tests for SNI and DTLS |
| 6753 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6754 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6756 | run_test "SNI: DTLS, no SNI callback" \ |
| 6757 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6758 | 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] | 6759 | "$P_CLI server_name=localhost dtls=1" \ |
| 6760 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6761 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6762 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6763 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6764 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6766 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6767 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6768 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6769 | 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] | 6770 | "$P_CLI server_name=localhost dtls=1" \ |
| 6771 | 0 \ |
| 6772 | -s "parse ServerName extension" \ |
| 6773 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6774 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6775 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6776 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6778 | run_test "SNI: DTLS, matching cert 2" \ |
| 6779 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6780 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6781 | 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] | 6782 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6783 | 0 \ |
| 6784 | -s "parse ServerName extension" \ |
| 6785 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6786 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6789 | run_test "SNI: DTLS, no matching cert" \ |
| 6790 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6791 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6792 | 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] | 6793 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6794 | 1 \ |
| 6795 | -s "parse ServerName extension" \ |
| 6796 | -s "ssl_sni_wrapper() returned" \ |
| 6797 | -s "mbedtls_ssl_handshake returned" \ |
| 6798 | -c "mbedtls_ssl_handshake returned" \ |
| 6799 | -c "SSL - A fatal alert message was received from our peer" |
| 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, client auth no override: optional" \ |
| 6803 | "$P_SRV debug_level=3 auth_mode=optional 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,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6806 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6807 | 0 \ |
| 6808 | -S "skip write certificate request" \ |
| 6809 | -C "skip parse certificate request" \ |
| 6810 | -c "got a certificate request" \ |
| 6811 | -C "skip write certificate" \ |
| 6812 | -C "skip write certificate verify" \ |
| 6813 | -S "skip parse certificate verify" |
| 6814 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6816 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6817 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6818 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6819 | 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] | 6820 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6821 | 0 \ |
| 6822 | -S "skip write certificate request" \ |
| 6823 | -C "skip parse certificate request" \ |
| 6824 | -c "got a certificate request" \ |
| 6825 | -C "skip write certificate" \ |
| 6826 | -C "skip write certificate verify" \ |
| 6827 | -S "skip parse certificate verify" |
| 6828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6830 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6831 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6832 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6833 | 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] | 6834 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6835 | 0 \ |
| 6836 | -s "skip write certificate request" \ |
| 6837 | -C "skip parse certificate request" \ |
| 6838 | -c "got no certificate request" \ |
| 6839 | -c "skip write certificate" \ |
| 6840 | -c "skip write certificate verify" \ |
| 6841 | -s "skip parse certificate verify" |
| 6842 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6844 | run_test "SNI: DTLS, CA no override" \ |
| 6845 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6846 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6847 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6848 | 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] | 6849 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6850 | 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] | 6851 | 1 \ |
| 6852 | -S "skip write certificate request" \ |
| 6853 | -C "skip parse certificate request" \ |
| 6854 | -c "got a certificate request" \ |
| 6855 | -C "skip write certificate" \ |
| 6856 | -C "skip write certificate verify" \ |
| 6857 | -S "skip parse certificate verify" \ |
| 6858 | -s "x509_verify_cert() returned" \ |
| 6859 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6860 | -S "The certificate has been revoked (is on a CRL)" |
| 6861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6863 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6864 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6865 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6866 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6867 | 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] | 6868 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6869 | 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] | 6870 | 0 \ |
| 6871 | -S "skip write certificate request" \ |
| 6872 | -C "skip parse certificate request" \ |
| 6873 | -c "got a certificate request" \ |
| 6874 | -C "skip write certificate" \ |
| 6875 | -C "skip write certificate verify" \ |
| 6876 | -S "skip parse certificate verify" \ |
| 6877 | -S "x509_verify_cert() returned" \ |
| 6878 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6879 | -S "The certificate has been revoked (is on a CRL)" |
| 6880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6882 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6883 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6884 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6885 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6886 | 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] | 6887 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6888 | 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] | 6889 | 1 \ |
| 6890 | -S "skip write certificate request" \ |
| 6891 | -C "skip parse certificate request" \ |
| 6892 | -c "got a certificate request" \ |
| 6893 | -C "skip write certificate" \ |
| 6894 | -C "skip write certificate verify" \ |
| 6895 | -S "skip parse certificate verify" \ |
| 6896 | -s "x509_verify_cert() returned" \ |
| 6897 | -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] | 6898 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6899 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6900 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6901 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6902 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6904 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6905 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6906 | "$P_CLI nbio=2 tickets=0" \ |
| 6907 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6908 | -S "mbedtls_ssl_handshake returned" \ |
| 6909 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6910 | -c "Read from server: .* bytes read" |
| 6911 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6912 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6913 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6914 | "$P_CLI nbio=2 tickets=0" \ |
| 6915 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6916 | -S "mbedtls_ssl_handshake returned" \ |
| 6917 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6918 | -c "Read from server: .* bytes read" |
| 6919 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6920 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6921 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6922 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6923 | "$P_CLI nbio=2 tickets=1" \ |
| 6924 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6925 | -S "mbedtls_ssl_handshake returned" \ |
| 6926 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6927 | -c "Read from server: .* bytes read" |
| 6928 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6929 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6930 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6931 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6932 | "$P_CLI nbio=2 tickets=1" \ |
| 6933 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6934 | -S "mbedtls_ssl_handshake returned" \ |
| 6935 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6936 | -c "Read from server: .* bytes read" |
| 6937 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6938 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6939 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6940 | 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] | 6941 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6942 | "$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] | 6943 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6944 | -S "mbedtls_ssl_handshake returned" \ |
| 6945 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6946 | -c "Read from server: .* bytes read" |
| 6947 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6949 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6950 | 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] | 6951 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6952 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6953 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6954 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6955 | 0 \ |
| 6956 | -S "mbedtls_ssl_handshake returned" \ |
| 6957 | -C "mbedtls_ssl_handshake returned" \ |
| 6958 | -c "Read from server: .* bytes read" |
| 6959 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6960 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6961 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6962 | 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] | 6963 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6964 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6965 | 0 \ |
| 6966 | -S "mbedtls_ssl_handshake returned" \ |
| 6967 | -C "mbedtls_ssl_handshake returned" \ |
| 6968 | -c "Read from server: .* bytes read" |
| 6969 | |
| 6970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6971 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6972 | 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] | 6973 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6974 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6975 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6976 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6977 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6978 | -S "mbedtls_ssl_handshake returned" \ |
| 6979 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6980 | -c "Read from server: .* bytes read" |
| 6981 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6982 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6983 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6984 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6985 | "$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] | 6986 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6987 | -S "mbedtls_ssl_handshake returned" \ |
| 6988 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6989 | -c "Read from server: .* bytes read" |
| 6990 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6991 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6992 | |
| 6993 | run_test "Event-driven I/O: basic handshake" \ |
| 6994 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6995 | "$P_CLI event=1 tickets=0" \ |
| 6996 | 0 \ |
| 6997 | -S "mbedtls_ssl_handshake returned" \ |
| 6998 | -C "mbedtls_ssl_handshake returned" \ |
| 6999 | -c "Read from server: .* bytes read" |
| 7000 | |
| 7001 | run_test "Event-driven I/O: client auth" \ |
| 7002 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 7003 | "$P_CLI event=1 tickets=0" \ |
| 7004 | 0 \ |
| 7005 | -S "mbedtls_ssl_handshake returned" \ |
| 7006 | -C "mbedtls_ssl_handshake returned" \ |
| 7007 | -c "Read from server: .* bytes read" |
| 7008 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7009 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7010 | run_test "Event-driven I/O: ticket" \ |
| 7011 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 7012 | "$P_CLI event=1 tickets=1" \ |
| 7013 | 0 \ |
| 7014 | -S "mbedtls_ssl_handshake returned" \ |
| 7015 | -C "mbedtls_ssl_handshake returned" \ |
| 7016 | -c "Read from server: .* bytes read" |
| 7017 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7019 | run_test "Event-driven I/O: ticket + client auth" \ |
| 7020 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 7021 | "$P_CLI event=1 tickets=1" \ |
| 7022 | 0 \ |
| 7023 | -S "mbedtls_ssl_handshake returned" \ |
| 7024 | -C "mbedtls_ssl_handshake returned" \ |
| 7025 | -c "Read from server: .* bytes read" |
| 7026 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7027 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7028 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7029 | 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] | 7030 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7031 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7032 | 0 \ |
| 7033 | -S "mbedtls_ssl_handshake returned" \ |
| 7034 | -C "mbedtls_ssl_handshake returned" \ |
| 7035 | -c "Read from server: .* bytes read" |
| 7036 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7038 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7039 | 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] | 7040 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7041 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7042 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7043 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7044 | 0 \ |
| 7045 | -S "mbedtls_ssl_handshake returned" \ |
| 7046 | -C "mbedtls_ssl_handshake returned" \ |
| 7047 | -c "Read from server: .* bytes read" |
| 7048 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7049 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7051 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7052 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7053 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7054 | 0 \ |
| 7055 | -S "mbedtls_ssl_handshake returned" \ |
| 7056 | -C "mbedtls_ssl_handshake returned" \ |
| 7057 | -c "Read from server: .* bytes read" |
| 7058 | |
| 7059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7060 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7061 | 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] | 7062 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7063 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7064 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 7065 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7066 | 0 \ |
| 7067 | -S "mbedtls_ssl_handshake returned" \ |
| 7068 | -C "mbedtls_ssl_handshake returned" \ |
| 7069 | -c "Read from server: .* bytes read" |
| 7070 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7071 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7072 | run_test "Event-driven I/O: session-id resume" \ |
| 7073 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7074 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7075 | 0 \ |
| 7076 | -S "mbedtls_ssl_handshake returned" \ |
| 7077 | -C "mbedtls_ssl_handshake returned" \ |
| 7078 | -c "Read from server: .* bytes read" |
| 7079 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7081 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7082 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7083 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7084 | 0 \ |
| 7085 | -c "Read from server: .* bytes read" |
| 7086 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7088 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7089 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7090 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7091 | 0 \ |
| 7092 | -c "Read from server: .* bytes read" |
| 7093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7095 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7096 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7097 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7098 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7099 | 0 \ |
| 7100 | -c "Read from server: .* bytes read" |
| 7101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7103 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7104 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7105 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7106 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7107 | 0 \ |
| 7108 | -c "Read from server: .* bytes read" |
| 7109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7111 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7112 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7113 | "$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] | 7114 | "$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] | 7115 | 0 \ |
| 7116 | -c "Read from server: .* bytes read" |
| 7117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7119 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7120 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7121 | "$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] | 7122 | "$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] | 7123 | 0 \ |
| 7124 | -c "Read from server: .* bytes read" |
| 7125 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7127 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7128 | "$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] | 7129 | "$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] | 7130 | 0 \ |
| 7131 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7132 | |
| 7133 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7134 | # During session resumption, the client will send its ApplicationData record |
| 7135 | # within the same datagram as the Finished messages. In this situation, the |
| 7136 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7137 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7139 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7140 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7141 | "$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] | 7142 | "$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] | 7143 | 0 \ |
| 7144 | -c "Read from server: .* bytes read" |
| 7145 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7146 | # Tests for version negotiation. Some information to ease the understanding |
| 7147 | # of the version negotiation test titles below: |
| 7148 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7149 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7150 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7151 | # TLS 1.3/1.2 may be enabled or not. |
| 7152 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7153 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7154 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7155 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7156 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7157 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7158 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7160 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7161 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7162 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7163 | 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] | 7164 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7165 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7166 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7167 | -S "mbedtls_ssl_handshake returned" \ |
| 7168 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7169 | -s "Protocol is TLSv1.2" \ |
| 7170 | -c "Protocol is TLSv1.2" |
| 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 |
| 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7176 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7177 | 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] | 7178 | "$P_SRV max_version=tls12" \ |
| 7179 | "$P_CLI max_version=tls12" \ |
| 7180 | 0 \ |
| 7181 | -S "mbedtls_ssl_handshake returned" \ |
| 7182 | -C "mbedtls_ssl_handshake returned" \ |
| 7183 | -s "Protocol is TLSv1.2" \ |
| 7184 | -c "Protocol is TLSv1.2" |
| 7185 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7187 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7188 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7189 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7190 | 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] | 7191 | "$P_SRV" \ |
| 7192 | "$P_CLI" \ |
| 7193 | 0 \ |
| 7194 | -S "mbedtls_ssl_handshake returned" \ |
| 7195 | -C "mbedtls_ssl_handshake returned" \ |
| 7196 | -s "Protocol is TLSv1.3" \ |
| 7197 | -c "Protocol is TLSv1.3" |
| 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_PROTO_TLS1_2 |
| 7202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7203 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7204 | run_test "Version nego m->m: cli min=1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7205 | "$P_SRV min_version=tls13" \ |
| 7206 | "$P_CLI min_version=tls13" \ |
| 7207 | 0 \ |
| 7208 | -S "mbedtls_ssl_handshake returned" \ |
| 7209 | -C "mbedtls_ssl_handshake returned" \ |
| 7210 | -s "Protocol is TLSv1.3" \ |
| 7211 | -c "Protocol is TLSv1.3" |
| 7212 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7213 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7214 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7217 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7218 | 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] | 7219 | "$P_SRV" \ |
| 7220 | "$P_CLI" \ |
| 7221 | 0 \ |
| 7222 | -S "mbedtls_ssl_handshake returned" \ |
| 7223 | -C "mbedtls_ssl_handshake returned" \ |
| 7224 | -s "Protocol is TLSv1.3" \ |
| 7225 | -c "Protocol is TLSv1.3" |
| 7226 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7227 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7228 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7231 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7232 | 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] | 7233 | "$P_SRV min_version=tls13" \ |
| 7234 | "$P_CLI" \ |
| 7235 | 0 \ |
| 7236 | -S "mbedtls_ssl_handshake returned" \ |
| 7237 | -C "mbedtls_ssl_handshake returned" \ |
| 7238 | -s "Protocol is TLSv1.3" \ |
| 7239 | -c "Protocol is TLSv1.3" |
| 7240 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7241 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7242 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7245 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7246 | 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] | 7247 | "$P_SRV max_version=tls12" \ |
| 7248 | "$P_CLI" \ |
| 7249 | 0 \ |
| 7250 | -S "mbedtls_ssl_handshake returned" \ |
| 7251 | -C "mbedtls_ssl_handshake returned" \ |
| 7252 | -s "Protocol is TLSv1.2" \ |
| 7253 | -c "Protocol is TLSv1.2" |
| 7254 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7255 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7256 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7259 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7260 | 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] | 7261 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7262 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7263 | 0 \ |
| 7264 | -S "mbedtls_ssl_handshake returned" \ |
| 7265 | -C "mbedtls_ssl_handshake returned" \ |
| 7266 | -s "Protocol is TLSv1.2" \ |
| 7267 | -c "Protocol is TLSv1.2" |
| 7268 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7269 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7270 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7273 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7274 | 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] | 7275 | "$P_SRV" \ |
| 7276 | "$P_CLI min_version=tls13" \ |
| 7277 | 0 \ |
| 7278 | -S "mbedtls_ssl_handshake returned" \ |
| 7279 | -C "mbedtls_ssl_handshake returned" \ |
| 7280 | -s "Protocol is TLSv1.3" \ |
| 7281 | -c "Protocol is TLSv1.3" |
| 7282 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7284 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7287 | 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] | 7288 | "$P_SRV min_version=tls13" \ |
| 7289 | "$P_CLI max_version=tls12" \ |
| 7290 | 1 \ |
| 7291 | -s "Handshake protocol not within min/max boundaries" \ |
| 7292 | -S "Protocol is TLSv1.2" \ |
| 7293 | -C "Protocol is TLSv1.2" \ |
| 7294 | -S "Protocol is TLSv1.3" \ |
| 7295 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7296 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7297 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7298 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7301 | 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] | 7302 | "$P_SRV max_version=tls12" \ |
| 7303 | "$P_CLI min_version=tls13" \ |
| 7304 | 1 \ |
| 7305 | -s "The handshake negotiation failed" \ |
| 7306 | -S "Protocol is TLSv1.2" \ |
| 7307 | -C "Protocol is TLSv1.2" \ |
| 7308 | -S "Protocol is TLSv1.3" \ |
| 7309 | -C "Protocol is TLSv1.3" |
| 7310 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7311 | # Tests of version negotiation on server side against GnuTLS client |
| 7312 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7315 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7316 | 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] | 7317 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7318 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7319 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7320 | -S "mbedtls_ssl_handshake returned" \ |
| 7321 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7322 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7326 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7327 | 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] | 7328 | "$P_SRV max_version=tls12" \ |
| 7329 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7330 | 0 \ |
| 7331 | -S "mbedtls_ssl_handshake returned" \ |
| 7332 | -s "Protocol is TLSv1.2" |
| 7333 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7334 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7336 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7337 | 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] | 7338 | "$P_SRV" \ |
| 7339 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7340 | 0 \ |
| 7341 | -S "mbedtls_ssl_handshake returned" \ |
| 7342 | -s "Protocol is TLSv1.3" |
| 7343 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7344 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7347 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7348 | 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] | 7349 | "$P_SRV min_version=tls13" \ |
| 7350 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7351 | 0 \ |
| 7352 | -S "mbedtls_ssl_handshake returned" \ |
| 7353 | -s "Protocol is TLSv1.3" |
| 7354 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7355 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7357 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7358 | 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] | 7359 | "$P_SRV" \ |
| 7360 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7361 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7362 | -S "mbedtls_ssl_handshake returned" \ |
| 7363 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7364 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7365 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7366 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7368 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7369 | 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] | 7370 | "$P_SRV" \ |
| 7371 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7372 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7373 | -S "mbedtls_ssl_handshake returned" \ |
| 7374 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7375 | |
| 7376 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7377 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7378 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7379 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7380 | # client then detects the downgrade indication and aborts the handshake even |
| 7381 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7382 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7383 | # implementation that are otherwise not exercised. |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7384 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7387 | 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] | 7388 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7389 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7390 | 1 \ |
| 7391 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7392 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7393 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7396 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7397 | 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] | 7398 | "$P_SRV min_version=tls13" \ |
| 7399 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7400 | 0 \ |
| 7401 | -S "mbedtls_ssl_handshake returned" \ |
| 7402 | -s "Protocol is TLSv1.3" |
| 7403 | |
| 7404 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7405 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7406 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7407 | 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] | 7408 | "$P_SRV" \ |
| 7409 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7410 | 0 \ |
| 7411 | -S "mbedtls_ssl_handshake returned" \ |
| 7412 | -s "Protocol is TLSv1.2" |
| 7413 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7414 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7417 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7418 | 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] | 7419 | "$P_SRV max_version=tls12" \ |
| 7420 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7421 | 0 \ |
| 7422 | -S "mbedtls_ssl_handshake returned" \ |
| 7423 | -s "Protocol is TLSv1.2" |
| 7424 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7425 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7426 | 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] | 7427 | "$P_SRV" \ |
| 7428 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7429 | 1 \ |
| 7430 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7431 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7432 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7433 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7434 | 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] | 7435 | "$P_SRV" \ |
| 7436 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7437 | 1 \ |
| 7438 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7439 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7440 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7441 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7442 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7443 | 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] | 7444 | "$P_SRV" \ |
| 7445 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7446 | 1 \ |
| 7447 | -s "Handshake protocol not within min/max boundaries" \ |
| 7448 | -S "Protocol is TLSv1.2" |
| 7449 | |
| 7450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7451 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7452 | 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] | 7453 | "$P_SRV" \ |
| 7454 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7455 | 1 \ |
| 7456 | -S "Handshake protocol not within min/max boundaries" \ |
| 7457 | -s "The handshake negotiation failed" \ |
| 7458 | -S "Protocol is TLSv1.3" |
| 7459 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7460 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7463 | 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] | 7464 | "$P_SRV min_version=tls13" \ |
| 7465 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7466 | 1 \ |
| 7467 | -s "Handshake protocol not within min/max boundaries" \ |
| 7468 | -S "Protocol is TLSv1.2" |
| 7469 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7470 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7473 | 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] | 7474 | "$P_SRV max_version=tls12" \ |
| 7475 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7476 | 1 \ |
| 7477 | -S "Handshake protocol not within min/max boundaries" \ |
| 7478 | -s "The handshake negotiation failed" \ |
| 7479 | -S "Protocol is TLSv1.3" |
| 7480 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7481 | # Tests of version negotiation on server side against OpenSSL client |
| 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 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7485 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7486 | 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] | 7487 | "$P_SRV" \ |
| 7488 | "$O_NEXT_CLI -tls1_2" \ |
| 7489 | 0 \ |
| 7490 | -S "mbedtls_ssl_handshake returned" \ |
| 7491 | -s "Protocol is TLSv1.2" |
| 7492 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7493 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7496 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7497 | 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] | 7498 | "$P_SRV max_version=tls12" \ |
| 7499 | "$O_NEXT_CLI -tls1_2" \ |
| 7500 | 0 \ |
| 7501 | -S "mbedtls_ssl_handshake returned" \ |
| 7502 | -s "Protocol is TLSv1.2" |
| 7503 | |
| 7504 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7505 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7507 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7508 | 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] | 7509 | "$P_SRV" \ |
| 7510 | "$O_NEXT_CLI -tls1_3" \ |
| 7511 | 0 \ |
| 7512 | -S "mbedtls_ssl_handshake returned" \ |
| 7513 | -s "Protocol is TLSv1.3" |
| 7514 | |
| 7515 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7516 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7519 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7520 | 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] | 7521 | "$P_SRV min_version=tls13" \ |
| 7522 | "$O_NEXT_CLI -tls1_3" \ |
| 7523 | 0 \ |
| 7524 | -S "mbedtls_ssl_handshake returned" \ |
| 7525 | -s "Protocol is TLSv1.3" |
| 7526 | |
| 7527 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7528 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7530 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7531 | 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] | 7532 | "$P_SRV" \ |
| 7533 | "$O_NEXT_CLI" \ |
| 7534 | 0 \ |
| 7535 | -S "mbedtls_ssl_handshake returned" \ |
| 7536 | -s "Protocol is TLSv1.3" |
| 7537 | |
| 7538 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7539 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7541 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7542 | 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] | 7543 | "$P_SRV" \ |
| 7544 | "$O_NEXT_CLI -no_middlebox" \ |
| 7545 | 0 \ |
| 7546 | -S "mbedtls_ssl_handshake returned" \ |
| 7547 | -s "Protocol is TLSv1.3" |
| 7548 | |
| 7549 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7550 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7553 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7554 | 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] | 7555 | "$P_SRV min_version=tls13" \ |
| 7556 | "$O_NEXT_CLI" \ |
| 7557 | 0 \ |
| 7558 | -S "mbedtls_ssl_handshake returned" \ |
| 7559 | -s "Protocol is TLSv1.3" |
| 7560 | |
| 7561 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7562 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7563 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7564 | 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] | 7565 | "$P_SRV" \ |
| 7566 | "$O_NEXT_CLI" \ |
| 7567 | 0 \ |
| 7568 | -S "mbedtls_ssl_handshake returned" \ |
| 7569 | -s "Protocol is TLSv1.2" |
| 7570 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7571 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7574 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7575 | 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] | 7576 | "$P_SRV max_version=tls12" \ |
| 7577 | "$O_NEXT_CLI" \ |
| 7578 | 0 \ |
| 7579 | -S "mbedtls_ssl_handshake returned" \ |
| 7580 | -s "Protocol is TLSv1.2" |
| 7581 | |
| 7582 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7583 | 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] | 7584 | "$P_SRV" \ |
| 7585 | "$O_CLI -tls1" \ |
| 7586 | 1 \ |
| 7587 | -s "Handshake protocol not within min/max boundaries" \ |
| 7588 | -S "Protocol is TLSv1.0" |
| 7589 | |
| 7590 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7591 | 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] | 7592 | "$P_SRV" \ |
| 7593 | "$O_CLI -tls1_1" \ |
| 7594 | 1 \ |
| 7595 | -s "Handshake protocol not within min/max boundaries" \ |
| 7596 | -S "Protocol is TLSv1.1" |
| 7597 | |
| 7598 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7599 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7600 | 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] | 7601 | "$P_SRV" \ |
| 7602 | "$O_NEXT_CLI -tls1_2" \ |
| 7603 | 1 \ |
| 7604 | -s "Handshake protocol not within min/max boundaries" \ |
| 7605 | -S "Protocol is TLSv1.2" |
| 7606 | |
| 7607 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7608 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7609 | 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] | 7610 | "$P_SRV" \ |
| 7611 | "$O_NEXT_CLI -tls1_3" \ |
| 7612 | 1 \ |
| 7613 | -S "Handshake protocol not within min/max boundaries" \ |
| 7614 | -s "The handshake negotiation failed" \ |
| 7615 | -S "Protocol is TLSv1.3" |
| 7616 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7617 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7620 | 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] | 7621 | "$P_SRV min_version=tls13" \ |
| 7622 | "$O_NEXT_CLI -tls1_2" \ |
| 7623 | 1 \ |
| 7624 | -s "Handshake protocol not within min/max boundaries" \ |
| 7625 | -S "Protocol is TLSv1.2" |
| 7626 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7627 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7630 | 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] | 7631 | "$P_SRV max_version=tls12" \ |
| 7632 | "$O_NEXT_CLI -tls1_3" \ |
| 7633 | 1 \ |
| 7634 | -S "Handshake protocol not within min/max boundaries" \ |
| 7635 | -s "The handshake negotiation failed" \ |
| 7636 | -S "Protocol is TLSv1.3" |
| 7637 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7638 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7639 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7641 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7642 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7643 | "$P_CLI" \ |
| 7644 | 1 \ |
| 7645 | -s "Error in protocol version" \ |
| 7646 | -c "Handshake protocol not within min/max boundaries" \ |
| 7647 | -S "Version: TLS1.0" \ |
| 7648 | -C "Protocol is TLSv1.0" |
| 7649 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7651 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7652 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7653 | "$P_CLI" \ |
| 7654 | 1 \ |
| 7655 | -s "Error in protocol version" \ |
| 7656 | -c "Handshake protocol not within min/max boundaries" \ |
| 7657 | -S "Version: TLS1.1" \ |
| 7658 | -C "Protocol is TLSv1.1" |
| 7659 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7661 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7662 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7663 | skip_handshake_stage_check |
| 7664 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7665 | 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] | 7666 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7667 | "$P_CLI debug_level=4" \ |
| 7668 | 1 \ |
| 7669 | -s "Client's version: 3.3" \ |
| 7670 | -S "Version: TLS1.0" \ |
| 7671 | -C "Protocol is TLSv1.0" |
| 7672 | |
| 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.1" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7679 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7680 | "$P_CLI debug_level=4" \ |
| 7681 | 1 \ |
| 7682 | -s "Client's version: 3.3" \ |
| 7683 | -S "Version: TLS1.1" \ |
| 7684 | -C "Protocol is TLSv1.1" |
| 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.2" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7692 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7693 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7694 | 1 \ |
| 7695 | -s "Client's version: 3.3" \ |
| 7696 | -c "is a fatal alert message (msg 40)" \ |
| 7697 | -S "Version: TLS1.2" \ |
| 7698 | -C "Protocol is TLSv1.2" |
| 7699 | |
| 7700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7701 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7702 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7703 | skip_handshake_stage_check |
| 7704 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7705 | 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] | 7706 | "$O_NEXT_SRV -msg -tls1" \ |
| 7707 | "$P_CLI debug_level=4" \ |
| 7708 | 1 \ |
| 7709 | -s "fatal protocol_version" \ |
| 7710 | -c "is a fatal alert message (msg 70)" \ |
| 7711 | -S "Version: TLS1.0" \ |
| 7712 | -C "Protocol : TLSv1.0" |
| 7713 | |
| 7714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7715 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7716 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7717 | skip_handshake_stage_check |
| 7718 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7719 | 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] | 7720 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7721 | "$P_CLI debug_level=4" \ |
| 7722 | 1 \ |
| 7723 | -s "fatal protocol_version" \ |
| 7724 | -c "is a fatal alert message (msg 70)" \ |
| 7725 | -S "Version: TLS1.1" \ |
| 7726 | -C "Protocol : TLSv1.1" |
| 7727 | |
| 7728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7729 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7730 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7731 | skip_handshake_stage_check |
| 7732 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7733 | 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] | 7734 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7735 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7736 | 1 \ |
| 7737 | -s "fatal protocol_version" \ |
| 7738 | -c "is a fatal alert message (msg 70)" \ |
| 7739 | -S "Version: TLS1.2" \ |
| 7740 | -C "Protocol : TLSv1.2" |
| 7741 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7742 | # Tests for ALPN extension |
| 7743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7744 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7745 | "$P_SRV debug_level=3" \ |
| 7746 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7747 | 0 \ |
| 7748 | -C "client hello, adding alpn extension" \ |
| 7749 | -S "found alpn extension" \ |
| 7750 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7751 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7752 | -C "found alpn extension " \ |
| 7753 | -C "Application Layer Protocol is" \ |
| 7754 | -S "Application Layer Protocol is" |
| 7755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7756 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7757 | "$P_SRV debug_level=3" \ |
| 7758 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7759 | 0 \ |
| 7760 | -c "client hello, adding alpn extension" \ |
| 7761 | -s "found alpn extension" \ |
| 7762 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7763 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7764 | -C "found alpn extension " \ |
| 7765 | -c "Application Layer Protocol is (none)" \ |
| 7766 | -S "Application Layer Protocol is" |
| 7767 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7768 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7769 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7770 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7771 | 0 \ |
| 7772 | -C "client hello, adding alpn extension" \ |
| 7773 | -S "found alpn extension" \ |
| 7774 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7775 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7776 | -C "found alpn extension " \ |
| 7777 | -C "Application Layer Protocol is" \ |
| 7778 | -s "Application Layer Protocol is (none)" |
| 7779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7780 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7781 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7782 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7783 | 0 \ |
| 7784 | -c "client hello, adding alpn extension" \ |
| 7785 | -s "found alpn extension" \ |
| 7786 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7787 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7788 | -c "found alpn extension" \ |
| 7789 | -c "Application Layer Protocol is abc" \ |
| 7790 | -s "Application Layer Protocol is abc" |
| 7791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7792 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7793 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7794 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7795 | 0 \ |
| 7796 | -c "client hello, adding alpn extension" \ |
| 7797 | -s "found alpn extension" \ |
| 7798 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7799 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7800 | -c "found alpn extension" \ |
| 7801 | -c "Application Layer Protocol is abc" \ |
| 7802 | -s "Application Layer Protocol is abc" |
| 7803 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7804 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7805 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7806 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7807 | 0 \ |
| 7808 | -c "client hello, adding alpn extension" \ |
| 7809 | -s "found alpn extension" \ |
| 7810 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7811 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7812 | -c "found alpn extension" \ |
| 7813 | -c "Application Layer Protocol is 1234" \ |
| 7814 | -s "Application Layer Protocol is 1234" |
| 7815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7816 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7817 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7818 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7819 | 1 \ |
| 7820 | -c "client hello, adding alpn extension" \ |
| 7821 | -s "found alpn extension" \ |
| 7822 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7823 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7824 | -C "found alpn extension" \ |
| 7825 | -C "Application Layer Protocol is 1234" \ |
| 7826 | -S "Application Layer Protocol is 1234" |
| 7827 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7828 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7829 | # Tests for keyUsage in leaf certificates, part 1: |
| 7830 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7831 | # |
| 7832 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7833 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7834 | # 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] | 7835 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7836 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7837 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7838 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7839 | "$P_CLI" \ |
| 7840 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7841 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7842 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7843 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7844 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7845 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7846 | "$P_CLI" \ |
| 7847 | 0 \ |
| 7848 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7849 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7850 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7851 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7852 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7853 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7854 | 1 \ |
| 7855 | -C "Ciphersuite is " |
| 7856 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7857 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7858 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7859 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7860 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7861 | "$P_CLI" \ |
| 7862 | 0 \ |
| 7863 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7864 | |
| 7865 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7866 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7867 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7868 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7869 | "$P_CLI" \ |
| 7870 | 0 \ |
| 7871 | -c "Ciphersuite is TLS-ECDH-" |
| 7872 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7873 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7874 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7875 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7876 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7877 | 1 \ |
| 7878 | -C "Ciphersuite is " |
| 7879 | |
| 7880 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7881 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7882 | # |
| 7883 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7884 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7885 | # 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] | 7886 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7887 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7888 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7889 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7890 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7891 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7892 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7893 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7894 | -C "Processing of the Certificate handshake message failed" \ |
| 7895 | -c "Ciphersuite is TLS-" |
| 7896 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7897 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7898 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7899 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7900 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7901 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7902 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7903 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7904 | -C "Processing of the Certificate handshake message failed" \ |
| 7905 | -c "Ciphersuite is TLS-" |
| 7906 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7907 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7908 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7909 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7910 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7911 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7912 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7913 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7914 | -C "Processing of the Certificate handshake message failed" \ |
| 7915 | -c "Ciphersuite is TLS-" |
| 7916 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7917 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7918 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7919 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7920 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7921 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7922 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7923 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7924 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7925 | -C "Ciphersuite is TLS-" \ |
| 7926 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7927 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7928 | # 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] | 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 (soft)" \ |
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 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7934 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7935 | 0 \ |
| 7936 | -c "bad certificate (usage extensions)" \ |
| 7937 | -C "Processing of the Certificate handshake message failed" \ |
| 7938 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7939 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7940 | -c "! Usage does not match the keyUsage extension" |
| 7941 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7942 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7943 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7944 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7945 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7946 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7947 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7948 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7949 | -C "Processing of the Certificate handshake message failed" \ |
| 7950 | -c "Ciphersuite is TLS-" |
| 7951 | |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7952 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7953 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7954 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7955 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7956 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7957 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7958 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7959 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7960 | -C "Ciphersuite is TLS-" \ |
| 7961 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7962 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7963 | # 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] | 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 (soft)" \ |
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 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7969 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7970 | 0 \ |
| 7971 | -c "bad certificate (usage extensions)" \ |
| 7972 | -C "Processing of the Certificate handshake message failed" \ |
| 7973 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7974 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7975 | -c "! Usage does not match the keyUsage extension" |
| 7976 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7977 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7978 | 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] | 7979 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7980 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7981 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7982 | "$P_CLI debug_level=3" \ |
| 7983 | 0 \ |
| 7984 | -C "bad certificate (usage extensions)" \ |
| 7985 | -C "Processing of the Certificate handshake message failed" \ |
| 7986 | -c "Ciphersuite is" |
| 7987 | |
| 7988 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7989 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7990 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7991 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7992 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7993 | "$P_CLI debug_level=3" \ |
| 7994 | 0 \ |
| 7995 | -C "bad certificate (usage extensions)" \ |
| 7996 | -C "Processing of the Certificate handshake message failed" \ |
| 7997 | -c "Ciphersuite is" |
| 7998 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7999 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8000 | 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] | 8001 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8002 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8003 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8004 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8005 | 1 \ |
| 8006 | -c "bad certificate (usage extensions)" \ |
| 8007 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8008 | -C "Ciphersuite is" \ |
| 8009 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8010 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8011 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8012 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8013 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8014 | 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] | 8015 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8016 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8017 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8018 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8019 | 1 \ |
| 8020 | -c "bad certificate (usage extensions)" \ |
| 8021 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8022 | -C "Ciphersuite is" \ |
| 8023 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8024 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8025 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8026 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8027 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8028 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8029 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8030 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8031 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8032 | "$P_CLI debug_level=3" \ |
| 8033 | 0 \ |
| 8034 | -C "bad certificate (usage extensions)" \ |
| 8035 | -C "Processing of the Certificate handshake message failed" \ |
| 8036 | -c "Ciphersuite is" |
| 8037 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8038 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8039 | 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] | 8040 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8041 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8042 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8043 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8044 | 1 \ |
| 8045 | -c "bad certificate (usage extensions)" \ |
| 8046 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8047 | -C "Ciphersuite is" \ |
| 8048 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8049 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8050 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8051 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8052 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8053 | 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] | 8054 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8055 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8056 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8057 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8058 | 1 \ |
| 8059 | -c "bad certificate (usage extensions)" \ |
| 8060 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8061 | -C "Ciphersuite is" \ |
| 8062 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8063 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8064 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8065 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8066 | # Tests for keyUsage in leaf certificates, part 3: |
| 8067 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8068 | # |
| 8069 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8070 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8072 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8073 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8074 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8075 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8076 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8077 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8078 | -S "bad certificate (usage extensions)" \ |
| 8079 | -S "Processing of the Certificate handshake message failed" |
| 8080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8082 | 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] | 8083 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8084 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8085 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8086 | 0 \ |
| 8087 | -s "Verifying peer X.509 certificate... ok" \ |
| 8088 | -S "bad certificate (usage extensions)" \ |
| 8089 | -S "Processing of the Certificate handshake message failed" |
| 8090 | |
| 8091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8092 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8093 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8094 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8095 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8096 | 0 \ |
| 8097 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8098 | -S "send alert level=2 message=43" \ |
| 8099 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8100 | -S "Processing of the Certificate handshake message failed" |
| 8101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8103 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8104 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8105 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8106 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8107 | 1 \ |
| 8108 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8109 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8110 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8111 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8112 | # 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] | 8113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8115 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8116 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8117 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8118 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8119 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8120 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8121 | -S "bad certificate (usage extensions)" \ |
| 8122 | -S "Processing of the Certificate handshake message failed" |
| 8123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8125 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8126 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8127 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8128 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8129 | 0 \ |
| 8130 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8131 | -S "send alert level=2 message=43" \ |
| 8132 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8133 | -S "Processing of the Certificate handshake message failed" |
| 8134 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8136 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8137 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8138 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8139 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8140 | 1 \ |
| 8141 | -s "bad certificate (usage extensions)" \ |
| 8142 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8143 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8144 | -s "Processing of the Certificate handshake message failed" |
| 8145 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8146 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8147 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8148 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8149 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8150 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8151 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8152 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8153 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8154 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8155 | -S "bad certificate (usage extensions)" \ |
| 8156 | -S "Processing of the Certificate handshake message failed" |
| 8157 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8158 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8159 | 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] | 8160 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8161 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8162 | "$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] | 8163 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8164 | 0 \ |
| 8165 | -s "Verifying peer X.509 certificate... ok" \ |
| 8166 | -S "bad certificate (usage extensions)" \ |
| 8167 | -S "Processing of the Certificate handshake message failed" |
| 8168 | |
| 8169 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8170 | 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] | 8171 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8172 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8173 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8174 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8175 | 0 \ |
| 8176 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8177 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8178 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8179 | -S "Processing of the Certificate handshake message failed" |
| 8180 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8181 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8182 | 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] | 8183 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8184 | "$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] | 8185 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8186 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8187 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8188 | -s "bad certificate (usage extensions)" \ |
| 8189 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8190 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8191 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8192 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8193 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8194 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8195 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8196 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8197 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8198 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8199 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8200 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8201 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8202 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8203 | -S "bad certificate (usage extensions)" \ |
| 8204 | -S "Processing of the Certificate handshake message failed" |
| 8205 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8206 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8207 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8208 | 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] | 8209 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8210 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8211 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8212 | 0 \ |
| 8213 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8214 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8215 | -S "Processing of the Certificate handshake message failed" |
| 8216 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8217 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8218 | 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] | 8219 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8220 | "$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] | 8221 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8222 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8223 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8224 | -s "bad certificate (usage extensions)" \ |
| 8225 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8226 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8227 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8228 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8229 | # 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] | 8230 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8231 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8232 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8233 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8234 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8235 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8236 | "$P_CLI" \ |
| 8237 | 0 |
| 8238 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8239 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8240 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8241 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8242 | "$P_CLI" \ |
| 8243 | 0 |
| 8244 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8245 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8246 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8247 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8248 | "$P_CLI" \ |
| 8249 | 0 |
| 8250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8251 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8252 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8253 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8254 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8255 | 1 |
| 8256 | |
| 8257 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8260 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8261 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8262 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8263 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8264 | 0 \ |
| 8265 | -C "bad certificate (usage extensions)" \ |
| 8266 | -C "Processing of the Certificate handshake message failed" \ |
| 8267 | -c "Ciphersuite is TLS-" |
| 8268 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8270 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8271 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8272 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8273 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8274 | 0 \ |
| 8275 | -C "bad certificate (usage extensions)" \ |
| 8276 | -C "Processing of the Certificate handshake message failed" \ |
| 8277 | -c "Ciphersuite is TLS-" |
| 8278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8280 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8281 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8282 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8283 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8284 | 0 \ |
| 8285 | -C "bad certificate (usage extensions)" \ |
| 8286 | -C "Processing of the Certificate handshake message failed" \ |
| 8287 | -c "Ciphersuite is TLS-" |
| 8288 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8290 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8291 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8292 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8293 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8294 | 0 \ |
| 8295 | -c "bad certificate (usage extensions)" \ |
| 8296 | -C "Processing of the Certificate handshake message failed" \ |
| 8297 | -c "Ciphersuite is TLS-" \ |
| 8298 | -C "send alert level=2 message=43" \ |
| 8299 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8300 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8301 | |
| 8302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8303 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +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 | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8306 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8307 | 1 \ |
| 8308 | -c "bad certificate (usage extensions)" \ |
| 8309 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 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 |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8314 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8315 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8316 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8317 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8318 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8319 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8320 | "$P_CLI debug_level=1" \ |
| 8321 | 0 \ |
| 8322 | -C "bad certificate (usage extensions)" \ |
| 8323 | -C "Processing of the Certificate handshake message failed" \ |
| 8324 | -c "Ciphersuite is" |
| 8325 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8326 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8327 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8328 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8329 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8330 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8331 | "$P_CLI debug_level=1" \ |
| 8332 | 0 \ |
| 8333 | -C "bad certificate (usage extensions)" \ |
| 8334 | -C "Processing of the Certificate handshake message failed" \ |
| 8335 | -c "Ciphersuite is" |
| 8336 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8337 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8338 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8339 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8340 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8341 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8342 | "$P_CLI debug_level=1" \ |
| 8343 | 0 \ |
| 8344 | -C "bad certificate (usage extensions)" \ |
| 8345 | -C "Processing of the Certificate handshake message failed" \ |
| 8346 | -c "Ciphersuite is" |
| 8347 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8348 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8349 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8350 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8351 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8352 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8353 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8354 | 1 \ |
| 8355 | -c "bad certificate (usage extensions)" \ |
| 8356 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8357 | -C "Ciphersuite is" \ |
| 8358 | -c "send alert level=2 message=43" \ |
| 8359 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8360 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8361 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8362 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8363 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8365 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8366 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8367 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8368 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8369 | 0 \ |
| 8370 | -S "bad certificate (usage extensions)" \ |
| 8371 | -S "Processing of the Certificate handshake message failed" |
| 8372 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8374 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8375 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8376 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8377 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8378 | 0 \ |
| 8379 | -S "bad certificate (usage extensions)" \ |
| 8380 | -S "Processing of the Certificate handshake message failed" |
| 8381 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8383 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8384 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8385 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8386 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8387 | 0 \ |
| 8388 | -S "bad certificate (usage extensions)" \ |
| 8389 | -S "Processing of the Certificate handshake message failed" |
| 8390 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8392 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8393 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8394 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8395 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8396 | 0 \ |
| 8397 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8398 | -S "send alert level=2 message=43" \ |
| 8399 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8400 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8401 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8403 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8404 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8405 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8406 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8407 | 1 \ |
| 8408 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8409 | -s "send alert level=2 message=43" \ |
| 8410 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8411 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8412 | # 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] | 8413 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8414 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8415 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8416 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8417 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8418 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8419 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8420 | 0 \ |
| 8421 | -S "bad certificate (usage extensions)" \ |
| 8422 | -S "Processing of the Certificate handshake message failed" |
| 8423 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8424 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8425 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8426 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8427 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8428 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8429 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8430 | 0 \ |
| 8431 | -S "bad certificate (usage extensions)" \ |
| 8432 | -S "Processing of the Certificate handshake message failed" |
| 8433 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8434 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8435 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8436 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8437 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8438 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8439 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8440 | 0 \ |
| 8441 | -S "bad certificate (usage extensions)" \ |
| 8442 | -S "Processing of the Certificate handshake message failed" |
| 8443 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8444 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8445 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8446 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8447 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8448 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8449 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8450 | 0 \ |
| 8451 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8452 | -S "send alert level=2 message=43" \ |
| 8453 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8454 | -S "Processing of the Certificate handshake message failed" |
| 8455 | |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8456 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8457 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8458 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8459 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8460 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8461 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8462 | 1 \ |
| 8463 | -s "bad certificate (usage extensions)" \ |
| 8464 | -s "send alert level=2 message=43" \ |
| 8465 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8466 | -s "Processing of the Certificate handshake message failed" |
| 8467 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8468 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8469 | # Tests for DHM parameters loading |
| 8470 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8471 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8472 | "$P_SRV" \ |
| 8473 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8474 | debug_level=3" \ |
| 8475 | 0 \ |
| 8476 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8477 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8479 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8480 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8481 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8482 | debug_level=3" \ |
| 8483 | 0 \ |
| 8484 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8485 | -c "value of 'DHM: G ' (2 bits)" |
| 8486 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8487 | # Tests for DHM client-side size checking |
| 8488 | |
| 8489 | run_test "DHM size: server default, client default, OK" \ |
| 8490 | "$P_SRV" \ |
| 8491 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8492 | debug_level=1" \ |
| 8493 | 0 \ |
| 8494 | -C "DHM prime too short:" |
| 8495 | |
| 8496 | run_test "DHM size: server default, client 2048, OK" \ |
| 8497 | "$P_SRV" \ |
| 8498 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8499 | debug_level=1 dhmlen=2048" \ |
| 8500 | 0 \ |
| 8501 | -C "DHM prime too short:" |
| 8502 | |
| 8503 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8504 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8505 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8506 | debug_level=1" \ |
| 8507 | 0 \ |
| 8508 | -C "DHM prime too short:" |
| 8509 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8510 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8511 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8512 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8513 | debug_level=1 dhmlen=999" \ |
| 8514 | 0 \ |
| 8515 | -C "DHM prime too short:" |
| 8516 | |
| 8517 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8518 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8519 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8520 | debug_level=1 dhmlen=1000" \ |
| 8521 | 0 \ |
| 8522 | -C "DHM prime too short:" |
| 8523 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8524 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8525 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8526 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8527 | debug_level=1" \ |
| 8528 | 1 \ |
| 8529 | -c "DHM prime too short:" |
| 8530 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8531 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8532 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8533 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8534 | debug_level=1 dhmlen=1001" \ |
| 8535 | 1 \ |
| 8536 | -c "DHM prime too short:" |
| 8537 | |
| 8538 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8539 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8540 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8541 | debug_level=1 dhmlen=1000" \ |
| 8542 | 1 \ |
| 8543 | -c "DHM prime too short:" |
| 8544 | |
| 8545 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8546 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8547 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8548 | debug_level=1 dhmlen=999" \ |
| 8549 | 1 \ |
| 8550 | -c "DHM prime too short:" |
| 8551 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8552 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8553 | "$P_SRV" \ |
| 8554 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8555 | debug_level=1 dhmlen=2049" \ |
| 8556 | 1 \ |
| 8557 | -c "DHM prime too short:" |
| 8558 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8559 | # Tests for PSK callback |
| 8560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8561 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8562 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8563 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8564 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8565 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8566 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8567 | -S "SSL - Unknown identity received" \ |
| 8568 | -S "SSL - Verification of the message MAC failed" |
| 8569 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8571 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8572 | "$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] | 8573 | "$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] | 8574 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8575 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8576 | -C "session hash for extended master secret"\ |
| 8577 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8578 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8579 | -S "SSL - Unknown identity received" \ |
| 8580 | -S "SSL - Verification of the message MAC failed" |
| 8581 | |
| 8582 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8583 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8584 | "$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] | 8585 | "$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] | 8586 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8587 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8588 | -C "session hash for extended master secret"\ |
| 8589 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8590 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8591 | -S "SSL - Unknown identity received" \ |
| 8592 | -S "SSL - Verification of the message MAC failed" |
| 8593 | |
| 8594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8595 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8596 | "$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] | 8597 | "$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] | 8598 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8599 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8600 | -c "session hash for extended master secret"\ |
| 8601 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8602 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8603 | -S "SSL - Unknown identity received" \ |
| 8604 | -S "SSL - Verification of the message MAC failed" |
| 8605 | |
| 8606 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8607 | 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] | 8608 | "$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] | 8609 | "$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] | 8610 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8611 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8612 | -c "session hash for extended master secret"\ |
| 8613 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8614 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8615 | -S "SSL - Unknown identity received" \ |
| 8616 | -S "SSL - Verification of the message MAC failed" |
| 8617 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8619 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8620 | "$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] | 8621 | "$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] | 8622 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8623 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8624 | -C "session hash for extended master secret"\ |
| 8625 | -S "session hash for extended master secret"\ |
| 8626 | -S "SSL - The handshake negotiation failed" \ |
| 8627 | -S "SSL - Unknown identity received" \ |
| 8628 | -S "SSL - Verification of the message MAC failed" |
| 8629 | |
| 8630 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8631 | 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] | 8632 | "$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] | 8633 | "$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] | 8634 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8635 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8636 | -C "session hash for extended master secret"\ |
| 8637 | -S "session hash for extended master secret"\ |
| 8638 | -S "SSL - The handshake negotiation failed" \ |
| 8639 | -S "SSL - Unknown identity received" \ |
| 8640 | -S "SSL - Verification of the message MAC failed" |
| 8641 | |
| 8642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8643 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8644 | "$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] | 8645 | "$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] | 8646 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8647 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8648 | -c "session hash for extended master secret"\ |
| 8649 | -s "session hash for extended master secret"\ |
| 8650 | -S "SSL - The handshake negotiation failed" \ |
| 8651 | -S "SSL - Unknown identity received" \ |
| 8652 | -S "SSL - Verification of the message MAC failed" |
| 8653 | |
| 8654 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8655 | 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] | 8656 | "$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] | 8657 | "$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] | 8658 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8659 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8660 | -c "session hash for extended master secret"\ |
| 8661 | -s "session hash for extended master secret"\ |
| 8662 | -S "SSL - The handshake negotiation failed" \ |
| 8663 | -S "SSL - Unknown identity received" \ |
| 8664 | -S "SSL - Verification of the message MAC failed" |
| 8665 | |
| 8666 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8667 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8668 | "$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] | 8669 | "$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] | 8670 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8671 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8672 | -C "session hash for extended master secret"\ |
| 8673 | -S "session hash for extended master secret"\ |
| 8674 | -S "SSL - The handshake negotiation failed" \ |
| 8675 | -S "SSL - Unknown identity received" \ |
| 8676 | -S "SSL - Verification of the message MAC failed" |
| 8677 | |
| 8678 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8679 | 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] | 8680 | "$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] | 8681 | "$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] | 8682 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8683 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8684 | -C "session hash for extended master secret"\ |
| 8685 | -S "session hash for extended master secret"\ |
| 8686 | -S "SSL - The handshake negotiation failed" \ |
| 8687 | -S "SSL - Unknown identity received" \ |
| 8688 | -S "SSL - Verification of the message MAC failed" |
| 8689 | |
| 8690 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8691 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8692 | "$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] | 8693 | "$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] | 8694 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8695 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8696 | -c "session hash for extended master secret"\ |
| 8697 | -s "session hash for extended master secret"\ |
| 8698 | -S "SSL - The handshake negotiation failed" \ |
| 8699 | -S "SSL - Unknown identity received" \ |
| 8700 | -S "SSL - Verification of the message MAC failed" |
| 8701 | |
| 8702 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8703 | 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] | 8704 | "$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] | 8705 | "$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] | 8706 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8707 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8708 | -c "session hash for extended master secret"\ |
| 8709 | -s "session hash for extended master secret"\ |
| 8710 | -S "SSL - The handshake negotiation failed" \ |
| 8711 | -S "SSL - Unknown identity received" \ |
| 8712 | -S "SSL - Verification of the message MAC failed" |
| 8713 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8714 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8715 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8716 | "$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] | 8717 | "$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] | 8718 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8719 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8720 | -C "session hash for extended master secret"\ |
| 8721 | -S "session hash for extended master secret"\ |
| 8722 | -S "SSL - The handshake negotiation failed" \ |
| 8723 | -S "SSL - Unknown identity received" \ |
| 8724 | -S "SSL - Verification of the message MAC failed" |
| 8725 | |
| 8726 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8727 | 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] | 8728 | "$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] | 8729 | "$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] | 8730 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8731 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8732 | -C "session hash for extended master secret"\ |
| 8733 | -S "session hash for extended master secret"\ |
| 8734 | -S "SSL - The handshake negotiation failed" \ |
| 8735 | -S "SSL - Unknown identity received" \ |
| 8736 | -S "SSL - Verification of the message MAC failed" |
| 8737 | |
| 8738 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8739 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8740 | "$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] | 8741 | "$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] | 8742 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8743 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8744 | -c "session hash for extended master secret"\ |
| 8745 | -s "session hash for extended master secret"\ |
| 8746 | -S "SSL - The handshake negotiation failed" \ |
| 8747 | -S "SSL - Unknown identity received" \ |
| 8748 | -S "SSL - Verification of the message MAC failed" |
| 8749 | |
| 8750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8751 | 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] | 8752 | "$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] | 8753 | "$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] | 8754 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8755 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8756 | -c "session hash for extended master secret"\ |
| 8757 | -s "session hash for extended master secret"\ |
| 8758 | -S "SSL - The handshake negotiation failed" \ |
| 8759 | -S "SSL - Unknown identity received" \ |
| 8760 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8761 | |
| 8762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8763 | 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] | 8764 | "$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] | 8765 | "$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] | 8766 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8767 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8768 | -C "session hash for extended master secret"\ |
| 8769 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8770 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8771 | -S "SSL - Unknown identity received" \ |
| 8772 | -S "SSL - Verification of the message MAC failed" |
| 8773 | |
| 8774 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8775 | 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] | 8776 | "$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] | 8777 | "$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] | 8778 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8779 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8780 | -C "session hash for extended master secret"\ |
| 8781 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8782 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8783 | -S "SSL - Unknown identity received" \ |
| 8784 | -S "SSL - Verification of the message MAC failed" |
| 8785 | |
| 8786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8787 | 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] | 8788 | "$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] | 8789 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8790 | "$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] | 8791 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
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, SHA384" \ |
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-256-CBC-SHA384 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-256-CBC-SHA384 \ |
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 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8813 | 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] | 8814 | "$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] | 8815 | "$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] | 8816 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8817 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8818 | -C "session hash for extended master secret"\ |
| 8819 | -S "session hash for extended master secret"\ |
| 8820 | -S "SSL - The handshake negotiation failed" \ |
| 8821 | -S "SSL - Unknown identity received" \ |
| 8822 | -S "SSL - Verification of the message MAC failed" |
| 8823 | |
| 8824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8825 | 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] | 8826 | "$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] | 8827 | "$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] | 8828 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8829 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8830 | -C "session hash for extended master secret"\ |
| 8831 | -S "session hash for extended master secret"\ |
| 8832 | -S "SSL - The handshake negotiation failed" \ |
| 8833 | -S "SSL - Unknown identity received" \ |
| 8834 | -S "SSL - Verification of the message MAC failed" |
| 8835 | |
| 8836 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8837 | 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] | 8838 | "$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] | 8839 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8840 | "$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] | 8841 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8842 | 0 \ |
| 8843 | -c "session hash for extended master secret"\ |
| 8844 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8845 | -S "SSL - The handshake negotiation failed" \ |
| 8846 | -S "SSL - Unknown identity received" \ |
| 8847 | -S "SSL - Verification of the message MAC failed" |
| 8848 | |
| 8849 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 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, SHA384" \ |
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-256-CBC-SHA384 extended_ms=1" \ |
| 8853 | "$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] | 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 | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8863 | 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] | 8864 | "$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] | 8865 | "$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] | 8866 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8867 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8868 | -C "session hash for extended master secret"\ |
| 8869 | -S "session hash for extended master secret"\ |
| 8870 | -S "SSL - The handshake negotiation failed" \ |
| 8871 | -S "SSL - Unknown identity received" \ |
| 8872 | -S "SSL - Verification of the message MAC failed" |
| 8873 | |
| 8874 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8875 | 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] | 8876 | "$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] | 8877 | "$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] | 8878 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8879 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8880 | -C "session hash for extended master secret"\ |
| 8881 | -S "session hash for extended master secret"\ |
| 8882 | -S "SSL - The handshake negotiation failed" \ |
| 8883 | -S "SSL - Unknown identity received" \ |
| 8884 | -S "SSL - Verification of the message MAC failed" |
| 8885 | |
| 8886 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8887 | 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] | 8888 | "$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] | 8889 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8890 | "$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] | 8891 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8892 | 0 \ |
| 8893 | -c "session hash for extended master secret"\ |
| 8894 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8895 | -S "SSL - The handshake negotiation failed" \ |
| 8896 | -S "SSL - Unknown identity received" \ |
| 8897 | -S "SSL - Verification of the message MAC failed" |
| 8898 | |
| 8899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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, SHA384" \ |
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-256-CBC-SHA384 extended_ms=1" \ |
| 8903 | "$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] | 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 | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8913 | 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] | 8914 | "$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] | 8915 | "$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] | 8916 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8917 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8918 | -C "session hash for extended master secret"\ |
| 8919 | -S "session hash for extended master secret"\ |
| 8920 | -S "SSL - The handshake negotiation failed" \ |
| 8921 | -S "SSL - Unknown identity received" \ |
| 8922 | -S "SSL - Verification of the message MAC failed" |
| 8923 | |
| 8924 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8925 | 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] | 8926 | "$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] | 8927 | "$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] | 8928 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8929 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8930 | -C "session hash for extended master secret"\ |
| 8931 | -S "session hash for extended master secret"\ |
| 8932 | -S "SSL - The handshake negotiation failed" \ |
| 8933 | -S "SSL - Unknown identity received" \ |
| 8934 | -S "SSL - Verification of the message MAC failed" |
| 8935 | |
| 8936 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8937 | 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] | 8938 | "$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] | 8939 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8940 | "$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] | 8941 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8942 | 0 \ |
| 8943 | -c "session hash for extended master secret"\ |
| 8944 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 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, SHA384" \ |
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-256-CBC-SHA384 extended_ms=1" \ |
| 8953 | "$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] | 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 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8963 | 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] | 8964 | "$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" \ |
| 8965 | "$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] | 8966 | psk_identity=def psk=beef" \ |
| 8967 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8968 | -C "session hash for extended master secret"\ |
| 8969 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8970 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8971 | -S "SSL - Unknown identity received" \ |
| 8972 | -S "SSL - Verification of the message MAC failed" |
| 8973 | |
| 8974 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8975 | 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] | 8976 | "$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" \ |
| 8977 | "$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] | 8978 | psk_identity=def psk=beef" \ |
| 8979 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8980 | -C "session hash for extended master secret"\ |
| 8981 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8982 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8983 | -S "SSL - Unknown identity received" \ |
| 8984 | -S "SSL - Verification of the message MAC failed" |
| 8985 | |
| 8986 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8987 | 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] | 8988 | "$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] | 8989 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8990 | "$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] | 8991 | psk_identity=abc psk=dead extended_ms=1" \ |
| 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, SHA384" \ |
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-256-CBC-SHA384 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-256-CBC-SHA384 \ |
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 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9013 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 9014 | "$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" \ |
| 9015 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9016 | psk_identity=def psk=beef" \ |
| 9017 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9018 | -C "session hash for extended master secret"\ |
| 9019 | -S "session hash for extended master secret"\ |
| 9020 | -S "SSL - The handshake negotiation failed" \ |
| 9021 | -S "SSL - Unknown identity received" \ |
| 9022 | -S "SSL - Verification of the message MAC failed" |
| 9023 | |
| 9024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9025 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 9026 | "$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" \ |
| 9027 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9028 | psk_identity=def psk=beef" \ |
| 9029 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9030 | -C "session hash for extended master secret"\ |
| 9031 | -S "session hash for extended master secret"\ |
| 9032 | -S "SSL - The handshake negotiation failed" \ |
| 9033 | -S "SSL - Unknown identity received" \ |
| 9034 | -S "SSL - Verification of the message MAC failed" |
| 9035 | |
| 9036 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9037 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 9038 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9039 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9040 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9041 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9042 | 0 \ |
| 9043 | -c "session hash for extended master secret"\ |
| 9044 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9045 | -S "SSL - The handshake negotiation failed" \ |
| 9046 | -S "SSL - Unknown identity received" \ |
| 9047 | -S "SSL - Verification of the message MAC failed" |
| 9048 | |
| 9049 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 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, SHA384" \ |
| 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-256-CBC-SHA384 extended_ms=1" \ |
| 9053 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 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 | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9063 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9064 | "$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" \ |
| 9065 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9066 | psk_identity=def psk=beef" \ |
| 9067 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9068 | -C "session hash for extended master secret"\ |
| 9069 | -S "session hash for extended master secret"\ |
| 9070 | -S "SSL - The handshake negotiation failed" \ |
| 9071 | -S "SSL - Unknown identity received" \ |
| 9072 | -S "SSL - Verification of the message MAC failed" |
| 9073 | |
| 9074 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9075 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9076 | "$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" \ |
| 9077 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9078 | psk_identity=def psk=beef" \ |
| 9079 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9080 | -C "session hash for extended master secret"\ |
| 9081 | -S "session hash for extended master secret"\ |
| 9082 | -S "SSL - The handshake negotiation failed" \ |
| 9083 | -S "SSL - Unknown identity received" \ |
| 9084 | -S "SSL - Verification of the message MAC failed" |
| 9085 | |
| 9086 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9087 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9088 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9089 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9090 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9091 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9092 | 0 \ |
| 9093 | -c "session hash for extended master secret"\ |
| 9094 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9095 | -S "SSL - The handshake negotiation failed" \ |
| 9096 | -S "SSL - Unknown identity received" \ |
| 9097 | -S "SSL - Verification of the message MAC failed" |
| 9098 | |
| 9099 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
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, SHA384" \ |
| 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-256-CBC-SHA384 extended_ms=1" \ |
| 9103 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 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 | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9113 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9114 | "$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" \ |
| 9115 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9116 | psk_identity=def psk=beef" \ |
| 9117 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9118 | -C "session hash for extended master secret"\ |
| 9119 | -S "session hash for extended master secret"\ |
| 9120 | -S "SSL - The handshake negotiation failed" \ |
| 9121 | -S "SSL - Unknown identity received" \ |
| 9122 | -S "SSL - Verification of the message MAC failed" |
| 9123 | |
| 9124 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9125 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9126 | "$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" \ |
| 9127 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9128 | psk_identity=def psk=beef" \ |
| 9129 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9130 | -C "session hash for extended master secret"\ |
| 9131 | -S "session hash for extended master secret"\ |
| 9132 | -S "SSL - The handshake negotiation failed" \ |
| 9133 | -S "SSL - Unknown identity received" \ |
| 9134 | -S "SSL - Verification of the message MAC failed" |
| 9135 | |
| 9136 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9137 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9138 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9139 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9140 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9141 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9142 | 0 \ |
| 9143 | -c "session hash for extended master secret"\ |
| 9144 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 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, SHA384" \ |
| 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-256-CBC-SHA384 extended_ms=1" \ |
| 9153 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 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 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9163 | 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] | 9164 | "$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] | 9165 | "$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] | 9166 | psk_identity=def psk=beef" \ |
| 9167 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9168 | -C "session hash for extended master secret"\ |
| 9169 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9170 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9171 | -S "SSL - Unknown identity received" \ |
| 9172 | -S "SSL - Verification of the message MAC failed" |
| 9173 | |
| 9174 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9175 | 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] | 9176 | "$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] | 9177 | "$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] | 9178 | psk_identity=def psk=beef" \ |
| 9179 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9180 | -C "session hash for extended master secret"\ |
| 9181 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9182 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9183 | -S "SSL - Unknown identity received" \ |
| 9184 | -S "SSL - Verification of the message MAC failed" |
| 9185 | |
| 9186 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9187 | 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] | 9188 | "$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] | 9189 | "$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] | 9190 | psk_identity=def psk=beef" \ |
| 9191 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9192 | -C "session hash for extended master secret"\ |
| 9193 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9194 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9195 | -S "SSL - Unknown identity received" \ |
| 9196 | -S "SSL - Verification of the message MAC failed" |
| 9197 | |
| 9198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9199 | 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] | 9200 | "$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] | 9201 | "$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] | 9202 | psk_identity=def psk=beef" \ |
| 9203 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9204 | -C "session hash for extended master secret"\ |
| 9205 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9206 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9207 | -S "SSL - Unknown identity received" \ |
| 9208 | -S "SSL - Verification of the message MAC failed" |
| 9209 | |
| 9210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9211 | 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] | 9212 | "$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] | 9213 | "$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] | 9214 | psk_identity=def psk=beef" \ |
| 9215 | 1 \ |
| 9216 | -s "SSL - Verification of the message MAC failed" |
| 9217 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9218 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9219 | "$P_SRV" \ |
| 9220 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9221 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9222 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9223 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9224 | -S "SSL - Unknown identity received" \ |
| 9225 | -S "SSL - Verification of the message MAC failed" |
| 9226 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9227 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9228 | "$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] | 9229 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9230 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9231 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9232 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9233 | -s "SSL - Unknown identity received" \ |
| 9234 | -S "SSL - Verification of the message MAC failed" |
| 9235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9236 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9237 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9238 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9239 | psk_identity=abc psk=dead" \ |
| 9240 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9241 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9242 | -S "SSL - Unknown identity received" \ |
| 9243 | -S "SSL - Verification of the message MAC failed" |
| 9244 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9245 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9246 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9247 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9248 | psk_identity=def psk=beef" \ |
| 9249 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9250 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9251 | -S "SSL - Unknown identity received" \ |
| 9252 | -S "SSL - Verification of the message MAC failed" |
| 9253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9254 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9255 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9256 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9257 | psk_identity=ghi psk=beef" \ |
| 9258 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9259 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9260 | -s "SSL - Unknown identity received" \ |
| 9261 | -S "SSL - Verification of the message MAC failed" |
| 9262 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9263 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9264 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9265 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9266 | psk_identity=abc psk=beef" \ |
| 9267 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9268 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9269 | -S "SSL - Unknown identity received" \ |
| 9270 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9271 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9272 | # Tests for EC J-PAKE |
| 9273 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9274 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9276 | run_test "ECJPAKE: client not configured" \ |
| 9277 | "$P_SRV debug_level=3" \ |
| 9278 | "$P_CLI debug_level=3" \ |
| 9279 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9280 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9281 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9282 | -S "found ecjpake kkpp extension" \ |
| 9283 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9284 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9285 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9286 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9287 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9288 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9289 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9290 | run_test "ECJPAKE: server not configured" \ |
| 9291 | "$P_SRV debug_level=3" \ |
| 9292 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9293 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9294 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9295 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9296 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9297 | -s "found ecjpake kkpp extension" \ |
| 9298 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9299 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9300 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9301 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9302 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9303 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9304 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9305 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9306 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9307 | run_test "ECJPAKE: working, TLS" \ |
| 9308 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9309 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9310 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9311 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9312 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9313 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9314 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9315 | -s "found ecjpake kkpp extension" \ |
| 9316 | -S "skip ecjpake kkpp extension" \ |
| 9317 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9318 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9319 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9320 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9321 | -S "SSL - Verification of the message MAC failed" |
| 9322 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9323 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9325 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9326 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9327 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9328 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9329 | 0 \ |
| 9330 | -c "add ciphersuite: c0ff" \ |
| 9331 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9332 | -c "using opaque password" \ |
| 9333 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9334 | -C "re-using cached ecjpake parameters" \ |
| 9335 | -s "found ecjpake kkpp extension" \ |
| 9336 | -S "skip ecjpake kkpp extension" \ |
| 9337 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9338 | -s "server hello, ecjpake kkpp extension" \ |
| 9339 | -c "found ecjpake_kkpp extension" \ |
| 9340 | -S "SSL - The handshake negotiation failed" \ |
| 9341 | -S "SSL - Verification of the message MAC failed" |
| 9342 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9343 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9344 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9345 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9346 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9347 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9348 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9349 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9350 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9351 | 0 \ |
| 9352 | -c "add ciphersuite: c0ff" \ |
| 9353 | -c "adding ecjpake_kkpp extension" \ |
| 9354 | -c "using opaque password" \ |
| 9355 | -S "using opaque password" \ |
| 9356 | -C "re-using cached ecjpake parameters" \ |
| 9357 | -s "found ecjpake kkpp extension" \ |
| 9358 | -S "skip ecjpake kkpp extension" \ |
| 9359 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9360 | -s "server hello, ecjpake kkpp extension" \ |
| 9361 | -c "found ecjpake_kkpp extension" \ |
| 9362 | -S "SSL - The handshake negotiation failed" \ |
| 9363 | -S "SSL - Verification of the message MAC failed" |
| 9364 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9365 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9366 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9367 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9368 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9369 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9370 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9371 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9372 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9373 | 0 \ |
| 9374 | -c "add ciphersuite: c0ff" \ |
| 9375 | -c "adding ecjpake_kkpp extension" \ |
| 9376 | -C "using opaque password" \ |
| 9377 | -s "using opaque password" \ |
| 9378 | -C "re-using cached ecjpake parameters" \ |
| 9379 | -s "found ecjpake kkpp extension" \ |
| 9380 | -S "skip ecjpake kkpp extension" \ |
| 9381 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9382 | -s "server hello, ecjpake kkpp extension" \ |
| 9383 | -c "found ecjpake_kkpp extension" \ |
| 9384 | -S "SSL - The handshake negotiation failed" \ |
| 9385 | -S "SSL - Verification of the message MAC failed" |
| 9386 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9387 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9388 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9389 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9390 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9391 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9392 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9393 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9394 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9395 | -s "SSL - Verification of the message MAC failed" |
| 9396 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9397 | server_needs_more_time 1 |
| 9398 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9399 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9400 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9401 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9402 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9403 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9404 | 1 \ |
| 9405 | -c "using opaque password" \ |
| 9406 | -s "using opaque password" \ |
| 9407 | -C "re-using cached ecjpake parameters" \ |
| 9408 | -s "SSL - Verification of the message MAC failed" |
| 9409 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9410 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9411 | run_test "ECJPAKE: working, DTLS" \ |
| 9412 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9413 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9414 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9415 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9416 | -c "re-using cached ecjpake parameters" \ |
| 9417 | -S "SSL - Verification of the message MAC failed" |
| 9418 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9419 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9420 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9421 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9422 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9423 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9424 | 0 \ |
| 9425 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9426 | -S "SSL - Verification of the message MAC failed" |
| 9427 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9428 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9429 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9430 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9431 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9432 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9433 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9434 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9435 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9436 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9437 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9438 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9439 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9440 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9441 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9442 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9443 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9444 | 0 |
| 9445 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9446 | # Test for ClientHello without extensions |
| 9447 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9448 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9449 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9450 | requires_gnutls |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9451 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9452 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9453 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9454 | 0 \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9455 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9456 | -S "Ciphersuite is .*-EC.*" \ |
| 9457 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9458 | |
Gilles Peskine | fc73aa0 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9459 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9460 | requires_gnutls |
| 9461 | run_test "ClientHello without extensions: PSK" \ |
| 9462 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9463 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9464 | 0 \ |
| 9465 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9466 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9467 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9468 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9469 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9470 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9471 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9473 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9474 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9475 | "$P_CLI request_size=100" \ |
| 9476 | 0 \ |
| 9477 | -s "Read from client: 100 bytes read$" |
| 9478 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9480 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9481 | "$P_SRV buffer_size=100" \ |
| 9482 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9483 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9484 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9485 | |
| 9486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9487 | requires_max_content_len 200 |
| 9488 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9489 | "$P_SRV buffer_size=100" \ |
| 9490 | "$P_CLI request_size=200" \ |
| 9491 | 0 \ |
| 9492 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9493 | |
| 9494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9495 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9496 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9497 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9498 | 0 \ |
| 9499 | -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] | 9500 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9501 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9502 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9503 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9504 | "$P_SRV force_version=tls12" \ |
| 9505 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9506 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9507 | 0 \ |
| 9508 | -s "Read from client: 1 bytes read" |
| 9509 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9510 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9511 | "$P_SRV force_version=tls12" \ |
| 9512 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9513 | 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] | 9514 | 0 \ |
| 9515 | -s "Read from client: 1 bytes read" |
| 9516 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9517 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9518 | "$P_SRV force_version=tls12" \ |
| 9519 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9520 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9521 | 0 \ |
| 9522 | -s "Read from client: 1 bytes read" |
| 9523 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9524 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9525 | "$P_SRV force_version=tls12" \ |
| 9526 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9527 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9528 | 0 \ |
| 9529 | -s "Read from client: 1 bytes read" |
| 9530 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9531 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9532 | "$P_SRV force_version=tls12" \ |
| 9533 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9534 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9535 | 0 \ |
| 9536 | -s "Read from client: 1 bytes read" |
| 9537 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9538 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9539 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9540 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9541 | "$P_CLI request_size=1 \ |
| 9542 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9543 | 0 \ |
| 9544 | -s "Read from client: 1 bytes read" |
| 9545 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9546 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9547 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9548 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9549 | "$P_CLI request_size=1 \ |
| 9550 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9551 | 0 \ |
| 9552 | -s "Read from client: 1 bytes read" |
| 9553 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9554 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9555 | |
| 9556 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9557 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9558 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9559 | "$P_CLI dtls=1 request_size=1 \ |
| 9560 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9561 | 0 \ |
| 9562 | -s "Read from client: 1 bytes read" |
| 9563 | |
| 9564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9565 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9566 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9567 | "$P_CLI dtls=1 request_size=1 \ |
| 9568 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9569 | 0 \ |
| 9570 | -s "Read from client: 1 bytes read" |
| 9571 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9572 | # Tests for small server packets |
| 9573 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9574 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9575 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9576 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9577 | 0 \ |
| 9578 | -c "Read from server: 1 bytes read" |
| 9579 | |
| 9580 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9581 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9582 | "$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] | 9583 | 0 \ |
| 9584 | -c "Read from server: 1 bytes read" |
| 9585 | |
| 9586 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9587 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9588 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9589 | 0 \ |
| 9590 | -c "Read from server: 1 bytes read" |
| 9591 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9592 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9593 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9594 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9595 | 0 \ |
| 9596 | -c "Read from server: 1 bytes read" |
| 9597 | |
| 9598 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9599 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9600 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9601 | 0 \ |
| 9602 | -c "Read from server: 1 bytes read" |
| 9603 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9604 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9605 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9606 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9607 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9608 | 0 \ |
| 9609 | -c "Read from server: 1 bytes read" |
| 9610 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9611 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9612 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9613 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9614 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9615 | 0 \ |
| 9616 | -c "Read from server: 1 bytes read" |
| 9617 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9618 | # Tests for small server packets in DTLS |
| 9619 | |
| 9620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9621 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9622 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9623 | "$P_CLI dtls=1 \ |
| 9624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9625 | 0 \ |
| 9626 | -c "Read from server: 1 bytes read" |
| 9627 | |
| 9628 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9629 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9630 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9631 | "$P_CLI dtls=1 \ |
| 9632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9633 | 0 \ |
| 9634 | -c "Read from server: 1 bytes read" |
| 9635 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9636 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9637 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9638 | # How many fragments do we expect to write $1 bytes? |
| 9639 | fragments_for_write() { |
| 9640 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9641 | } |
| 9642 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9643 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9644 | "$P_SRV force_version=tls12" \ |
| 9645 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9646 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9647 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9648 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9649 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9650 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9651 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9652 | "$P_SRV force_version=tls12" \ |
| 9653 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9654 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9655 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9656 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9657 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9658 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9659 | "$P_SRV force_version=tls12" \ |
| 9660 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9661 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9662 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9663 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9664 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9665 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9666 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9667 | "$P_SRV force_version=tls12" \ |
| 9668 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9669 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9670 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9671 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9672 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9673 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9674 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9675 | "$P_SRV force_version=tls12" \ |
| 9676 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9678 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9679 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9680 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9681 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9682 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9683 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9684 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9685 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9686 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9687 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9688 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9689 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9690 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9691 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9692 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9693 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9694 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9695 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9696 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9697 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9698 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9699 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9700 | # 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] | 9701 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9702 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9703 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9704 | 0 \ |
| 9705 | -c "Read from server: 16384 bytes read" |
| 9706 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9707 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9708 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9709 | "$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] | 9710 | 0 \ |
| 9711 | -s "16384 bytes written in 1 fragments" \ |
| 9712 | -c "Read from server: 16384 bytes read" |
| 9713 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9714 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
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-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
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, truncated MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9721 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9722 | "$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] | 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 AEAD" \ |
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-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9730 | 0 \ |
| 9731 | -c "Read from server: 16384 bytes read" |
| 9732 | |
| 9733 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9734 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9735 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9736 | 0 \ |
| 9737 | -c "Read from server: 16384 bytes read" |
| 9738 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9739 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9740 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9741 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9742 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9743 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9744 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9745 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9746 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9747 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9748 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9749 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9750 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9751 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9752 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9753 | # Tests for restartable ECC |
| 9754 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9755 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9756 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9757 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9758 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9759 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9760 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9761 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9762 | 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] | 9763 | debug_level=1" \ |
| 9764 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9765 | -C "x509_verify_cert.*4b00" \ |
| 9766 | -C "mbedtls_pk_verify.*4b00" \ |
| 9767 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9768 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9769 | |
| 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, max_ops=0" \ |
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 ec_max_ops=0" \ |
| 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=65535" \ |
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=65535" \ |
| 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 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9796 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9797 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9798 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9799 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9800 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9801 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9802 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9803 | 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] | 9804 | debug_level=1 ec_max_ops=1000" \ |
| 9805 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9806 | -c "x509_verify_cert.*4b00" \ |
| 9807 | -c "mbedtls_pk_verify.*4b00" \ |
| 9808 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9809 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9810 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9811 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9812 | # everything except ECDH (where TLS calls PSA directly). |
| 9813 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9814 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9815 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9816 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9817 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9818 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9819 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9820 | debug_level=1 ec_max_ops=1000" \ |
| 9821 | 0 \ |
| 9822 | -c "x509_verify_cert.*4b00" \ |
| 9823 | -c "mbedtls_pk_verify.*4b00" \ |
| 9824 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9825 | -c "mbedtls_pk_sign.*4b00" |
| 9826 | |
| 9827 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9828 | # 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] | 9829 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9830 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9831 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9832 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9833 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9834 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9835 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9836 | 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] | 9837 | debug_level=1 ec_max_ops=1000" \ |
| 9838 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9839 | -c "x509_verify_cert.*4b00" \ |
| 9840 | -C "mbedtls_pk_verify.*4b00" \ |
| 9841 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9842 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9843 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9844 | -c "! mbedtls_ssl_handshake returned" \ |
| 9845 | -c "X509 - Certificate verification failed" |
| 9846 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9847 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9848 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9849 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9850 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9851 | 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] | 9852 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9853 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9854 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9855 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9856 | 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] | 9857 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9858 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9859 | -c "x509_verify_cert.*4b00" \ |
| 9860 | -c "mbedtls_pk_verify.*4b00" \ |
| 9861 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9862 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9863 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9864 | -C "! mbedtls_ssl_handshake returned" \ |
| 9865 | -C "X509 - Certificate verification failed" |
| 9866 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9867 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9868 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9869 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9870 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9872 | 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] | 9873 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9874 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9875 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9876 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9877 | 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] | 9878 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9879 | 0 \ |
| 9880 | -c "x509_verify_cert.*4b00" \ |
| 9881 | -c "mbedtls_pk_verify.*4b00" \ |
| 9882 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9883 | -c "mbedtls_pk_sign.*4b00" \ |
| 9884 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9885 | -C "! mbedtls_ssl_handshake returned" \ |
| 9886 | -C "X509 - Certificate verification failed" |
| 9887 | |
| 9888 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9889 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9890 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9891 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9892 | 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] | 9893 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9894 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9895 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9896 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9897 | 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] | 9898 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9899 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9900 | -C "x509_verify_cert.*4b00" \ |
| 9901 | -c "mbedtls_pk_verify.*4b00" \ |
| 9902 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9903 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9904 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9905 | -C "! mbedtls_ssl_handshake returned" \ |
| 9906 | -C "X509 - Certificate verification failed" |
| 9907 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9908 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9909 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9910 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9911 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9913 | 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] | 9914 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9915 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9916 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9917 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9918 | 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] | 9919 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9920 | 0 \ |
| 9921 | -C "x509_verify_cert.*4b00" \ |
| 9922 | -c "mbedtls_pk_verify.*4b00" \ |
| 9923 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9924 | -c "mbedtls_pk_sign.*4b00" \ |
| 9925 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9926 | -C "! mbedtls_ssl_handshake returned" \ |
| 9927 | -C "X509 - Certificate verification failed" |
| 9928 | |
| 9929 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9930 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9931 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9932 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9933 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9934 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9935 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9936 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9937 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9938 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9939 | -c "x509_verify_cert.*4b00" \ |
| 9940 | -c "mbedtls_pk_verify.*4b00" \ |
| 9941 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9942 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9943 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9944 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9945 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9946 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9947 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9948 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9949 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9950 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9951 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9952 | 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] | 9953 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9954 | 0 \ |
| 9955 | -c "x509_verify_cert.*4b00" \ |
| 9956 | -c "mbedtls_pk_verify.*4b00" \ |
| 9957 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9958 | -c "mbedtls_pk_sign.*4b00" |
| 9959 | |
| 9960 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9961 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9962 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9963 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9964 | 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] | 9965 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9966 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9967 | debug_level=1 ec_max_ops=1000" \ |
| 9968 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9969 | -c "x509_verify_cert.*4b00" \ |
| 9970 | -c "mbedtls_pk_verify.*4b00" \ |
| 9971 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9972 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9973 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9974 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9975 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9976 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9977 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9978 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9979 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9980 | 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] | 9981 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9982 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9983 | debug_level=1 ec_max_ops=1000" \ |
| 9984 | 0 \ |
| 9985 | -c "x509_verify_cert.*4b00" \ |
| 9986 | -c "mbedtls_pk_verify.*4b00" \ |
| 9987 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9988 | -C "mbedtls_pk_sign.*4b00" |
| 9989 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9990 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9991 | # restartable behaviour at all (not even client auth). |
| 9992 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9993 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9994 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9995 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9996 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9997 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9998 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9999 | 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] | 10000 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10001 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 10002 | -C "x509_verify_cert.*4b00" \ |
| 10003 | -C "mbedtls_pk_verify.*4b00" \ |
| 10004 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 10005 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10006 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10007 | # Tests of asynchronous private key support in SSL |
| 10008 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10009 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10010 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10011 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10012 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10013 | "$P_CLI" \ |
| 10014 | 0 \ |
| 10015 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10016 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10017 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10018 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10019 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10020 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10021 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10022 | "$P_CLI" \ |
| 10023 | 0 \ |
| 10024 | -s "Async sign callback: using key slot " \ |
| 10025 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10026 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10027 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10028 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10029 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10030 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10031 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 10032 | "$P_CLI" \ |
| 10033 | 0 \ |
| 10034 | -s "Async sign callback: using key slot " \ |
| 10035 | -U "Async sign callback: using key slot " \ |
| 10036 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 10037 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10038 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10039 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10040 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 10041 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10042 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10043 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10044 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10045 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 10046 | 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] | 10047 | "$P_CLI server_name=polarssl.example" \ |
| 10048 | 0 \ |
| 10049 | -s "Async sign callback: using key slot " \ |
| 10050 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10051 | -s "parse ServerName extension" \ |
| 10052 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 10053 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 10054 | |
| 10055 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10056 | run_test "SSL async private: decrypt, delay=0" \ |
| 10057 | "$P_SRV \ |
| 10058 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 10059 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10060 | 0 \ |
| 10061 | -s "Async decrypt callback: using key slot " \ |
| 10062 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10063 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10065 | run_test "SSL async private: decrypt, delay=1" \ |
| 10066 | "$P_SRV \ |
| 10067 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10068 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10069 | 0 \ |
| 10070 | -s "Async decrypt callback: using key slot " \ |
| 10071 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10072 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10073 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10074 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10075 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10076 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10077 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10078 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10079 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10080 | 0 \ |
| 10081 | -s "Async decrypt callback: using key slot " \ |
| 10082 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10083 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10084 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10085 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10086 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10087 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10088 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10089 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10090 | 0 \ |
| 10091 | -s "Async decrypt callback: using key slot " \ |
| 10092 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10093 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10094 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10095 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10096 | run_test "SSL async private: sign callback not present" \ |
| 10097 | "$P_SRV \ |
| 10098 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10099 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10100 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10101 | 0 \ |
| 10102 | -S "Async sign callback" \ |
| 10103 | -s "! mbedtls_ssl_handshake returned" \ |
| 10104 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10105 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10106 | -s "Successful connection" |
| 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: decrypt callback not present" \ |
| 10110 | "$P_SRV debug_level=1 \ |
| 10111 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10112 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10113 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10114 | 0 \ |
| 10115 | -S "Async decrypt callback" \ |
| 10116 | -s "! mbedtls_ssl_handshake returned" \ |
| 10117 | -s "got no RSA private key" \ |
| 10118 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10119 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10120 | |
| 10121 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10122 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10123 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10124 | "$P_SRV \ |
| 10125 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10126 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10127 | 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] | 10128 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10129 | 0 \ |
| 10130 | -s "Async sign callback: using key slot 0," \ |
| 10131 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10132 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10133 | |
| 10134 | # key1: ECDSA, key2: RSA; use key2 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 key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10137 | "$P_SRV \ |
| 10138 | async_operations=s async_private_delay2=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-RSA-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 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10149 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10150 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10151 | async_operations=s async_private_delay1=1 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 1," \ |
| 10157 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10158 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10159 | |
| 10160 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10161 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10162 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10163 | "$P_SRV \ |
| 10164 | async_operations=s async_private_delay1=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: no key matches this certificate." |
| 10170 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10171 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10172 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10173 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10174 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10175 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10176 | "$P_CLI" \ |
| 10177 | 1 \ |
| 10178 | -s "Async sign callback: injected error" \ |
| 10179 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10180 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10181 | -s "! mbedtls_ssl_handshake returned" |
| 10182 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10184 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10185 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10186 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10187 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10188 | "$P_CLI" \ |
| 10189 | 1 \ |
| 10190 | -s "Async sign callback: using key slot " \ |
| 10191 | -S "Async resume" \ |
| 10192 | -s "Async cancel" |
| 10193 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10194 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10195 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10196 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10197 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10198 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10199 | "$P_CLI" \ |
| 10200 | 1 \ |
| 10201 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10202 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10203 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10204 | -s "! mbedtls_ssl_handshake returned" |
| 10205 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10206 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10207 | run_test "SSL async private: decrypt, error in start" \ |
| 10208 | "$P_SRV \ |
| 10209 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10210 | async_private_error=1" \ |
| 10211 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10212 | 1 \ |
| 10213 | -s "Async decrypt callback: injected error" \ |
| 10214 | -S "Async resume" \ |
| 10215 | -S "Async cancel" \ |
| 10216 | -s "! mbedtls_ssl_handshake returned" |
| 10217 | |
| 10218 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10219 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10220 | "$P_SRV \ |
| 10221 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10222 | async_private_error=2" \ |
| 10223 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10224 | 1 \ |
| 10225 | -s "Async decrypt callback: using key slot " \ |
| 10226 | -S "Async resume" \ |
| 10227 | -s "Async cancel" |
| 10228 | |
| 10229 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10230 | run_test "SSL async private: decrypt, error in resume" \ |
| 10231 | "$P_SRV \ |
| 10232 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10233 | async_private_error=3" \ |
| 10234 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10235 | 1 \ |
| 10236 | -s "Async decrypt callback: using key slot " \ |
| 10237 | -s "Async resume callback: decrypt done but injected error" \ |
| 10238 | -S "Async cancel" \ |
| 10239 | -s "! mbedtls_ssl_handshake returned" |
| 10240 | |
| 10241 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10242 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10243 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10244 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10245 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10246 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10247 | 0 \ |
| 10248 | -s "Async cancel" \ |
| 10249 | -s "! mbedtls_ssl_handshake returned" \ |
| 10250 | -s "Async resume" \ |
| 10251 | -s "Successful connection" |
| 10252 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10253 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10254 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10255 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10256 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10257 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10258 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10259 | 0 \ |
| 10260 | -s "! mbedtls_ssl_handshake returned" \ |
| 10261 | -s "Async resume" \ |
| 10262 | -s "Successful connection" |
| 10263 | |
| 10264 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10265 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10266 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10267 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10268 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10270 | 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] | 10271 | "$P_SRV \ |
| 10272 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10273 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10274 | 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] | 10275 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10276 | [ \$? -eq 1 ] && |
| 10277 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10278 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10279 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10280 | -S "Async resume" \ |
| 10281 | -s "Async cancel" \ |
| 10282 | -s "! mbedtls_ssl_handshake returned" \ |
| 10283 | -s "Async sign callback: no key matches this certificate." \ |
| 10284 | -s "Successful connection" |
| 10285 | |
| 10286 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10287 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10288 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10289 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10290 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10291 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10292 | 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] | 10293 | "$P_SRV \ |
| 10294 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10295 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10296 | 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] | 10297 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10298 | [ \$? -eq 1 ] && |
| 10299 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10300 | 0 \ |
| 10301 | -s "Async resume" \ |
| 10302 | -s "! mbedtls_ssl_handshake returned" \ |
| 10303 | -s "Async sign callback: no key matches this certificate." \ |
| 10304 | -s "Successful connection" |
| 10305 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10306 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10308 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10309 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10310 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10311 | exchanges=2 renegotiation=1" \ |
| 10312 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10313 | 0 \ |
| 10314 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10315 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10316 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10317 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10318 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10319 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10320 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10321 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10322 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10323 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10324 | 0 \ |
| 10325 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10326 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10327 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10328 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10329 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10330 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10331 | "$P_SRV \ |
| 10332 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10333 | exchanges=2 renegotiation=1" \ |
| 10334 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10335 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10336 | 0 \ |
| 10337 | -s "Async decrypt callback: using key slot " \ |
| 10338 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10339 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10340 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10342 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10343 | "$P_SRV \ |
| 10344 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10345 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10346 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10347 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10348 | 0 \ |
| 10349 | -s "Async decrypt callback: using key slot " \ |
| 10350 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10351 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10352 | # Tests for ECC extensions (rfc 4492) |
| 10353 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10354 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10355 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10356 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10357 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10358 | "$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] | 10359 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10360 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10361 | -C "client hello, adding supported_point_formats extension" \ |
| 10362 | -S "found supported elliptic curves extension" \ |
| 10363 | -S "found supported point formats extension" |
| 10364 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10365 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10366 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10367 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10368 | "$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] | 10369 | "$P_CLI debug_level=3" \ |
| 10370 | 0 \ |
| 10371 | -C "found supported_point_formats extension" \ |
| 10372 | -S "server hello, supported_point_formats extension" |
| 10373 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10374 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10375 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10376 | "$P_SRV debug_level=3" \ |
| 10377 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10378 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10379 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10380 | -c "client hello, adding supported_point_formats extension" \ |
| 10381 | -s "found supported elliptic curves extension" \ |
| 10382 | -s "found supported point formats extension" |
| 10383 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10384 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10385 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10386 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10387 | "$P_CLI debug_level=3" \ |
| 10388 | 0 \ |
| 10389 | -c "found supported_point_formats extension" \ |
| 10390 | -s "server hello, supported_point_formats extension" |
| 10391 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10392 | # Tests for DTLS HelloVerifyRequest |
| 10393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10395 | run_test "DTLS cookie: enabled" \ |
| 10396 | "$P_SRV dtls=1 debug_level=2" \ |
| 10397 | "$P_CLI dtls=1 debug_level=2" \ |
| 10398 | 0 \ |
| 10399 | -s "cookie verification failed" \ |
| 10400 | -s "cookie verification passed" \ |
| 10401 | -S "cookie verification skipped" \ |
| 10402 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10403 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10404 | -S "SSL - The requested feature is not available" |
| 10405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10407 | run_test "DTLS cookie: disabled" \ |
| 10408 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10409 | "$P_CLI dtls=1 debug_level=2" \ |
| 10410 | 0 \ |
| 10411 | -S "cookie verification failed" \ |
| 10412 | -S "cookie verification passed" \ |
| 10413 | -s "cookie verification skipped" \ |
| 10414 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10415 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10416 | -S "SSL - The requested feature is not available" |
| 10417 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10419 | run_test "DTLS cookie: default (failing)" \ |
| 10420 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10421 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10422 | 1 \ |
| 10423 | -s "cookie verification failed" \ |
| 10424 | -S "cookie verification passed" \ |
| 10425 | -S "cookie verification skipped" \ |
| 10426 | -C "received hello verify request" \ |
| 10427 | -S "hello verification requested" \ |
| 10428 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10429 | |
| 10430 | requires_ipv6 |
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 | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10432 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10433 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10434 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10435 | 0 \ |
| 10436 | -s "cookie verification failed" \ |
| 10437 | -s "cookie verification passed" \ |
| 10438 | -S "cookie verification skipped" \ |
| 10439 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10440 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10441 | -S "SSL - The requested feature is not available" |
| 10442 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10444 | run_test "DTLS cookie: enabled, nbio" \ |
| 10445 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10446 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10447 | 0 \ |
| 10448 | -s "cookie verification failed" \ |
| 10449 | -s "cookie verification passed" \ |
| 10450 | -S "cookie verification skipped" \ |
| 10451 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10452 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10453 | -S "SSL - The requested feature is not available" |
| 10454 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10455 | # Tests for client reconnecting from the same port with DTLS |
| 10456 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10457 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10459 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10460 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10461 | "$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] | 10462 | 0 \ |
| 10463 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10464 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10465 | -S "Client initiated reconnection from same port" |
| 10466 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10467 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10469 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10470 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10471 | "$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] | 10472 | 0 \ |
| 10473 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10474 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10475 | -s "Client initiated reconnection from same port" |
| 10476 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10477 | 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] | 10478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10479 | 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] | 10480 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10481 | "$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] | 10482 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10483 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10484 | -s "Client initiated reconnection from same port" |
| 10485 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10486 | 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] | 10487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10488 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10489 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10490 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10491 | 0 \ |
| 10492 | -S "The operation timed out" \ |
| 10493 | -s "Client initiated reconnection from same port" |
| 10494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10496 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10497 | "$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] | 10498 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10499 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10500 | -s "The operation timed out" \ |
| 10501 | -S "Client initiated reconnection from same port" |
| 10502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10504 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10505 | -p "$P_PXY inject_clihlo=1" \ |
| 10506 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10507 | "$P_CLI dtls=1 exchanges=2" \ |
| 10508 | 0 \ |
| 10509 | -s "possible client reconnect from the same port" \ |
| 10510 | -S "Client initiated reconnection from same port" |
| 10511 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10512 | # Tests for various cases of client authentication with DTLS |
| 10513 | # (focused on handshake flows and message parsing) |
| 10514 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10516 | run_test "DTLS client auth: required" \ |
| 10517 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10518 | "$P_CLI dtls=1" \ |
| 10519 | 0 \ |
| 10520 | -s "Verifying peer X.509 certificate... ok" |
| 10521 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10523 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10524 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10525 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10526 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10527 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10528 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10530 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10531 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10532 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10533 | 0 \ |
| 10534 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10535 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10536 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10537 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10538 | "$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] | 10539 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10540 | 1 \ |
| 10541 | -s "SSL - Verification of the message MAC failed" \ |
| 10542 | -c "SSL - A fatal alert message was received from our peer" |
| 10543 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10544 | # Tests for receiving fragmented handshake messages with DTLS |
| 10545 | |
| 10546 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10548 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10549 | "$G_SRV -u --mtu 2048 -a" \ |
| 10550 | "$P_CLI dtls=1 debug_level=2" \ |
| 10551 | 0 \ |
| 10552 | -C "found fragmented DTLS handshake message" \ |
| 10553 | -C "error" |
| 10554 | |
| 10555 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10557 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10558 | "$G_SRV -u --mtu 512" \ |
| 10559 | "$P_CLI dtls=1 debug_level=2" \ |
| 10560 | 0 \ |
| 10561 | -c "found fragmented DTLS handshake message" \ |
| 10562 | -C "error" |
| 10563 | |
| 10564 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10566 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10567 | "$G_SRV -u --mtu 128" \ |
| 10568 | "$P_CLI dtls=1 debug_level=2" \ |
| 10569 | 0 \ |
| 10570 | -c "found fragmented DTLS handshake message" \ |
| 10571 | -C "error" |
| 10572 | |
| 10573 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10575 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10576 | "$G_SRV -u --mtu 128" \ |
| 10577 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10578 | 0 \ |
| 10579 | -c "found fragmented DTLS handshake message" \ |
| 10580 | -C "error" |
| 10581 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10582 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10583 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10585 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10586 | "$G_SRV -u --mtu 256" \ |
| 10587 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10588 | 0 \ |
| 10589 | -c "found fragmented DTLS handshake message" \ |
| 10590 | -c "client hello, adding renegotiation extension" \ |
| 10591 | -c "found renegotiation extension" \ |
| 10592 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10593 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10594 | -C "error" \ |
| 10595 | -s "Extra-header:" |
| 10596 | |
| 10597 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10598 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10600 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10601 | "$G_SRV -u --mtu 256" \ |
| 10602 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10603 | 0 \ |
| 10604 | -c "found fragmented DTLS handshake message" \ |
| 10605 | -c "client hello, adding renegotiation extension" \ |
| 10606 | -c "found renegotiation extension" \ |
| 10607 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10608 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10609 | -C "error" \ |
| 10610 | -s "Extra-header:" |
| 10611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10613 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10614 | "$O_SRV -dtls -mtu 2048" \ |
| 10615 | "$P_CLI dtls=1 debug_level=2" \ |
| 10616 | 0 \ |
| 10617 | -C "found fragmented DTLS handshake message" \ |
| 10618 | -C "error" |
| 10619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10621 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10622 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10623 | "$P_CLI dtls=1 debug_level=2" \ |
| 10624 | 0 \ |
| 10625 | -c "found fragmented DTLS handshake message" \ |
| 10626 | -C "error" |
| 10627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10629 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10630 | "$O_SRV -dtls -mtu 256" \ |
| 10631 | "$P_CLI dtls=1 debug_level=2" \ |
| 10632 | 0 \ |
| 10633 | -c "found fragmented DTLS handshake message" \ |
| 10634 | -C "error" |
| 10635 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10637 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10638 | "$O_SRV -dtls -mtu 256" \ |
| 10639 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10640 | 0 \ |
| 10641 | -c "found fragmented DTLS handshake message" \ |
| 10642 | -C "error" |
| 10643 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10644 | # Tests for sending fragmented handshake messages with DTLS |
| 10645 | # |
| 10646 | # Use client auth when we need the client to send large messages, |
| 10647 | # and use large cert chains on both sides too (the long chains we have all use |
| 10648 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10649 | # Sizes reached (UDP payload): |
| 10650 | # - 2037B for server certificate |
| 10651 | # - 1542B for client certificate |
| 10652 | # - 1013B for newsessionticket |
| 10653 | # - all others below 512B |
| 10654 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10655 | |
| 10656 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10657 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10658 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10659 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10661 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10662 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10663 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10664 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10665 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10666 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10667 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10668 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10669 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10670 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10671 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10672 | 0 \ |
| 10673 | -S "found fragmented DTLS handshake message" \ |
| 10674 | -C "found fragmented DTLS handshake message" \ |
| 10675 | -C "error" |
| 10676 | |
| 10677 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10678 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10679 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10680 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10682 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10683 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10684 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10685 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10686 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10687 | max_frag_len=1024" \ |
| 10688 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10689 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10690 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10691 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10692 | max_frag_len=2048" \ |
| 10693 | 0 \ |
| 10694 | -S "found fragmented DTLS handshake message" \ |
| 10695 | -c "found fragmented DTLS handshake message" \ |
| 10696 | -C "error" |
| 10697 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10698 | # With the MFL extension, the server has no way of forcing |
| 10699 | # the client to not exceed a certain MTU; hence, the following |
| 10700 | # test can't be replicated with an MTU proxy such as the one |
| 10701 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10702 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10703 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10704 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10705 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10707 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10708 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10709 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10710 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10711 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10712 | max_frag_len=512" \ |
| 10713 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10714 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10715 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10716 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10717 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10718 | 0 \ |
| 10719 | -S "found fragmented DTLS handshake message" \ |
| 10720 | -c "found fragmented DTLS handshake message" \ |
| 10721 | -C "error" |
| 10722 | |
| 10723 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10724 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10725 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10726 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10728 | 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] | 10729 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10730 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10731 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10732 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10733 | max_frag_len=2048" \ |
| 10734 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10735 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10736 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10737 | hs_timeout=2500-60000 \ |
| 10738 | max_frag_len=1024" \ |
| 10739 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10740 | -S "found fragmented DTLS handshake message" \ |
| 10741 | -c "found fragmented DTLS handshake message" \ |
| 10742 | -C "error" |
| 10743 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10744 | # While not required by the standard defining the MFL extension |
| 10745 | # (according to which it only applies to records, not to datagrams), |
| 10746 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10747 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10748 | # to the peer. |
| 10749 | # The next test checks that no datagrams significantly larger than the |
| 10750 | # negotiated MFL are sent. |
| 10751 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10752 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10753 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10754 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10756 | 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] | 10757 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10758 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10759 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10760 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10761 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10762 | max_frag_len=2048" \ |
| 10763 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10764 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10765 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10766 | hs_timeout=2500-60000 \ |
| 10767 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10768 | 0 \ |
| 10769 | -S "found fragmented DTLS handshake message" \ |
| 10770 | -c "found fragmented DTLS handshake message" \ |
| 10771 | -C "error" |
| 10772 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10774 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10775 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10776 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10778 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10779 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10780 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10781 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10782 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10783 | max_frag_len=2048" \ |
| 10784 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10785 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10786 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10787 | hs_timeout=2500-60000 \ |
| 10788 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10789 | 0 \ |
| 10790 | -s "found fragmented DTLS handshake message" \ |
| 10791 | -c "found fragmented DTLS handshake message" \ |
| 10792 | -C "error" |
| 10793 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10794 | # While not required by the standard defining the MFL extension |
| 10795 | # (according to which it only applies to records, not to datagrams), |
| 10796 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10797 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10798 | # to the peer. |
| 10799 | # The next test checks that no datagrams significantly larger than the |
| 10800 | # negotiated MFL are sent. |
| 10801 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10802 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10803 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10804 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10806 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10807 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10808 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10809 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10810 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10811 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10812 | max_frag_len=2048" \ |
| 10813 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10814 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10815 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10816 | hs_timeout=2500-60000 \ |
| 10817 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10818 | 0 \ |
| 10819 | -s "found fragmented DTLS handshake message" \ |
| 10820 | -c "found fragmented DTLS handshake message" \ |
| 10821 | -C "error" |
| 10822 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10823 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10824 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10825 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10827 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10828 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10829 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10830 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10831 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10832 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10833 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10834 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10835 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10836 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10837 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10838 | 0 \ |
| 10839 | -S "found fragmented DTLS handshake message" \ |
| 10840 | -C "found fragmented DTLS handshake message" \ |
| 10841 | -C "error" |
| 10842 | |
| 10843 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10844 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10845 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10847 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10848 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10849 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10850 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10851 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10852 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10853 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10854 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10855 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10856 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10857 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10858 | 0 \ |
| 10859 | -s "found fragmented DTLS handshake message" \ |
| 10860 | -C "found fragmented DTLS handshake message" \ |
| 10861 | -C "error" |
| 10862 | |
| 10863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10864 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10865 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10867 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10868 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10869 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10870 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10871 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10872 | mtu=512" \ |
| 10873 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10874 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10875 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10876 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10877 | mtu=2048" \ |
| 10878 | 0 \ |
| 10879 | -S "found fragmented DTLS handshake message" \ |
| 10880 | -c "found fragmented DTLS handshake message" \ |
| 10881 | -C "error" |
| 10882 | |
| 10883 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10884 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10885 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10887 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10888 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10889 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10890 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10891 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10892 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10893 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10894 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10895 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10896 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10897 | hs_timeout=2500-60000 \ |
| 10898 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10899 | 0 \ |
| 10900 | -s "found fragmented DTLS handshake message" \ |
| 10901 | -c "found fragmented DTLS handshake message" \ |
| 10902 | -C "error" |
| 10903 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10904 | # 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] | 10905 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10906 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10907 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10908 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10909 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10910 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10911 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10912 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10913 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10914 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10915 | mtu=512" \ |
| 10916 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10917 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10918 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10919 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10920 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10921 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10922 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10923 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10924 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10925 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10926 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10927 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10928 | # 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] | 10929 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10930 | # retransmissions, but in some cases (like both the server and client using |
| 10931 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10932 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10933 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10935 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10936 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10937 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10938 | -p "$P_PXY mtu=508" \ |
| 10939 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10940 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10941 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10942 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10943 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10944 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10945 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10946 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10947 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10948 | 0 \ |
| 10949 | -s "found fragmented DTLS handshake message" \ |
| 10950 | -c "found fragmented DTLS handshake message" \ |
| 10951 | -C "error" |
| 10952 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10953 | # 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] | 10954 | only_with_valgrind |
| 10955 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10956 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10957 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10958 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10959 | -p "$P_PXY mtu=508" \ |
| 10960 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10961 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10962 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10963 | hs_timeout=250-10000" \ |
| 10964 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10965 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10966 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10967 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10968 | hs_timeout=250-10000" \ |
| 10969 | 0 \ |
| 10970 | -s "found fragmented DTLS handshake message" \ |
| 10971 | -c "found fragmented DTLS handshake message" \ |
| 10972 | -C "error" |
| 10973 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10974 | # 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] | 10975 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10976 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10977 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10978 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10979 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10980 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10982 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10983 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10984 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10985 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10986 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10987 | hs_timeout=10000-60000 \ |
| 10988 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10989 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10990 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10991 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10992 | hs_timeout=10000-60000 \ |
| 10993 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10994 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10995 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10996 | -s "found fragmented DTLS handshake message" \ |
| 10997 | -c "found fragmented DTLS handshake message" \ |
| 10998 | -C "error" |
| 10999 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11000 | # 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] | 11001 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 11002 | # OTOH the client might resend if the server is to slow to reset after sending |
| 11003 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11004 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11005 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11006 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11007 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11008 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11009 | -p "$P_PXY mtu=512" \ |
| 11010 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11011 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11012 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11013 | hs_timeout=10000-60000 \ |
| 11014 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11015 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11016 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11017 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11018 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11019 | hs_timeout=10000-60000 \ |
| 11020 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11021 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11022 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11023 | -s "found fragmented DTLS handshake message" \ |
| 11024 | -c "found fragmented DTLS handshake message" \ |
| 11025 | -C "error" |
| 11026 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11027 | not_with_valgrind # spurious autoreduction due to timeout |
| 11028 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11029 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11030 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11032 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11033 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11034 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11035 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11036 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11037 | hs_timeout=10000-60000 \ |
| 11038 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11039 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11040 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11041 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11042 | hs_timeout=10000-60000 \ |
| 11043 | mtu=1024 nbio=2" \ |
| 11044 | 0 \ |
| 11045 | -S "autoreduction" \ |
| 11046 | -s "found fragmented DTLS handshake message" \ |
| 11047 | -c "found fragmented DTLS handshake message" \ |
| 11048 | -C "error" |
| 11049 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11050 | # 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] | 11051 | not_with_valgrind # spurious autoreduction due to timeout |
| 11052 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11053 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11054 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11055 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 11056 | -p "$P_PXY mtu=512" \ |
| 11057 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11058 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11059 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11060 | hs_timeout=10000-60000 \ |
| 11061 | mtu=512 nbio=2" \ |
| 11062 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11063 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11064 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11065 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11066 | hs_timeout=10000-60000 \ |
| 11067 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11068 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11069 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11070 | -s "found fragmented DTLS handshake message" \ |
| 11071 | -c "found fragmented DTLS handshake message" \ |
| 11072 | -C "error" |
| 11073 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11074 | # 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] | 11075 | # This ensures things still work after session_reset(). |
| 11076 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11077 | # Since we don't support reading fragmented ClientHello yet, |
| 11078 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11079 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11080 | # An autoreduction on the client-side might happen if the server is |
| 11081 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11082 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11083 | # resumed listening, which would result in a spurious autoreduction. |
| 11084 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11086 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11087 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11088 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11089 | -p "$P_PXY mtu=1450" \ |
| 11090 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11091 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11092 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11093 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11094 | mtu=1450" \ |
| 11095 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11096 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11097 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11098 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11099 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11100 | 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] | 11101 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11102 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11103 | -s "found fragmented DTLS handshake message" \ |
| 11104 | -c "found fragmented DTLS handshake message" \ |
| 11105 | -C "error" |
| 11106 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11107 | # An autoreduction on the client-side might happen if the server is |
| 11108 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11109 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11110 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11111 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11112 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11113 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11114 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11115 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11116 | -p "$P_PXY mtu=512" \ |
| 11117 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11118 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11119 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11120 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11121 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11122 | mtu=512" \ |
| 11123 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11124 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11125 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11126 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11127 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11128 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11129 | mtu=512" \ |
| 11130 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11131 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11132 | -s "found fragmented DTLS handshake message" \ |
| 11133 | -c "found fragmented DTLS handshake message" \ |
| 11134 | -C "error" |
| 11135 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11136 | # An autoreduction on the client-side might happen if the server is |
| 11137 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11138 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11139 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11140 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11141 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11143 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11144 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11145 | -p "$P_PXY mtu=512" \ |
| 11146 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11147 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11148 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11149 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11150 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11151 | mtu=512" \ |
| 11152 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11153 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11154 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11155 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11156 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11157 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11158 | mtu=512" \ |
| 11159 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11160 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11161 | -s "found fragmented DTLS handshake message" \ |
| 11162 | -c "found fragmented DTLS handshake message" \ |
| 11163 | -C "error" |
| 11164 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11165 | # An autoreduction on the client-side might happen if the server is |
| 11166 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11167 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11168 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11169 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11170 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11172 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11173 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11174 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11175 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11176 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11177 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11178 | exchanges=2 renegotiation=1 \ |
| 11179 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11180 | hs_timeout=10000-60000 \ |
| 11181 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11182 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11183 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11184 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11185 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11186 | hs_timeout=10000-60000 \ |
| 11187 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11188 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11189 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11190 | -s "found fragmented DTLS handshake message" \ |
| 11191 | -c "found fragmented DTLS handshake message" \ |
| 11192 | -C "error" |
| 11193 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11194 | # An autoreduction on the client-side might happen if the server is |
| 11195 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11196 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11198 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11199 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11200 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11201 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11202 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11203 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11204 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11205 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11206 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11207 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11208 | exchanges=2 renegotiation=1 \ |
| 11209 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11210 | hs_timeout=10000-60000 \ |
| 11211 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11212 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11213 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11214 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11215 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11216 | hs_timeout=10000-60000 \ |
| 11217 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11218 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11219 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11220 | -s "found fragmented DTLS handshake message" \ |
| 11221 | -c "found fragmented DTLS handshake message" \ |
| 11222 | -C "error" |
| 11223 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11224 | # An autoreduction on the client-side might happen if the server is |
| 11225 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11226 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11228 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11229 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11230 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11231 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11232 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11233 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11234 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11235 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11236 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11237 | exchanges=2 renegotiation=1 \ |
| 11238 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11239 | hs_timeout=10000-60000 \ |
| 11240 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11241 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11242 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11243 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11244 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11245 | hs_timeout=10000-60000 \ |
| 11246 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11247 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11248 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11249 | -s "found fragmented DTLS handshake message" \ |
| 11250 | -c "found fragmented DTLS handshake message" \ |
| 11251 | -C "error" |
| 11252 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11253 | # 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] | 11254 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11255 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11256 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11257 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11258 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11259 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11260 | "$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] | 11261 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11262 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11263 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11264 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11265 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11266 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11267 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11268 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11269 | 0 \ |
| 11270 | -s "found fragmented DTLS handshake message" \ |
| 11271 | -c "found fragmented DTLS handshake message" \ |
| 11272 | -C "error" |
| 11273 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11274 | # 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] | 11275 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11276 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11277 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11278 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11279 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11280 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11281 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11282 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11283 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11284 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11285 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11286 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11287 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11288 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11289 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11290 | 0 \ |
| 11291 | -s "found fragmented DTLS handshake message" \ |
| 11292 | -c "found fragmented DTLS handshake message" \ |
| 11293 | -C "error" |
| 11294 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11295 | # interop tests for DTLS fragmentating with reliable connection |
| 11296 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11297 | # here and below we just want to test that the we fragment in a way that |
| 11298 | # pleases other implementations, so we don't need the peer to fragment |
| 11299 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11300 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11301 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11302 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11303 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11304 | "$G_SRV -u" \ |
| 11305 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11306 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11307 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11308 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11309 | 0 \ |
| 11310 | -c "fragmenting handshake message" \ |
| 11311 | -C "error" |
| 11312 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11313 | # We use --insecure for the GnuTLS client because it expects |
| 11314 | # the hostname / IP it connects to to be the name used in the |
| 11315 | # certificate obtained from the server. Here, however, it |
| 11316 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11317 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11318 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11319 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11320 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11321 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11322 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11323 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11324 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11325 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11326 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11327 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11328 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11329 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11330 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11331 | 0 \ |
| 11332 | -s "fragmenting handshake message" |
| 11333 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11334 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11335 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11336 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11337 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11338 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11339 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11340 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11341 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11342 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11343 | 0 \ |
| 11344 | -c "fragmenting handshake message" \ |
| 11345 | -C "error" |
| 11346 | |
| 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 client, DTLS 1.2" \ |
| 11351 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11352 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11353 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11354 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11355 | "$O_CLI -dtls1_2" \ |
| 11356 | 0 \ |
| 11357 | -s "fragmenting handshake message" |
| 11358 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11359 | # interop tests for DTLS fragmentating with unreliable connection |
| 11360 | # |
| 11361 | # again we just want to test that the we fragment in a way that |
| 11362 | # pleases other implementations, so we don't need the peer to fragment |
| 11363 | requires_gnutls_next |
| 11364 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11365 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11366 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11367 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11368 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11369 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11370 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11371 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11372 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11373 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11374 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11375 | 0 \ |
| 11376 | -c "fragmenting handshake message" \ |
| 11377 | -C "error" |
| 11378 | |
| 11379 | requires_gnutls_next |
| 11380 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11381 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11382 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11383 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11384 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11385 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11386 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11387 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11388 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11389 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11390 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11391 | 0 \ |
| 11392 | -s "fragmenting handshake message" |
| 11393 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11394 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11395 | ## 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] | 11396 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11397 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11398 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11399 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11400 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11401 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11402 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11403 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11404 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11405 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11406 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11407 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11408 | 0 \ |
| 11409 | -c "fragmenting handshake message" \ |
| 11410 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11411 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11412 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11413 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11414 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11415 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11416 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11417 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11418 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11419 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11420 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11421 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11422 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11423 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11424 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11425 | "$O_CLI -dtls1_2" \ |
| 11426 | 0 \ |
| 11427 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11428 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11429 | # Tests for DTLS-SRTP (RFC 5764) |
| 11430 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11432 | run_test "DTLS-SRTP all profiles supported" \ |
| 11433 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11434 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11435 | 0 \ |
| 11436 | -s "found use_srtp extension" \ |
| 11437 | -s "found srtp profile" \ |
| 11438 | -s "selected srtp profile" \ |
| 11439 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11440 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11441 | -c "client hello, adding use_srtp extension" \ |
| 11442 | -c "found use_srtp extension" \ |
| 11443 | -c "found srtp profile" \ |
| 11444 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11445 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11446 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11447 | -C "error" |
| 11448 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11449 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11450 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11452 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11453 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11454 | "$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] | 11455 | 0 \ |
| 11456 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11457 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11458 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11459 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11460 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11461 | -c "client hello, adding use_srtp extension" \ |
| 11462 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11463 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11464 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11465 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11466 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11467 | -C "error" |
| 11468 | |
| 11469 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11471 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11472 | "$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] | 11473 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11474 | 0 \ |
| 11475 | -s "found use_srtp extension" \ |
| 11476 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11477 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11478 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11479 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11480 | -c "client hello, adding use_srtp extension" \ |
| 11481 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11482 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11483 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11484 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11485 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11486 | -C "error" |
| 11487 | |
| 11488 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11490 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11491 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11492 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11493 | 0 \ |
| 11494 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11495 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11496 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11497 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11498 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11499 | -c "client hello, adding use_srtp extension" \ |
| 11500 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11501 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11502 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11503 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11504 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11505 | -C "error" |
| 11506 | |
| 11507 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11509 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11510 | "$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] | 11511 | "$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] | 11512 | 0 \ |
| 11513 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11514 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11515 | -S "selected srtp profile" \ |
| 11516 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11517 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11518 | -c "client hello, adding use_srtp extension" \ |
| 11519 | -C "found use_srtp extension" \ |
| 11520 | -C "found srtp profile" \ |
| 11521 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11522 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11523 | -C "error" |
| 11524 | |
| 11525 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11527 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11528 | "$P_SRV dtls=1 debug_level=3" \ |
| 11529 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11530 | 0 \ |
| 11531 | -s "found use_srtp extension" \ |
| 11532 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11533 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11534 | -c "client hello, adding use_srtp extension" \ |
| 11535 | -C "found use_srtp extension" \ |
| 11536 | -C "found srtp profile" \ |
| 11537 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11538 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11539 | -C "error" |
| 11540 | |
| 11541 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11543 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11544 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11545 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11546 | 0 \ |
| 11547 | -s "found use_srtp extension" \ |
| 11548 | -s "found srtp profile" \ |
| 11549 | -s "selected srtp profile" \ |
| 11550 | -s "server hello, adding use_srtp extension" \ |
| 11551 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11552 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11553 | -c "client hello, adding use_srtp extension" \ |
| 11554 | -c "found use_srtp extension" \ |
| 11555 | -c "found srtp profile" \ |
| 11556 | -c "selected srtp profile" \ |
| 11557 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11558 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11559 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11560 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11561 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11562 | -C "error" |
| 11563 | |
| 11564 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11566 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11567 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11568 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11569 | 0 \ |
| 11570 | -s "found use_srtp extension" \ |
| 11571 | -s "found srtp profile" \ |
| 11572 | -s "selected srtp profile" \ |
| 11573 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11574 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11575 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11576 | -S "dumping 'using mki' (8 bytes)" \ |
| 11577 | -c "client hello, adding use_srtp extension" \ |
| 11578 | -c "found use_srtp extension" \ |
| 11579 | -c "found srtp profile" \ |
| 11580 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11581 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11582 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11583 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11584 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11585 | -C "dumping 'received mki' (8 bytes)" \ |
| 11586 | -C "error" |
| 11587 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11588 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11590 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11591 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11592 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11593 | 0 \ |
| 11594 | -s "found use_srtp extension" \ |
| 11595 | -s "found srtp profile" \ |
| 11596 | -s "selected srtp profile" \ |
| 11597 | -s "server hello, adding use_srtp extension" \ |
| 11598 | -s "DTLS-SRTP key material is"\ |
| 11599 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11600 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11601 | |
| 11602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11604 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11605 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11606 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11607 | 0 \ |
| 11608 | -s "found use_srtp extension" \ |
| 11609 | -s "found srtp profile" \ |
| 11610 | -s "selected srtp profile" \ |
| 11611 | -s "server hello, adding use_srtp extension" \ |
| 11612 | -s "DTLS-SRTP key material is"\ |
| 11613 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11614 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11615 | |
| 11616 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11618 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11619 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11620 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11621 | 0 \ |
| 11622 | -s "found use_srtp extension" \ |
| 11623 | -s "found srtp profile" \ |
| 11624 | -s "selected srtp profile" \ |
| 11625 | -s "server hello, adding use_srtp extension" \ |
| 11626 | -s "DTLS-SRTP key material is"\ |
| 11627 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11628 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11629 | |
| 11630 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11632 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11633 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11634 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11635 | 0 \ |
| 11636 | -s "found use_srtp extension" \ |
| 11637 | -s "found srtp profile" \ |
| 11638 | -s "selected srtp profile" \ |
| 11639 | -s "server hello, adding use_srtp extension" \ |
| 11640 | -s "DTLS-SRTP key material is"\ |
| 11641 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11642 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11643 | |
| 11644 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11645 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11646 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11647 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11648 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11649 | 0 \ |
| 11650 | -s "found use_srtp extension" \ |
| 11651 | -s "found srtp profile" \ |
| 11652 | -s "selected srtp profile" \ |
| 11653 | -s "server hello, adding use_srtp extension" \ |
| 11654 | -s "DTLS-SRTP key material is"\ |
| 11655 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11656 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11657 | |
| 11658 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11660 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11661 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11662 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11663 | 0 \ |
| 11664 | -s "found use_srtp extension" \ |
| 11665 | -s "found srtp profile" \ |
| 11666 | -S "selected srtp profile" \ |
| 11667 | -S "server hello, adding use_srtp extension" \ |
| 11668 | -S "DTLS-SRTP key material is"\ |
| 11669 | -C "SRTP Extension negotiated, profile" |
| 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 doesn't support use_srtp extension. openssl client" \ |
| 11674 | "$P_SRV dtls=1 debug_level=3" \ |
| 11675 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11676 | 0 \ |
| 11677 | -s "found use_srtp extension" \ |
| 11678 | -S "server hello, adding use_srtp extension" \ |
| 11679 | -S "DTLS-SRTP key material is"\ |
| 11680 | -C "SRTP Extension negotiated, profile" |
| 11681 | |
| 11682 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11684 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11685 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11686 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11687 | 0 \ |
| 11688 | -c "client hello, adding use_srtp extension" \ |
| 11689 | -c "found use_srtp extension" \ |
| 11690 | -c "found srtp profile" \ |
| 11691 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11692 | -c "DTLS-SRTP key material is"\ |
| 11693 | -C "error" |
| 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 server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11698 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -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" \ |
| 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 one profile. openssl server." \ |
| 11711 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11712 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11713 | 0 \ |
| 11714 | -c "client hello, adding use_srtp extension" \ |
| 11715 | -c "found use_srtp extension" \ |
| 11716 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 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 one profile. Client supports all profiles. openssl server." \ |
| 11724 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11725 | "$P_CLI dtls=1 use_srtp=1 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 and Client support only one matching profile. 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 srtp_force_profile=2 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 different 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=6 debug_level=3" \ |
| 11752 | 0 \ |
| 11753 | -c "client hello, adding use_srtp extension" \ |
| 11754 | -C "found use_srtp extension" \ |
| 11755 | -C "found srtp profile" \ |
| 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 doesn't support use_srtp extension. openssl server" \ |
| 11763 | "$O_SRV -dtls" \ |
| 11764 | "$P_CLI dtls=1 use_srtp=1 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 all profiles supported. server doesn't support mki. openssl server." \ |
| 11776 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11777 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 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 "DTLS-SRTP no mki value negotiated"\ |
| 11785 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11786 | -C "dumping 'received mki' (8 bytes)" \ |
| 11787 | -C "error" |
| 11788 | |
| 11789 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11790 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11792 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11793 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11794 | "$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] | 11795 | 0 \ |
| 11796 | -s "found use_srtp extension" \ |
| 11797 | -s "found srtp profile" \ |
| 11798 | -s "selected srtp profile" \ |
| 11799 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11800 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11801 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11802 | |
| 11803 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11804 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11806 | 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] | 11807 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11808 | "$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] | 11809 | 0 \ |
| 11810 | -s "found use_srtp extension" \ |
| 11811 | -s "found srtp profile" \ |
| 11812 | -s "selected srtp profile" \ |
| 11813 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11814 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11815 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11816 | |
| 11817 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11818 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11820 | 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] | 11821 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11822 | "$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] | 11823 | 0 \ |
| 11824 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11825 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11826 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11827 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11828 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11829 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11830 | |
| 11831 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11832 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11834 | 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] | 11835 | "$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] | 11836 | "$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] | 11837 | 0 \ |
| 11838 | -s "found use_srtp extension" \ |
| 11839 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11840 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11841 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11842 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11843 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11844 | |
| 11845 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11846 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11848 | 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] | 11849 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11850 | "$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] | 11851 | 0 \ |
| 11852 | -s "found use_srtp extension" \ |
| 11853 | -s "found srtp profile" \ |
| 11854 | -s "selected srtp profile" \ |
| 11855 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11856 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11857 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11858 | |
| 11859 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11860 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11862 | 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] | 11863 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11864 | "$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] | 11865 | 0 \ |
| 11866 | -s "found use_srtp extension" \ |
| 11867 | -s "found srtp profile" \ |
| 11868 | -S "selected srtp profile" \ |
| 11869 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11870 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11871 | -C "SRTP profile:" |
| 11872 | |
| 11873 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11874 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11875 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11876 | 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] | 11877 | "$P_SRV dtls=1 debug_level=3" \ |
| 11878 | "$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] | 11879 | 0 \ |
| 11880 | -s "found use_srtp extension" \ |
| 11881 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11882 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11883 | -C "SRTP profile:" |
| 11884 | |
| 11885 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11886 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11888 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11889 | "$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" \ |
| 11890 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11891 | 0 \ |
| 11892 | -c "client hello, adding use_srtp extension" \ |
| 11893 | -c "found use_srtp extension" \ |
| 11894 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11895 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11896 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11897 | -C "error" |
| 11898 | |
| 11899 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11900 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11902 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11903 | "$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" \ |
| 11904 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11905 | 0 \ |
| 11906 | -c "client hello, adding use_srtp extension" \ |
| 11907 | -c "found use_srtp extension" \ |
| 11908 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11909 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11910 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11911 | -C "error" |
| 11912 | |
| 11913 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11914 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11916 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11917 | "$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" \ |
| 11918 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11919 | 0 \ |
| 11920 | -c "client hello, adding use_srtp extension" \ |
| 11921 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11922 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11923 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11924 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11925 | -C "error" |
| 11926 | |
| 11927 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11928 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11930 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11931 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11932 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11933 | 0 \ |
| 11934 | -c "client hello, adding use_srtp extension" \ |
| 11935 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11936 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11937 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11938 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11939 | -C "error" |
| 11940 | |
| 11941 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11942 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11944 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11945 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11946 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11947 | 0 \ |
| 11948 | -c "client hello, adding use_srtp extension" \ |
| 11949 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11950 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11951 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11952 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11953 | -C "error" |
| 11954 | |
| 11955 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11956 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11958 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11959 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11960 | "$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] | 11961 | 0 \ |
| 11962 | -c "client hello, adding use_srtp extension" \ |
| 11963 | -C "found use_srtp extension" \ |
| 11964 | -C "found srtp profile" \ |
| 11965 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11966 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11967 | -C "error" |
| 11968 | |
| 11969 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11970 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11972 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11973 | "$G_SRV -u" \ |
| 11974 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11975 | 0 \ |
| 11976 | -c "client hello, adding use_srtp extension" \ |
| 11977 | -C "found use_srtp extension" \ |
| 11978 | -C "found srtp profile" \ |
| 11979 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11980 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11981 | -C "error" |
| 11982 | |
| 11983 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11984 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11986 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11987 | "$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" \ |
| 11988 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11989 | 0 \ |
| 11990 | -c "client hello, adding use_srtp extension" \ |
| 11991 | -c "found use_srtp extension" \ |
| 11992 | -c "found srtp profile" \ |
| 11993 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11994 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11995 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11996 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11997 | -c "dumping 'received mki' (8 bytes)" \ |
| 11998 | -C "error" |
| 11999 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12000 | # Tests for specific things with "unreliable" UDP connection |
| 12001 | |
| 12002 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12004 | run_test "DTLS proxy: reference" \ |
| 12005 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12006 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 12007 | "$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] | 12008 | 0 \ |
| 12009 | -C "replayed record" \ |
| 12010 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 12011 | -C "Buffer record from epoch" \ |
| 12012 | -S "Buffer record from epoch" \ |
| 12013 | -C "ssl_buffer_message" \ |
| 12014 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 12015 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12016 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12017 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12018 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12019 | -c "HTTP/1.0 200 OK" |
| 12020 | |
| 12021 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12023 | run_test "DTLS proxy: duplicate every packet" \ |
| 12024 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12025 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 12026 | "$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] | 12027 | 0 \ |
| 12028 | -c "replayed record" \ |
| 12029 | -s "replayed record" \ |
| 12030 | -c "record from another epoch" \ |
| 12031 | -s "record from another epoch" \ |
| 12032 | -S "resend" \ |
| 12033 | -s "Extra-header:" \ |
| 12034 | -c "HTTP/1.0 200 OK" |
| 12035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12037 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 12038 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12039 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 12040 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12041 | 0 \ |
| 12042 | -c "replayed record" \ |
| 12043 | -S "replayed record" \ |
| 12044 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12045 | -s "record from another epoch" \ |
| 12046 | -c "resend" \ |
| 12047 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12048 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12049 | -c "HTTP/1.0 200 OK" |
| 12050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12052 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 12053 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12054 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12055 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12056 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12057 | -c "next record in same datagram" \ |
| 12058 | -s "next record in same datagram" |
| 12059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12061 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 12062 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12063 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12064 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12065 | 0 \ |
| 12066 | -c "next record in same datagram" \ |
| 12067 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12068 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12070 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12071 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12072 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12073 | "$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] | 12074 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12075 | -c "discarding invalid record (mac)" \ |
| 12076 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12077 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12078 | -c "HTTP/1.0 200 OK" \ |
| 12079 | -S "too many records with bad MAC" \ |
| 12080 | -S "Verification of the message MAC failed" |
| 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 | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12083 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 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 badmac_limit=1" \ |
| 12086 | "$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] | 12087 | 1 \ |
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 | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12090 | -S "Extra-header:" \ |
| 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 2" \ |
| 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=2" \ |
| 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 | 0 \ |
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, exchanges 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 exchanges=2" \ |
| 12112 | "$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] | 12113 | 1 \ |
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" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 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 | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12122 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12123 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12124 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12125 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12126 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12127 | -c "record from another epoch" \ |
| 12128 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12129 | -s "Extra-header:" \ |
| 12130 | -c "HTTP/1.0 200 OK" |
| 12131 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12132 | # Tests for reordering support with DTLS |
| 12133 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12134 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12136 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12137 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12138 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12139 | hs_timeout=2500-60000" \ |
| 12140 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12141 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12142 | 0 \ |
| 12143 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12144 | -c "Next handshake message has been buffered - load"\ |
| 12145 | -S "Buffering HS message" \ |
| 12146 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12147 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12148 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12149 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12150 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12151 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12152 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12154 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12155 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12156 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12157 | hs_timeout=2500-60000" \ |
| 12158 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12159 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12160 | 0 \ |
| 12161 | -c "Buffering HS message" \ |
| 12162 | -c "found fragmented DTLS handshake message"\ |
| 12163 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12164 | -c "Next handshake message has been buffered - load"\ |
| 12165 | -S "Buffering HS message" \ |
| 12166 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12167 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12168 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12169 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12170 | -S "Remember CCS message" |
| 12171 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12172 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12173 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12174 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12175 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12176 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12177 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12179 | 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] | 12180 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12181 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12182 | hs_timeout=2500-60000" \ |
| 12183 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12184 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12185 | 0 \ |
| 12186 | -c "Buffering HS message" \ |
| 12187 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12188 | -C "attempt to make space by freeing buffered messages" \ |
| 12189 | -S "Buffering HS message" \ |
| 12190 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12191 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12192 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12193 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12194 | -S "Remember CCS message" |
| 12195 | |
| 12196 | # The size constraints ensure that the delayed certificate message can't |
| 12197 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12198 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12199 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12200 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12201 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12203 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12204 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12205 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12206 | hs_timeout=2500-60000" \ |
| 12207 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12208 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12209 | 0 \ |
| 12210 | -c "Buffering HS message" \ |
| 12211 | -c "attempt to make space by freeing buffered future messages" \ |
| 12212 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12213 | -S "Buffering HS message" \ |
| 12214 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12215 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12216 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12217 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12218 | -S "Remember CCS message" |
| 12219 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12220 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12222 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12223 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12224 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12225 | hs_timeout=2500-60000" \ |
| 12226 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12227 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12228 | 0 \ |
| 12229 | -C "Buffering HS message" \ |
| 12230 | -C "Next handshake message has been buffered - load"\ |
| 12231 | -s "Buffering HS message" \ |
| 12232 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12233 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12234 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12235 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12236 | -S "Remember CCS message" |
| 12237 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12238 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12240 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12241 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12242 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12243 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12244 | hs_timeout=2500-60000" \ |
| 12245 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12246 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12247 | 0 \ |
| 12248 | -C "Buffering HS message" \ |
| 12249 | -C "Next handshake message has been buffered - load"\ |
| 12250 | -S "Buffering HS message" \ |
| 12251 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12252 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12253 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12254 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12255 | -S "Remember CCS message" |
| 12256 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12257 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12259 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12260 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12261 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12262 | hs_timeout=2500-60000" \ |
| 12263 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12264 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12265 | 0 \ |
| 12266 | -C "Buffering HS message" \ |
| 12267 | -C "Next handshake message has been buffered - load"\ |
| 12268 | -S "Buffering HS message" \ |
| 12269 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12270 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12271 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12272 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12273 | -s "Remember CCS message" |
| 12274 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12276 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12277 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12278 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12279 | hs_timeout=2500-60000" \ |
| 12280 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12281 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12282 | 0 \ |
| 12283 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12284 | -s "Found buffered record from current epoch - load" \ |
| 12285 | -c "Buffer record from epoch 1" \ |
| 12286 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12287 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12288 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12289 | # from the server are delayed, so that the encrypted Finished message |
| 12290 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12291 | # in afterwards, the encrypted Finished message must be freed in order |
| 12292 | # to make space for the NewSessionTicket to be reassembled. |
| 12293 | # This works only in very particular circumstances: |
| 12294 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12295 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12296 | # the encrypted Finished message. |
| 12297 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12298 | # needs to be fragmented. |
| 12299 | # - All messages sent by the server must be small enough to be either sent |
| 12300 | # without fragmentation or be reassembled within the bounds of |
| 12301 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12302 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12303 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12304 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12305 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12306 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12307 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12308 | "$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] | 12309 | 0 \ |
| 12310 | -s "Buffer record from epoch 1" \ |
| 12311 | -s "Found buffered record from current epoch - load" \ |
| 12312 | -c "Buffer record from epoch 1" \ |
| 12313 | -C "Found buffered record from current epoch - load" \ |
| 12314 | -c "Enough space available after freeing future epoch record" |
| 12315 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12316 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12317 | |
| 12318 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12319 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12320 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 78df617 | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 12321 | "$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] | 12322 | psk=73776f726466697368" \ |
| 12323 | "$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] | 12324 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12325 | 0 \ |
| 12326 | -s "Extra-header:" \ |
| 12327 | -c "HTTP/1.0 200 OK" |
| 12328 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12329 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12330 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12331 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12332 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12333 | "$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] | 12334 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12335 | 0 \ |
| 12336 | -s "Extra-header:" \ |
| 12337 | -c "HTTP/1.0 200 OK" |
| 12338 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12339 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12341 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12342 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12343 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12344 | "$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] | 12345 | 0 \ |
| 12346 | -s "Extra-header:" \ |
| 12347 | -c "HTTP/1.0 200 OK" |
| 12348 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12349 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12351 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12352 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12353 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12354 | "$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] | 12355 | 0 \ |
| 12356 | -s "Extra-header:" \ |
| 12357 | -c "HTTP/1.0 200 OK" |
| 12358 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12359 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12361 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12362 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12363 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12364 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12365 | "$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] | 12366 | 0 \ |
| 12367 | -s "Extra-header:" \ |
| 12368 | -c "HTTP/1.0 200 OK" |
| 12369 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12370 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12372 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12373 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12374 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12375 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12376 | "$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] | 12377 | 0 \ |
| 12378 | -s "Extra-header:" \ |
| 12379 | -c "HTTP/1.0 200 OK" |
| 12380 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12381 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12383 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12384 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12385 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12386 | "$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] | 12387 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12388 | "$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] | 12389 | 0 \ |
| 12390 | -s "Extra-header:" \ |
| 12391 | -c "HTTP/1.0 200 OK" |
| 12392 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12393 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12394 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12395 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12396 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12397 | "$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] | 12398 | psk=73776f726466697368 debug_level=3" \ |
| 12399 | "$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] | 12400 | 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] | 12401 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12402 | 0 \ |
| 12403 | -s "a session has been resumed" \ |
| 12404 | -c "a session has been resumed" \ |
| 12405 | -s "Extra-header:" \ |
| 12406 | -c "HTTP/1.0 200 OK" |
| 12407 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12408 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12409 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12410 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12411 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12412 | "$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] | 12413 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12414 | "$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] | 12415 | 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] | 12416 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12417 | 0 \ |
| 12418 | -s "a session has been resumed" \ |
| 12419 | -c "a session has been resumed" \ |
| 12420 | -s "Extra-header:" \ |
| 12421 | -c "HTTP/1.0 200 OK" |
| 12422 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12423 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12425 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12426 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12427 | "$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] | 12428 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12429 | "$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] | 12430 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12431 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12432 | 0 \ |
| 12433 | -c "=> renegotiate" \ |
| 12434 | -s "=> renegotiate" \ |
| 12435 | -s "Extra-header:" \ |
| 12436 | -c "HTTP/1.0 200 OK" |
| 12437 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12438 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12440 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12441 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12442 | "$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] | 12443 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12444 | "$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] | 12445 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12446 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12447 | 0 \ |
| 12448 | -c "=> renegotiate" \ |
| 12449 | -s "=> renegotiate" \ |
| 12450 | -s "Extra-header:" \ |
| 12451 | -c "HTTP/1.0 200 OK" |
| 12452 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12453 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12455 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12456 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12457 | "$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] | 12458 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12459 | debug_level=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12460 | "$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] | 12461 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12462 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12463 | 0 \ |
| 12464 | -c "=> renegotiate" \ |
| 12465 | -s "=> renegotiate" \ |
| 12466 | -s "Extra-header:" \ |
| 12467 | -c "HTTP/1.0 200 OK" |
| 12468 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12469 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12471 | 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] | 12472 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12473 | "$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] | 12474 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12475 | debug_level=2 nbio=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12476 | "$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] | 12477 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12478 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12479 | 0 \ |
| 12480 | -c "=> renegotiate" \ |
| 12481 | -s "=> renegotiate" \ |
| 12482 | -s "Extra-header:" \ |
| 12483 | -c "HTTP/1.0 200 OK" |
| 12484 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12485 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12486 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12487 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12488 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12489 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12490 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12492 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12493 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12494 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12495 | "$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] | 12496 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12497 | -c "HTTP/1.0 200 OK" |
| 12498 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12499 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12500 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12501 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12503 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12504 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12505 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12506 | "$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] | 12507 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12508 | -c "HTTP/1.0 200 OK" |
| 12509 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12510 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12511 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12512 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12514 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12515 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12516 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12517 | "$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] | 12518 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12519 | -c "HTTP/1.0 200 OK" |
| 12520 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12521 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12522 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12523 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12525 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12526 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12527 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12528 | "$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] | 12529 | 0 \ |
| 12530 | -s "Extra-header:" \ |
| 12531 | -c "Extra-header:" |
| 12532 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12533 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12534 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12535 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12537 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12538 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12539 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12540 | "$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] | 12541 | 0 \ |
| 12542 | -s "Extra-header:" \ |
| 12543 | -c "Extra-header:" |
| 12544 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12545 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12546 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12547 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12549 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12550 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12551 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12552 | "$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] | 12553 | 0 \ |
| 12554 | -s "Extra-header:" \ |
| 12555 | -c "Extra-header:" |
| 12556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12558 | run_test "export keys functionality" \ |
| 12559 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12560 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12561 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12562 | -c "EAP-TLS key material is:"\ |
| 12563 | -s "EAP-TLS key material is:"\ |
| 12564 | -c "EAP-TLS IV is:" \ |
| 12565 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12566 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12567 | # openssl feature tests: check if tls1.3 exists. |
| 12568 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12569 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12570 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12571 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12572 | 0 \ |
| 12573 | -c "TLS 1.3" \ |
| 12574 | -s "TLS 1.3" |
| 12575 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12576 | # 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] | 12577 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12578 | requires_gnutls_next_no_ticket |
| 12579 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12580 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12581 | "$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] | 12582 | "$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] | 12583 | 0 \ |
| 12584 | -s "Version: TLS1.3" \ |
| 12585 | -c "Version: TLS1.3" |
| 12586 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12587 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12589 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12590 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12591 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12592 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12593 | run_test "TLS 1.3: Default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12594 | "$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] | 12595 | "$P_CLI allow_sha1=0" \ |
| 12596 | 0 \ |
| 12597 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12598 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12599 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12600 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12601 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12604 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12605 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12606 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12607 | "$P_SRV" \ |
| 12608 | "( $P_CLI force_version=tls12; \ |
| 12609 | $P_CLI force_version=tls13 )" \ |
| 12610 | 0 \ |
| 12611 | -s "Protocol is TLSv1.2" \ |
| 12612 | -s "Protocol is TLSv1.3" \ |
| 12613 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12616 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12617 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12618 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12619 | "$P_SRV" \ |
| 12620 | "( $P_CLI force_version=tls13; \ |
| 12621 | $P_CLI force_version=tls12 )" \ |
| 12622 | 0 \ |
| 12623 | -s "Protocol is TLSv1.3" \ |
| 12624 | -s "Protocol is TLSv1.2" \ |
| 12625 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12626 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12627 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12628 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12629 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12630 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12631 | "$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] | 12632 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12633 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12634 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12635 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12636 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12637 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12638 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12639 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12640 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12641 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12642 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12643 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12644 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12645 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12646 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12647 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12648 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12649 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12650 | -c "=> parse certificate verify" \ |
| 12651 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12652 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12653 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12654 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12655 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12656 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12657 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12658 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12659 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12660 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12661 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12662 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12663 | "$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] | 12664 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12665 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12666 | -s "SERVER HELLO was queued" \ |
| 12667 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12668 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12669 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12670 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12671 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12672 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12673 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12674 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12675 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12676 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12677 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12678 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12679 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12680 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12681 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12682 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12683 | -c "=> parse certificate verify" \ |
| 12684 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12685 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12686 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12687 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12688 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12689 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12690 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12691 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12692 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12693 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12694 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12695 | run_test "TLS 1.3: alpn - openssl" \ |
| 12696 | "$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] | 12697 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12698 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12699 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12700 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12701 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12702 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12703 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12704 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12705 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12706 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12707 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12708 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12709 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12710 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12711 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12712 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12713 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12714 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12715 | -c "=> parse certificate verify" \ |
| 12716 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12717 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12718 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12719 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12720 | -c "HTTP/1.0 200 ok" \ |
| 12721 | -c "Application Layer Protocol is h2" |
| 12722 | |
| 12723 | requires_gnutls_tls1_3 |
| 12724 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12725 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12726 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12727 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12728 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12729 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12730 | "$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] | 12731 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12732 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12733 | -s "SERVER HELLO was queued" \ |
| 12734 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12735 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12736 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12737 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12738 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12739 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12740 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12741 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12742 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12743 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12744 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12745 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12746 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12747 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12748 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12749 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12750 | -c "=> parse certificate verify" \ |
| 12751 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12752 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12753 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12754 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12755 | -c "HTTP/1.0 200 OK" \ |
| 12756 | -c "Application Layer Protocol is h2" |
| 12757 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12758 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12759 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12760 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12761 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12762 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12763 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12764 | "$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] | 12765 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12766 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12767 | -s "found alpn extension" \ |
| 12768 | -s "server side, adding alpn extension" \ |
| 12769 | -s "Protocol is TLSv1.3" \ |
| 12770 | -s "HTTP/1.0 200 OK" \ |
| 12771 | -s "Application Layer Protocol is h2" |
| 12772 | |
| 12773 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12774 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12775 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12776 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12777 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12778 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12779 | "$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] | 12780 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12781 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12782 | -s "found alpn extension" \ |
| 12783 | -s "server side, adding alpn extension" \ |
| 12784 | -s "Protocol is TLSv1.3" \ |
| 12785 | -s "HTTP/1.0 200 OK" \ |
| 12786 | -s "Application Layer Protocol is h2" |
| 12787 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12788 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12789 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12790 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12791 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12792 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12793 | "$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] | 12794 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12795 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12796 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12797 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12798 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12799 | -c "HTTP/1.0 200 ok" \ |
| 12800 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12801 | |
| 12802 | requires_gnutls_tls1_3 |
| 12803 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12804 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12805 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12806 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12807 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12808 | "$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] | 12809 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12810 | 0 \ |
| 12811 | -c "got a certificate request" \ |
| 12812 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12813 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12814 | -c "HTTP/1.0 200 OK" \ |
| 12815 | -c "Protocol is TLSv1.3" |
| 12816 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12817 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12818 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12819 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12820 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12821 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12822 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12823 | "$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] | 12824 | "$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] | 12825 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12826 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12827 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12828 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12829 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12830 | |
| 12831 | requires_gnutls_tls1_3 |
| 12832 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12833 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12834 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12835 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12836 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12837 | "$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] | 12838 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12839 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12840 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12841 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12842 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12843 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12844 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12845 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12846 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12847 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12848 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12849 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12850 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12851 | "$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] | 12852 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12853 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12854 | 0 \ |
| 12855 | -c "got a certificate request" \ |
| 12856 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12857 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12858 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12859 | |
| 12860 | requires_gnutls_tls1_3 |
| 12861 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12862 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12863 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12864 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12865 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12866 | "$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] | 12867 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12868 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12869 | 0 \ |
| 12870 | -c "got a certificate request" \ |
| 12871 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12872 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12873 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12874 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12875 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12876 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12877 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12878 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12879 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12880 | "$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] | 12881 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12882 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12883 | 0 \ |
| 12884 | -c "got a certificate request" \ |
| 12885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12886 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12887 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12888 | |
| 12889 | requires_gnutls_tls1_3 |
| 12890 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12891 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12892 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12893 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12894 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12895 | "$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] | 12896 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12897 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12898 | 0 \ |
| 12899 | -c "got a certificate request" \ |
| 12900 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12901 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12902 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12903 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12904 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12905 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12907 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12908 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12909 | "$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] | 12910 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12911 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12912 | 0 \ |
| 12913 | -c "got a certificate request" \ |
| 12914 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12916 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12917 | |
| 12918 | requires_gnutls_tls1_3 |
| 12919 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12922 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12923 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12924 | "$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] | 12925 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12926 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12927 | 0 \ |
| 12928 | -c "got a certificate request" \ |
| 12929 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12930 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12931 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12932 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12933 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12934 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12935 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12936 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12937 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12938 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12939 | "$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] | 12940 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12941 | 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] | 12942 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12943 | -c "got a certificate request" \ |
| 12944 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12945 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12946 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12947 | |
| 12948 | requires_gnutls_tls1_3 |
| 12949 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12950 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12951 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12952 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12953 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12954 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12955 | "$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] | 12956 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12957 | 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] | 12958 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12959 | -c "got a certificate request" \ |
| 12960 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12961 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12962 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12963 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12964 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12965 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12966 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12967 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12968 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12969 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12970 | "$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] | 12971 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12972 | 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] | 12973 | 0 \ |
| 12974 | -c "got a certificate request" \ |
| 12975 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12976 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12977 | -c "Protocol is TLSv1.3" |
| 12978 | |
| 12979 | requires_gnutls_tls1_3 |
| 12980 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12981 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12982 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12983 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12984 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12985 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12986 | "$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] | 12987 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12988 | 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] | 12989 | 0 \ |
| 12990 | -c "got a certificate request" \ |
| 12991 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12992 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12993 | -c "Protocol is TLSv1.3" |
| 12994 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12995 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12996 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12997 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12998 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12999 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13000 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 13001 | "$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] | 13002 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13003 | 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] | 13004 | 0 \ |
| 13005 | -c "got a certificate request" \ |
| 13006 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13007 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13008 | -c "Protocol is TLSv1.3" |
| 13009 | |
| 13010 | requires_gnutls_tls1_3 |
| 13011 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13012 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13013 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13014 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13015 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13016 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 13017 | "$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] | 13018 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13019 | 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] | 13020 | 0 \ |
| 13021 | -c "got a certificate request" \ |
| 13022 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13023 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13024 | -c "Protocol is TLSv1.3" |
| 13025 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13026 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13027 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13028 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13029 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13030 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 13031 | 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] | 13032 | "$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] | 13033 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13034 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13035 | 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] | 13036 | 1 \ |
| 13037 | -c "got a certificate request" \ |
| 13038 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13039 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13040 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13041 | |
| 13042 | requires_gnutls_tls1_3 |
| 13043 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13044 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13045 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13046 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13047 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13048 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13049 | "$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] | 13050 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13051 | 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] | 13052 | 1 \ |
| 13053 | -c "got a certificate request" \ |
| 13054 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13055 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13056 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13057 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13058 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13059 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13060 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13061 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13062 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13064 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13065 | "$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] | 13066 | "$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] | 13067 | 0 \ |
| 13068 | -c "got a certificate request" \ |
| 13069 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13070 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13071 | -c "Protocol is TLSv1.3" |
| 13072 | |
| 13073 | requires_gnutls_tls1_3 |
| 13074 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13075 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13076 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13077 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13078 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13079 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13080 | "$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] | 13081 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13082 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13083 | 0 \ |
| 13084 | -c "got a certificate request" \ |
| 13085 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13086 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13087 | -c "Protocol is TLSv1.3" |
| 13088 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13089 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13090 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13091 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13092 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13093 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13094 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 13095 | "$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] | 13096 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13097 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13098 | 0 \ |
| 13099 | -c "got a certificate request" \ |
| 13100 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13101 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13102 | -c "Protocol is TLSv1.3" |
| 13103 | |
| 13104 | requires_gnutls_tls1_3 |
| 13105 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13106 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13107 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13108 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13109 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13110 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13111 | "$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] | 13112 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13113 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13114 | 0 \ |
| 13115 | -c "got a certificate request" \ |
| 13116 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13117 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13118 | -c "Protocol is TLSv1.3" |
| 13119 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13120 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13121 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13122 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13123 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13124 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13125 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13126 | "$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] | 13127 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13128 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13129 | 0 \ |
| 13130 | -c "got a certificate request" \ |
| 13131 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13132 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13133 | -c "Protocol is TLSv1.3" |
| 13134 | |
| 13135 | requires_gnutls_tls1_3 |
| 13136 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13137 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13138 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13139 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13140 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13141 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13142 | "$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] | 13143 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13144 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13145 | 0 \ |
| 13146 | -c "got a certificate request" \ |
| 13147 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13148 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13149 | -c "Protocol is TLSv1.3" |
| 13150 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13151 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13152 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13153 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13154 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13156 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13157 | "$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] | 13158 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13159 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13160 | 0 \ |
| 13161 | -c "got a certificate request" \ |
| 13162 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13163 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13164 | -c "Protocol is TLSv1.3" |
| 13165 | |
| 13166 | requires_gnutls_tls1_3 |
| 13167 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13168 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13169 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13170 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13171 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13172 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13173 | "$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] | 13174 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13175 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13176 | 0 \ |
| 13177 | -c "got a certificate request" \ |
| 13178 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13179 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13180 | -c "Protocol is TLSv1.3" |
| 13181 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13182 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13183 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13184 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13185 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13186 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13187 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13188 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13189 | "$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] | 13190 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13191 | 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] | 13192 | 0 \ |
| 13193 | -c "got a certificate request" \ |
| 13194 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13195 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13196 | -c "Protocol is TLSv1.3" |
| 13197 | |
| 13198 | requires_gnutls_tls1_3 |
| 13199 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13201 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13202 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13203 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13204 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13205 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13206 | "$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] | 13207 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13208 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13209 | 0 \ |
| 13210 | -c "got a certificate request" \ |
| 13211 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13212 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13213 | -c "Protocol is TLSv1.3" |
| 13214 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13215 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13216 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13217 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13218 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13219 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13220 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13221 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13222 | "$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] | 13223 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13224 | 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] | 13225 | 0 \ |
| 13226 | -c "got a certificate request" \ |
| 13227 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13228 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13229 | -c "Protocol is TLSv1.3" |
| 13230 | |
| 13231 | requires_gnutls_tls1_3 |
| 13232 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13233 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13234 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13235 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13236 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13238 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13239 | "$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] | 13240 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13241 | 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] | 13242 | 0 \ |
| 13243 | -c "got a certificate request" \ |
| 13244 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13245 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13246 | -c "Protocol is TLSv1.3" |
| 13247 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13248 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13249 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13250 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13251 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13252 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13253 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13254 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13255 | "$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] | 13256 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13257 | 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] | 13258 | 0 \ |
| 13259 | -c "got a certificate request" \ |
| 13260 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13261 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13262 | -c "Protocol is TLSv1.3" |
| 13263 | |
| 13264 | requires_gnutls_tls1_3 |
| 13265 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13266 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13268 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13269 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13270 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13271 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13272 | "$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] | 13273 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13274 | 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] | 13275 | 0 \ |
| 13276 | -c "got a certificate request" \ |
| 13277 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13278 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13279 | -c "Protocol is TLSv1.3" |
| 13280 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13281 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13284 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13286 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13287 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13288 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13289 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13290 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13291 | 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] | 13292 | 1 \ |
| 13293 | -c "got a certificate request" \ |
| 13294 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13295 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13296 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13297 | |
| 13298 | requires_gnutls_tls1_3 |
| 13299 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13300 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13302 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13303 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13304 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13305 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13306 | "$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] | 13307 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13308 | 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] | 13309 | 1 \ |
| 13310 | -c "got a certificate request" \ |
| 13311 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13312 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13313 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13314 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13315 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13316 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13317 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13318 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13319 | 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] | 13320 | "$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] | 13321 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13322 | 0 \ |
| 13323 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13324 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13325 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13326 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13327 | -c "HTTP/1.0 200 ok" |
| 13328 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13329 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13330 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13331 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13332 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13333 | 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] | 13334 | "$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] | 13335 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13336 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13337 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13338 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13339 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13340 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13341 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13342 | |
| 13343 | requires_gnutls_tls1_3 |
| 13344 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13345 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13346 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13347 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13348 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13349 | 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] | 13350 | "$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] | 13351 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13352 | 0 \ |
| 13353 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13354 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13355 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13356 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13357 | -c "HTTP/1.0 200 OK" |
| 13358 | |
| 13359 | requires_gnutls_tls1_3 |
| 13360 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13361 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13362 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13363 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13364 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13365 | 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] | 13366 | "$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] | 13367 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13368 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13369 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13370 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13371 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13372 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13373 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13374 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13375 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13376 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13377 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13378 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13379 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13380 | "$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] | 13381 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13382 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13383 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13384 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13385 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13386 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13387 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13388 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13389 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13390 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13391 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13392 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13393 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13394 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13395 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13396 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13397 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13398 | "$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] | 13399 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13400 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13401 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13402 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13403 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13404 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13405 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13406 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13407 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13408 | -s "=> parse client hello" \ |
| 13409 | -s "<= parse client hello" |
| 13410 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13411 | requires_gnutls_tls1_3 |
| 13412 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13413 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13414 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13415 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13416 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13417 | "$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] | 13418 | "$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] | 13419 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13420 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13421 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13422 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13423 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13424 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13425 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13426 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13427 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13428 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13429 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13430 | requires_gnutls_tls1_3 |
| 13431 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13432 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13433 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13434 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13435 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13436 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13437 | "$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] | 13438 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13439 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13440 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13441 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13442 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13443 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13444 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13445 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13446 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13447 | -s "=> parse client hello" \ |
| 13448 | -s "<= parse client hello" |
| 13449 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13450 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13451 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13452 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13453 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13454 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13455 | "$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] | 13456 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13457 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13458 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13459 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13460 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13461 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13462 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13463 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13464 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13465 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13466 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13467 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13468 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13469 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13470 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13471 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13472 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13473 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13474 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13475 | "$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] | 13476 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13477 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13478 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13479 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13480 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13481 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13482 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13483 | -s "=> parse client hello" \ |
| 13484 | -s "<= parse client hello" |
| 13485 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13486 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13487 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13488 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13489 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13490 | 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] | 13491 | "$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] | 13492 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13493 | 1 \ |
| 13494 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13495 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13496 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13497 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13498 | -s "=> write certificate request" \ |
| 13499 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13500 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13501 | -s "=> parse client hello" \ |
| 13502 | -s "<= parse client hello" |
| 13503 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13505 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13506 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13507 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13508 | 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] | 13509 | "$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] | 13510 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13511 | 0 \ |
| 13512 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13513 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13514 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13515 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13516 | -s "=> write certificate request" \ |
| 13517 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13518 | -s "=> parse client hello" \ |
| 13519 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13520 | |
| 13521 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13522 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13523 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13524 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13525 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13526 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13527 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13528 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13529 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13530 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13531 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13532 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13533 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13534 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13535 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13536 | -s "=> write hello retry request" \ |
| 13537 | -s "<= write hello retry request" |
| 13538 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13539 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13540 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13541 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13542 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13543 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13544 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13545 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13546 | 1 \ |
| 13547 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13548 | -s "No certificate available." |
| 13549 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13550 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13551 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13552 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13553 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13554 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13555 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13556 | 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,-,-,-" \ |
| 13557 | "$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] | 13558 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13559 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13560 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13561 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13562 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13563 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13564 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13565 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13566 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13567 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13568 | 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,-,-,-" \ |
| 13569 | "$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] | 13570 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13571 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13572 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13573 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13574 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13575 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13576 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13577 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13578 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13579 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13580 | 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,-,-,-" \ |
| 13581 | "$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] | 13582 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13583 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13584 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13585 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13586 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13587 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13588 | TEST_SUITE_NAME=${i##*/} |
| 13589 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13590 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13591 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13592 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13593 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13594 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13595 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13596 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13597 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13598 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13599 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13600 | 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] | 13601 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13602 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13603 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13604 | -s "Protocol is TLSv1.3" \ |
| 13605 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13606 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13607 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13608 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13610 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13611 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13612 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13613 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13614 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13615 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13616 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13617 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13618 | -s "Protocol is TLSv1.3" \ |
| 13619 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13620 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13621 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13622 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13623 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13624 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13625 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13626 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13627 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13628 | 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] | 13629 | "$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] | 13630 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13631 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13632 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13633 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13634 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 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 server with middlebox compat support, not client" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13642 | "$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] | 13643 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13644 | 0 \ |
| 13645 | -c "Protocol is TLSv1.3" \ |
| 13646 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13647 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13648 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13649 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13650 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13651 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13652 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13653 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13654 | "$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] | 13655 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13656 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13657 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13658 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13659 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13660 | requires_gnutls_tls1_3 |
| 13661 | requires_gnutls_next_no_ticket |
| 13662 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13663 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13664 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13665 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13666 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13667 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13668 | "$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] | 13669 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13670 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13671 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13672 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13673 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13674 | |
| 13675 | requires_gnutls_tls1_3 |
| 13676 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13677 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13678 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13679 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13680 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13681 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13682 | "$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] | 13683 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13684 | 0 \ |
| 13685 | -c "Protocol is TLSv1.3" \ |
| 13686 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13687 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13688 | requires_gnutls_tls1_3 |
| 13689 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13690 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13691 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13692 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13693 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13694 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 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" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13697 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13698 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13699 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13700 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13701 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13702 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13703 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13704 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13705 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13706 | 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] | 13707 | "$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] | 13708 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13709 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13710 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13711 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13712 | -C "14 03 03 00 01" |
| 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_enabled MBEDTLS_DEBUG_C |
| 13716 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13717 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 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 server with middlebox compat support, not client" \ |
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 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13726 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13727 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13728 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13729 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13730 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13731 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13732 | "$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] | 13733 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13734 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13735 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13736 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13737 | -c "14 03 03 00 01" |
| 13738 | |
| 13739 | requires_gnutls_tls1_3 |
| 13740 | requires_gnutls_next_no_ticket |
| 13741 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13742 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13743 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13744 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13745 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13746 | 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] | 13747 | "$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] | 13748 | "$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] | 13749 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13750 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13751 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13752 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13753 | |
| 13754 | requires_gnutls_tls1_3 |
| 13755 | requires_gnutls_next_no_ticket |
| 13756 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13757 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13758 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13759 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13760 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13761 | 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] | 13762 | "$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] | 13763 | "$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] | 13764 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13765 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13766 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13767 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13768 | -c "discarding change cipher spec in TLS1.3" |
| 13769 | |
| 13770 | requires_gnutls_tls1_3 |
| 13771 | requires_gnutls_next_no_ticket |
| 13772 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13773 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13774 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13775 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13776 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13777 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13778 | "$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] | 13779 | "$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] | 13780 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13781 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13782 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13783 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13784 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13785 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13786 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13787 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13788 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 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 m->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13791 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13792 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
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 | -c "Protocol is TLSv1.3" \ |
| 13796 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13797 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13798 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13799 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13800 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13801 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13802 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13803 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13804 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13805 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13806 | 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] | 13807 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13808 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13809 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13810 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13811 | -c "Protocol is TLSv1.3" \ |
| 13812 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13813 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13814 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13815 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13816 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13817 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13818 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13819 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13820 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13821 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13822 | "$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] | 13823 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13824 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13825 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13826 | -c "received HelloRetryRequest message" \ |
| 13827 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13828 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13829 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13830 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13831 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13832 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13833 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13834 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13835 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13836 | "$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] | 13837 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13838 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13839 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13840 | -c "Protocol is TLSv1.3" \ |
| 13841 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 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_enabled MBEDTLS_DEBUG_C |
| 13845 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13846 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 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 both with middlebox compat support" \ |
| 13849 | "$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] | 13850 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13851 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13852 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13853 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13854 | |
| 13855 | requires_gnutls_tls1_3 |
| 13856 | requires_gnutls_next_no_ticket |
| 13857 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13858 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13859 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13860 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13861 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13862 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13863 | "$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] | 13864 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13865 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13866 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13867 | -c "received HelloRetryRequest message" \ |
| 13868 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13869 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13870 | |
| 13871 | requires_gnutls_tls1_3 |
| 13872 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13873 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13874 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13875 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13876 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13877 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13878 | "$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] | 13879 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13880 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13881 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13882 | -c "Protocol is TLSv1.3" \ |
| 13883 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13884 | |
| 13885 | requires_gnutls_tls1_3 |
| 13886 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13887 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13888 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13889 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13890 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13891 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13892 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13893 | "$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] | 13894 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13895 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13896 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13897 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13898 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13899 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13900 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13901 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13902 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13903 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13904 | 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] | 13905 | "$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] | 13906 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13907 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13908 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13909 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13910 | -C "14 03 03 00 01" |
| 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_enabled MBEDTLS_DEBUG_C |
| 13914 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13915 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 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 server with middlebox compat support, not client" \ |
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 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13924 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13925 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13926 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13927 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13928 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13929 | 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] | 13930 | "$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] | 13931 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13932 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13933 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13934 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13935 | -c "14 03 03 00 01" |
| 13936 | |
| 13937 | requires_gnutls_tls1_3 |
| 13938 | requires_gnutls_next_no_ticket |
| 13939 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13940 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13941 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13942 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13943 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13944 | 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] | 13945 | "$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] | 13946 | "$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] | 13947 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13948 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13949 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13950 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13951 | |
| 13952 | requires_gnutls_tls1_3 |
| 13953 | requires_gnutls_next_no_ticket |
| 13954 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13956 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13957 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13958 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13959 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13960 | 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] | 13961 | "$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] | 13962 | "$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] | 13963 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13964 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13965 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13966 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13967 | -c "discarding change cipher spec in TLS1.3" |
| 13968 | |
| 13969 | requires_gnutls_tls1_3 |
| 13970 | requires_gnutls_next_no_ticket |
| 13971 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13972 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13973 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13974 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13975 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13976 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13977 | 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] | 13978 | "$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] | 13979 | "$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] | 13980 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13981 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13982 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13983 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13984 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13985 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13986 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13987 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13988 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13989 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13990 | "$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] | 13991 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13992 | -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] | 13993 | "$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] | 13994 | 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] | 13995 | 0 \ |
| 13996 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13997 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13998 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13999 | |
| 14000 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14001 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14002 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14003 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14004 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14005 | "$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] | 14006 | -d 4 |
| 14007 | --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] | 14008 | "$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] | 14009 | 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] | 14010 | 0 \ |
| 14011 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14012 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14013 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14014 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14015 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14016 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14017 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14018 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14019 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14020 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14021 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14022 | 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] | 14023 | 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] | 14024 | "$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] | 14025 | 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] | 14026 | 0 \ |
| 14027 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14028 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14029 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14030 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14031 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14032 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14033 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14034 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14035 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14036 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14037 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14038 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14039 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14040 | 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] | 14041 | 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] | 14042 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14043 | -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] | 14044 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14045 | 0 \ |
| 14046 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14047 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14048 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14049 | |
| 14050 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14051 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14052 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14053 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14054 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14055 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14056 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14057 | 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] | 14058 | 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] | 14059 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14060 | --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] | 14061 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14062 | 0 \ |
| 14063 | -c "Negotiated version: 3.4" \ |
| 14064 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14065 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14066 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14067 | |
| 14068 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14069 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14070 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14071 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14072 | 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] | 14073 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14074 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14075 | 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] | 14076 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14077 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14078 | --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] | 14079 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14080 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14081 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14082 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14083 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14084 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14085 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14086 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14087 | 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] | 14088 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14089 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14090 | 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] | 14091 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14092 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14093 | -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] | 14094 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14095 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14096 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14097 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14098 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14099 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14100 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14101 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14102 | 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] | 14103 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14104 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14105 | 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] | 14106 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14107 | "$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] | 14108 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14109 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14110 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14111 | |
| 14112 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14113 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14114 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14115 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14116 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14117 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14118 | 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] | 14119 | 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] | 14120 | "$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] | 14121 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14122 | 1 \ |
| 14123 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14124 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14125 | requires_openssl_tls1_3_with_compatible_ephemeral |
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, O->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 | "$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] | 14134 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14135 | 1 \ |
| 14136 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14137 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14138 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14139 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14140 | requires_config_enabled MBEDTLS_SSL_CLI_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, m->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 " \ |
| 14146 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14147 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14148 | 1 \ |
| 14149 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14150 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14151 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14152 | requires_config_enabled MBEDTLS_DEBUG_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 client no signature algorithm, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14156 | "$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] | 14157 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14158 | -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] | 14159 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14160 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14161 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14162 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14163 | |
| 14164 | requires_gnutls_tls1_3 |
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->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14169 | "$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] | 14170 | -d 4 |
| 14171 | --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] | 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 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14177 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14178 | requires_config_enabled MBEDTLS_SSL_SRV_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->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14182 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14183 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14184 | 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] | 14185 | 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] | 14186 | "$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] | 14187 | 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] | 14188 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14189 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14190 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14191 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14193 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14194 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14195 | 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] | 14196 | "$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] | 14197 | -msg -tls1_2 |
| 14198 | -Verify 10 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14199 | "$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] | 14200 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14201 | min_version=tls12 max_version=tls13 " \ |
| 14202 | 0 \ |
| 14203 | -c "Protocol is TLSv1.2" \ |
| 14204 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14205 | |
| 14206 | |
| 14207 | requires_gnutls_tls1_3 |
| 14208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14209 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14210 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14211 | 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] | 14212 | "$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] | 14213 | -d 4 |
| 14214 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14215 | "$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] | 14216 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14217 | min_version=tls12 max_version=tls13 " \ |
| 14218 | 0 \ |
| 14219 | -c "Protocol is TLSv1.2" \ |
| 14220 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14221 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14222 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14223 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14224 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14225 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14226 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14227 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14228 | requires_gnutls_tls1_3 |
| 14229 | requires_gnutls_next_no_ticket |
| 14230 | requires_gnutls_next_disable_tls13_compat |
| 14231 | 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] | 14232 | "$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" \ |
| 14233 | "$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] | 14234 | 0 \ |
| 14235 | -s "Protocol is TLSv1.3" \ |
| 14236 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14237 | -s "received signature algorithm: 0x804" \ |
| 14238 | -s "got named group: ffdhe3072(0101)" \ |
| 14239 | -s "Certificate verification was skipped" \ |
| 14240 | -C "received HelloRetryRequest message" |
| 14241 | |
| 14242 | |
| 14243 | requires_gnutls_tls1_3 |
| 14244 | requires_gnutls_next_no_ticket |
| 14245 | requires_gnutls_next_disable_tls13_compat |
| 14246 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14247 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14248 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14249 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14250 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14251 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14252 | 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] | 14253 | "$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" \ |
| 14254 | "$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] | 14255 | 0 \ |
| 14256 | -c "HTTP/1.0 200 OK" \ |
| 14257 | -c "Protocol is TLSv1.3" \ |
| 14258 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14259 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14260 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14261 | -c "Verifying peer X.509 certificate... ok" \ |
| 14262 | -C "received HelloRetryRequest message" |
| 14263 | |
| 14264 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14265 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14266 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14267 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14268 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14269 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14270 | requires_gnutls_tls1_3 |
| 14271 | requires_gnutls_next_no_ticket |
| 14272 | requires_gnutls_next_disable_tls13_compat |
| 14273 | 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] | 14274 | "$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" \ |
| 14275 | "$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] | 14276 | 0 \ |
| 14277 | -s "Protocol is TLSv1.3" \ |
| 14278 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14279 | -s "received signature algorithm: 0x804" \ |
| 14280 | -s "got named group: ffdhe4096(0102)" \ |
| 14281 | -s "Certificate verification was skipped" \ |
| 14282 | -C "received HelloRetryRequest message" |
| 14283 | |
| 14284 | |
| 14285 | requires_gnutls_tls1_3 |
| 14286 | requires_gnutls_next_no_ticket |
| 14287 | requires_gnutls_next_disable_tls13_compat |
| 14288 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14289 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14290 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14291 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14292 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14293 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14294 | 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] | 14295 | "$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" \ |
| 14296 | "$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] | 14297 | 0 \ |
| 14298 | -c "HTTP/1.0 200 OK" \ |
| 14299 | -c "Protocol is TLSv1.3" \ |
| 14300 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14301 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14302 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14303 | -c "Verifying peer X.509 certificate... ok" \ |
| 14304 | -C "received HelloRetryRequest message" |
| 14305 | |
| 14306 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14307 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14308 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14309 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14310 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14311 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14312 | requires_gnutls_tls1_3 |
| 14313 | requires_gnutls_next_no_ticket |
| 14314 | requires_gnutls_next_disable_tls13_compat |
| 14315 | 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] | 14316 | "$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" \ |
| 14317 | "$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] | 14318 | 0 \ |
| 14319 | -s "Protocol is TLSv1.3" \ |
| 14320 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14321 | -s "received signature algorithm: 0x804" \ |
| 14322 | -s "got named group: ffdhe6144(0103)" \ |
| 14323 | -s "Certificate verification was skipped" \ |
| 14324 | -C "received HelloRetryRequest message" |
| 14325 | |
| 14326 | requires_gnutls_tls1_3 |
| 14327 | requires_gnutls_next_no_ticket |
| 14328 | requires_gnutls_next_disable_tls13_compat |
| 14329 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14330 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14331 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14332 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14333 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14334 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14335 | 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] | 14336 | "$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" \ |
| 14337 | "$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] | 14338 | 0 \ |
| 14339 | -c "HTTP/1.0 200 OK" \ |
| 14340 | -c "Protocol is TLSv1.3" \ |
| 14341 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14342 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14343 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14344 | -c "Verifying peer X.509 certificate... ok" \ |
| 14345 | -C "received HelloRetryRequest message" |
| 14346 | |
| 14347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14348 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14349 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14350 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14351 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14352 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14353 | requires_gnutls_tls1_3 |
| 14354 | requires_gnutls_next_no_ticket |
| 14355 | requires_gnutls_next_disable_tls13_compat |
| 14356 | client_needs_more_time 4 |
| 14357 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14358 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
| 14359 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14360 | 0 \ |
| 14361 | -s "Protocol is TLSv1.3" \ |
| 14362 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14363 | -s "received signature algorithm: 0x804" \ |
| 14364 | -s "got named group: ffdhe8192(0104)" \ |
| 14365 | -s "Certificate verification was skipped" \ |
| 14366 | -C "received HelloRetryRequest message" |
| 14367 | |
| 14368 | requires_gnutls_tls1_3 |
| 14369 | requires_gnutls_next_no_ticket |
| 14370 | requires_gnutls_next_disable_tls13_compat |
| 14371 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14372 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14373 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14374 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14375 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14376 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14377 | client_needs_more_time 4 |
| 14378 | 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] | 14379 | "$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" \ |
| 14380 | "$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] | 14381 | 0 \ |
| 14382 | -c "HTTP/1.0 200 OK" \ |
| 14383 | -c "Protocol is TLSv1.3" \ |
| 14384 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14385 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14386 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14387 | -c "Verifying peer X.509 certificate... ok" \ |
| 14388 | -C "received HelloRetryRequest message" |
| 14389 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14392 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14393 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14394 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14395 | 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] | 14396 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14397 | "$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] | 14398 | 0 \ |
| 14399 | -C "received HelloRetryRequest message" \ |
| 14400 | -c "Selected key exchange mode: psk$" \ |
| 14401 | -c "HTTP/1.0 200 OK" |
| 14402 | |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14403 | # Legacy_compression_methods testing |
| 14404 | |
| 14405 | requires_gnutls |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14406 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14408 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14409 | "$P_SRV debug_level=3" \ |
| 14410 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14411 | 0 \ |
| 14412 | -c "Handshake was completed" \ |
| 14413 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14414 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14415 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14417 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14418 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14419 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14420 | requires_max_content_len 16384 |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14421 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14422 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14423 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14424 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14425 | # Final report |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14426 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14427 | echo "------------------------------------------------------------------------" |
| 14428 | |
| 14429 | if [ $FAILS = 0 ]; then |
| 14430 | printf "PASSED" |
| 14431 | else |
| 14432 | printf "FAILED" |
| 14433 | fi |
| 14434 | PASSES=$(( $TESTS - $FAILS )) |
| 14435 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14436 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14437 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14438 | cat <<EOF |
| 14439 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14440 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14441 | EOF |
| 14442 | if [ $FAILS -eq 0 ]; then |
| 14443 | FAILS=1 |
| 14444 | fi |
| 14445 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14446 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14447 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14448 | if [ $FAILS -gt 255 ]; then |
| 14449 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14450 | # (so 256 would be 0, or success, etc) |
| 14451 | FAILS=255 |
| 14452 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 14453 | exit $FAILS |