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" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 72 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 73 | |
Gilles Peskine | dd782f4 | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 74 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 75 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 76 | case $($OPENSSL version) in |
| 77 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 78 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | esac |
| 80 | fi |
| 81 | |
| 82 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 83 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 84 | case $($GNUTLS_CLI --version) in |
| 85 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 86 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | esac |
| 89 | fi |
| 90 | |
| 91 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 92 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 93 | case $($GNUTLS_SERV --version) in |
| 94 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 95 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | esac |
| 98 | fi |
| 99 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 100 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 101 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 102 | 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] | 103 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 104 | 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] | 105 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Minos Galanakis | a8f1438 | 2025-03-11 17:29:33 +0000 | [diff] [blame] | 106 | O_NEXT_CLI_RENEGOTIATE="echo 'R' | $OPENSSL_NEXT s_client -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
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 |
Minos Galanakis | 5aaa6e0 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 113 | O_NEXT_CLI_RENEGOTIATE=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 114 | fi |
| 115 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 116 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 117 | 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] | 118 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 119 | else |
| 120 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 121 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 122 | fi |
| 123 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 124 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 125 | 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] | 126 | 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] | 127 | else |
| 128 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 129 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 130 | fi |
| 131 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 132 | TESTS=0 |
| 133 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 134 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 135 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 136 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 137 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 138 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 139 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 140 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 141 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 142 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 143 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 144 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 145 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 146 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 147 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 148 | PRESERVE_LOGS=0 |
| 149 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 150 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 151 | # port which is this plus 10000. Each port number may be independently |
| 152 | # overridden by a command line option. |
| 153 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 154 | PXY_PORT=$((SRV_PORT + 10000)) |
| 155 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 156 | print_usage() { |
| 157 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 158 | printf " -h|--help\tPrint this help.\n" |
| 159 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 160 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 161 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 162 | 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] | 163 | 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] | 164 | 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] | 165 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 166 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 167 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 168 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 169 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 170 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 171 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 172 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 173 | 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] | 174 | } |
| 175 | |
| 176 | get_options() { |
| 177 | while [ $# -gt 0 ]; do |
| 178 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 179 | -f|--filter) |
| 180 | shift; FILTER=$1 |
| 181 | ;; |
| 182 | -e|--exclude) |
| 183 | shift; EXCLUDE=$1 |
| 184 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 185 | -m|--memcheck) |
| 186 | MEMCHECK=1 |
| 187 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 188 | -n|--number) |
| 189 | shift; RUN_TEST_NUMBER=$1 |
| 190 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 191 | -s|--show-numbers) |
| 192 | SHOW_TEST_NUMBER=1 |
| 193 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 194 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 195 | LIST_TESTS=1 |
| 196 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 197 | -p|--preserve-logs) |
| 198 | PRESERVE_LOGS=1 |
| 199 | ;; |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 200 | --min) |
| 201 | shift; MIN_TESTS=$1 |
| 202 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 203 | --outcome-file) |
| 204 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 205 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 206 | --port) |
| 207 | shift; SRV_PORT=$1 |
| 208 | ;; |
| 209 | --proxy-port) |
| 210 | shift; PXY_PORT=$1 |
| 211 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 212 | --seed) |
| 213 | shift; SEED="$1" |
| 214 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 215 | --test-suite) |
| 216 | shift; RUN_TEST_SUITE="$1" |
| 217 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 218 | -h|--help) |
| 219 | print_usage |
| 220 | exit 0 |
| 221 | ;; |
| 222 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 223 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 224 | print_usage |
| 225 | exit 1 |
| 226 | ;; |
| 227 | esac |
| 228 | shift |
| 229 | done |
| 230 | } |
| 231 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 232 | get_options "$@" |
| 233 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 234 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 235 | # testing. Skip non-boolean options (with something other than spaces |
| 236 | # and a comment after "#define SYMBOL"). The variable contains a |
Minos Galanakis | 4ce27cb | 2024-12-02 15:51:07 +0000 | [diff] [blame] | 237 | # space-separated list of symbols. The list should always be |
| 238 | # terminated by a single whitespace character, otherwise the last entry |
| 239 | # will not get matched by the parsing regex. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 240 | if [ "$LIST_TESTS" -eq 0 ];then |
Minos Galanakis | 4ce27cb | 2024-12-02 15:51:07 +0000 | [diff] [blame] | 241 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` ) " |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 242 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 243 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 244 | CONFIGS_ENABLED="" |
| 245 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 246 | # Skip next test; use this macro to skip tests which are legitimate |
| 247 | # in theory and expected to be re-introduced at some point, but |
| 248 | # aren't expected to succeed at the moment due to problems outside |
| 249 | # our control (such as bugs in other TLS implementations). |
| 250 | skip_next_test() { |
| 251 | SKIP_NEXT="YES" |
| 252 | } |
| 253 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 254 | # Check if the required configuration ($1) is enabled |
| 255 | is_config_enabled() |
| 256 | { |
| 257 | case $CONFIGS_ENABLED in |
| 258 | *" $1"[\ =]*) return 0;; |
| 259 | *) return 1;; |
| 260 | esac |
| 261 | } |
| 262 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 263 | # 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] | 264 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 265 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 266 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 267 | *) SKIP_NEXT="YES";; |
| 268 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 269 | } |
| 270 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 271 | # 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] | 272 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 273 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 274 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 275 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 276 | } |
| 277 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 278 | requires_all_configs_enabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 279 | for x in "$@"; do |
| 280 | if ! is_config_enabled "$x"; then |
| 281 | SKIP_NEXT="YES" |
| 282 | return |
| 283 | fi |
| 284 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | requires_all_configs_disabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 288 | for x in "$@"; do |
| 289 | if is_config_enabled "$x"; then |
| 290 | SKIP_NEXT="YES" |
| 291 | return |
| 292 | fi |
| 293 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | requires_any_configs_enabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 297 | for x in "$@"; do |
| 298 | if is_config_enabled "$x"; then |
| 299 | return |
| 300 | fi |
| 301 | done |
| 302 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | requires_any_configs_disabled() { |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 306 | for x in "$@"; do |
| 307 | if ! is_config_enabled "$x"; then |
| 308 | return |
| 309 | fi |
| 310 | done |
| 311 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 312 | } |
| 313 | |
Gabor Mezei | e1e2730 | 2025-02-26 18:06:05 +0100 | [diff] [blame] | 314 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 315 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 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 | |
Gabor Mezei | e1e2730 | 2025-02-26 18:06:05 +0100 | [diff] [blame] | 322 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 323 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED" |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 324 | |
Gilles Peskine | 9d3b207 | 2024-09-06 15:38:47 +0200 | [diff] [blame] | 325 | requires_certificate_authentication () { |
Gilles Peskine | e3eab32 | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 326 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 327 | then |
Gilles Peskine | e3eab32 | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 328 | # TLS 1.3 is negotiated by default, so check whether it supports |
| 329 | # certificate-based authentication. |
| 330 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 331 | else # Only TLS 1.2 is enabled. |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 332 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 333 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 334 | } |
| 335 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 336 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 337 | # This function uses the query_config command line option to query the |
| 338 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 339 | # program. The command will always return a success value if the |
| 340 | # configuration is defined and the value will be printed to stdout. |
| 341 | # |
| 342 | # Note that if the configuration is not defined or is defined to nothing, |
| 343 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 344 | if [ "$LIST_TESTS" -eq 0 ];then |
| 345 | ${P_SRV} "query_config=${1}" |
| 346 | else |
| 347 | echo "1" |
| 348 | fi |
| 349 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 353 | VAL="$( get_config_value_or_default "$1" )" |
| 354 | if [ -z "$VAL" ]; then |
| 355 | # Should never happen |
| 356 | echo "Mbed TLS configuration $1 is not defined" |
| 357 | exit 1 |
| 358 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 359 | SKIP_NEXT="YES" |
| 360 | fi |
| 361 | } |
| 362 | |
| 363 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 364 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 365 | if [ -z "$VAL" ]; then |
| 366 | # Should never happen |
| 367 | echo "Mbed TLS configuration $1 is not defined" |
| 368 | exit 1 |
| 369 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 370 | SKIP_NEXT="YES" |
| 371 | fi |
| 372 | } |
| 373 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 374 | requires_config_value_equals() { |
| 375 | VAL=$( get_config_value_or_default "$1" ) |
| 376 | if [ -z "$VAL" ]; then |
| 377 | # Should never happen |
| 378 | echo "Mbed TLS configuration $1 is not defined" |
| 379 | exit 1 |
| 380 | elif [ "$VAL" -ne "$2" ]; then |
| 381 | SKIP_NEXT="YES" |
| 382 | fi |
| 383 | } |
| 384 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 385 | # Require Mbed TLS to support the given protocol version. |
| 386 | # |
| 387 | # Inputs: |
| 388 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 389 | requires_protocol_version() { |
| 390 | # Support for DTLS is detected separately in detect_dtls(). |
| 391 | case "$1" in |
| 392 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 393 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 394 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 395 | esac |
| 396 | } |
| 397 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 398 | # Space-separated list of ciphersuites supported by this build of |
| 399 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 400 | P_CIPHERSUITES="" |
| 401 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 402 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 403 | grep 'TLS-\|TLS1-3' | |
| 404 | tr -s ' \n' ' ')" |
| 405 | |
| 406 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 407 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 408 | exit 125 |
| 409 | fi |
| 410 | fi |
| 411 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 412 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 413 | case $P_CIPHERSUITES in |
| 414 | *" $1 "*) :;; |
| 415 | *) SKIP_NEXT="YES";; |
| 416 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 417 | } |
| 418 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 419 | requires_cipher_enabled() { |
| 420 | KEY_TYPE=$1 |
| 421 | MODE=${2:-} |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 422 | case "$KEY_TYPE" in |
| 423 | CHACHA20) |
| 424 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 425 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 426 | ;; |
| 427 | *) |
| 428 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 429 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 430 | ;; |
| 431 | esac |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 432 | } |
| 433 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 434 | # Automatically detect required features based on command line parameters. |
| 435 | # Parameters are: |
| 436 | # - $1 = command line (call to a TLS client or server program) |
| 437 | # - $2 = client/server |
| 438 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 439 | # - $4 = Use an external tool without ECDH support |
| 440 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 441 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 442 | CMD_LINE=$1 |
| 443 | ROLE=$2 |
| 444 | TLS_VERSION=$3 |
| 445 | EXT_WO_ECDH=$4 |
| 446 | TEST_OPTIONS=${5:-} |
| 447 | |
| 448 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 449 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 450 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 451 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 452 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 453 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 454 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 455 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 456 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 457 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 458 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 459 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 460 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 461 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 462 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 463 | *[-_\ =]tickets=[^0]*) |
| 464 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 465 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 466 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 467 | *[-_\ =]alpn=*) |
| 468 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 469 | esac |
| 470 | |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 471 | case " $CMD_LINE " in |
| 472 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 473 | # The test case involves certificates (crt), or a relevant |
| 474 | # aspect of it is the (certificate-based) authentication mode. |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 475 | requires_certificate_authentication;; |
| 476 | esac |
| 477 | |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 478 | case " $CMD_LINE " in |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 479 | *"programs/ssl/dtls_client "*|\ |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 480 | *"programs/ssl/ssl_client1 "*) |
| 481 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 482 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 483 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 484 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 485 | requires_certificate_authentication |
| 486 | ;; |
Gilles Peskine | 6b4d693 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 487 | *"programs/ssl/dtls_server "*|\ |
Gilles Peskine | c83e56c | 2024-09-04 17:47:14 +0200 | [diff] [blame] | 488 | *"programs/ssl/ssl_fork_server "*|\ |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 489 | *"programs/ssl/ssl_pthread_server "*|\ |
Gilles Peskine | a21e893 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 490 | *"programs/ssl/ssl_server "*) |
| 491 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 492 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 493 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 494 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 495 | requires_certificate_authentication |
Gilles Peskine | f9ad830 | 2024-09-13 23:08:48 +0200 | [diff] [blame] | 496 | # The actual minimum depends on the configuration since it's |
| 497 | # mostly about the certificate size. |
| 498 | # In config-suite-b.h, for the test certificates (server5.crt), |
| 499 | # 1024 is not enough. |
| 500 | requires_config_value_at_least MBEDTLS_SSL_OUT_CONTENT_LEN 2000 |
Gilles Peskine | a21e893 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 501 | ;; |
Gilles Peskine | 7985d45 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 502 | esac |
| 503 | |
Gilles Peskine | 3abca95 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 504 | case " $CMD_LINE " in |
| 505 | *"programs/ssl/ssl_pthread_server "*) |
| 506 | requires_config_enabled MBEDTLS_THREADING_PTHREAD;; |
| 507 | esac |
| 508 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 509 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 510 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 511 | */server5*|\ |
| 512 | */server7*|\ |
| 513 | */dir-maxpath*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 514 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 515 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 516 | # In case of TLS13 the support for ECDSA is enough |
| 517 | requires_pk_alg "ECDSA" |
| 518 | else |
| 519 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 520 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 521 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 522 | # key exchange is required. However gnutls also does not |
| 523 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 524 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 525 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 526 | else |
| 527 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 528 | fi |
| 529 | elif [ "$ROLE" = "client" ]; then |
| 530 | # On the client side it is enough to have any certificate |
| 531 | # based authentication together with support for ECDSA. |
| 532 | # Of course the GnuTLS limitation mentioned above applies |
| 533 | # also here. |
| 534 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 535 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 536 | else |
| 537 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 538 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 539 | requires_pk_alg "ECDSA" |
| 540 | fi |
| 541 | fi |
| 542 | ;; |
| 543 | esac |
| 544 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 545 | case "$CMD_LINE" in |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 546 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 547 | */server1*|\ |
Gilles Peskine | e855317 | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 548 | */server2*|\ |
| 549 | */server7*) |
Gilles Peskine | ae3dc17 | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 550 | requires_certificate_authentication |
Gilles Peskine | d00b93b | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 551 | # Certificates with an RSA key. The algorithm requirement is |
| 552 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 553 | # PSS signature}. We can't easily tell which subset works, and |
| 554 | # we aren't currently running ssl-opt.sh in configurations |
| 555 | # where partial RSA support is a problem, so generically, we |
| 556 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 557 | requires_config_enabled "MBEDTLS_RSA_C" |
| 558 | esac |
| 559 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 560 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 561 | } |
| 562 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 563 | adapt_cmd_for_psk () { |
| 564 | case "$2" in |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 565 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 566 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 6f9952a | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 567 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 568 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 569 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 570 | esac |
| 571 | eval $1='"$2 $s"' |
| 572 | unset s |
| 573 | } |
| 574 | |
| 575 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 576 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 577 | # |
| 578 | # If not running in a PSK-only build, do nothing. |
| 579 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 580 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 581 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 582 | # a pre-shared key, do nothing. |
| 583 | # |
Gilles Peskine | 7dfe7c9 | 2024-09-20 18:16:41 +0200 | [diff] [blame] | 584 | # This code does not consider builds with ECDHE-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 585 | # |
| 586 | # Inputs: |
| 587 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 588 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 589 | # * "$@": options passed to run_test. |
| 590 | # |
| 591 | # Outputs: |
| 592 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 593 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 594 | maybe_adapt_for_psk() { |
| 595 | if [ "$PSK_ONLY" != "YES" ]; then |
| 596 | return |
| 597 | fi |
| 598 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 599 | return |
| 600 | fi |
| 601 | case "$CLI_CMD $SRV_CMD" in |
| 602 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 603 | return;; |
| 604 | *force_ciphersuite*) |
| 605 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 606 | # PSK cipher suite could be substituted, but we're not ready for |
| 607 | # that yet. |
| 608 | SKIP_NEXT="YES" |
| 609 | return;; |
| 610 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 611 | # The test case involves certificates. PSK won't do. |
| 612 | SKIP_NEXT="YES" |
| 613 | return;; |
| 614 | esac |
| 615 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 616 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 617 | } |
| 618 | |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 619 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 620 | # one PSK key exchange mode. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 621 | PSK_PRESENT="NO" |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 622 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 623 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 624 | PSK_ONLY="" |
| 625 | for c in $CONFIGS_ENABLED; do |
| 626 | case $c in |
| 627 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 2dd4395 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 628 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 629 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 630 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | db26406 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 631 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 632 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 633 | esac |
| 634 | done |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 635 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 636 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 637 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | 6e85e35 | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 638 | # the edge case of no key exchanges. |
Gilles Peskine | 24b4303 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 639 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 640 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 641 | |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 642 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 643 | HAS_ALG_SHA_1="NO" |
| 644 | HAS_ALG_SHA_224="NO" |
| 645 | HAS_ALG_SHA_256="NO" |
| 646 | HAS_ALG_SHA_384="NO" |
| 647 | HAS_ALG_SHA_512="NO" |
| 648 | |
| 649 | check_for_hash_alg() |
| 650 | { |
| 651 | CURR_ALG="INVALID"; |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 652 | CURR_ALG=PSA_WANT_ALG_${1} |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 653 | |
| 654 | case $CONFIGS_ENABLED in |
| 655 | *" $CURR_ALG"[\ =]*) |
| 656 | return 0 |
| 657 | ;; |
| 658 | *) :;; |
| 659 | esac |
| 660 | return 1 |
| 661 | } |
| 662 | |
| 663 | populate_enabled_hash_algs() |
| 664 | { |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 665 | 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] | 666 | if check_for_hash_alg "$hash_alg"; then |
| 667 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 668 | eval ${hash_alg_variable}=YES |
| 669 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 670 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 671 | } |
| 672 | |
| 673 | # skip next test if the given hash alg is not supported |
| 674 | requires_hash_alg() { |
| 675 | HASH_DEFINE="Invalid" |
| 676 | HAS_HASH_ALG="NO" |
| 677 | case $1 in |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 678 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 679 | SHA_1):;; |
| 680 | SHA_224):;; |
| 681 | SHA_256):;; |
| 682 | SHA_384):;; |
| 683 | SHA_512):;; |
| 684 | *) |
| 685 | echo "Unsupported hash alg - $1" |
| 686 | exit 1 |
| 687 | ;; |
| 688 | esac |
| 689 | |
| 690 | HASH_DEFINE=HAS_ALG_${1} |
| 691 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 692 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 693 | then |
| 694 | SKIP_NEXT="YES" |
| 695 | fi |
| 696 | } |
| 697 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 698 | # Skip next test if the given pk alg is not enabled |
| 699 | requires_pk_alg() { |
| 700 | case $1 in |
| 701 | ECDSA) |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 702 | requires_config_enabled PSA_WANT_ALG_ECDSA |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 703 | ;; |
| 704 | *) |
| 705 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 706 | exit 1 |
| 707 | ;; |
| 708 | esac |
| 709 | } |
| 710 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 711 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 712 | requires_openssl_with_fallback_scsv() { |
| 713 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 714 | 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] | 715 | then |
| 716 | OPENSSL_HAS_FBSCSV="YES" |
| 717 | else |
| 718 | OPENSSL_HAS_FBSCSV="NO" |
| 719 | fi |
| 720 | fi |
| 721 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 722 | SKIP_NEXT="YES" |
| 723 | fi |
| 724 | } |
| 725 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 726 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 727 | requires_max_content_len() { |
| 728 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 729 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 730 | } |
| 731 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 732 | # skip next test if GnuTLS isn't available |
| 733 | requires_gnutls() { |
| 734 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 735 | 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] | 736 | GNUTLS_AVAILABLE="YES" |
| 737 | else |
| 738 | GNUTLS_AVAILABLE="NO" |
| 739 | fi |
| 740 | fi |
| 741 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 742 | SKIP_NEXT="YES" |
| 743 | fi |
| 744 | } |
| 745 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 746 | # skip next test if GnuTLS-next isn't available |
| 747 | requires_gnutls_next() { |
| 748 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 749 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 750 | GNUTLS_NEXT_AVAILABLE="YES" |
| 751 | else |
| 752 | GNUTLS_NEXT_AVAILABLE="NO" |
| 753 | fi |
| 754 | fi |
| 755 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 756 | SKIP_NEXT="YES" |
| 757 | fi |
| 758 | } |
| 759 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 760 | requires_openssl_next() { |
| 761 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 762 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 763 | OPENSSL_NEXT_AVAILABLE="YES" |
| 764 | else |
| 765 | OPENSSL_NEXT_AVAILABLE="NO" |
| 766 | fi |
| 767 | fi |
| 768 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 769 | SKIP_NEXT="YES" |
| 770 | fi |
| 771 | } |
| 772 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 773 | # skip next test if openssl version is lower than 3.0 |
| 774 | requires_openssl_3_x() { |
| 775 | requires_openssl_next |
| 776 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 777 | OPENSSL_3_X_AVAILABLE="NO" |
| 778 | fi |
| 779 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 780 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 781 | then |
| 782 | OPENSSL_3_X_AVAILABLE="YES" |
| 783 | else |
| 784 | OPENSSL_3_X_AVAILABLE="NO" |
| 785 | fi |
| 786 | fi |
| 787 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 788 | SKIP_NEXT="YES" |
| 789 | fi |
| 790 | } |
| 791 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 792 | # skip next test if openssl does not support ffdh keys |
| 793 | requires_openssl_tls1_3_with_ffdh() { |
| 794 | requires_openssl_3_x |
| 795 | } |
| 796 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 797 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 798 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 799 | requires_openssl_next |
| 800 | |
| 801 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 802 | requires_openssl_tls1_3_with_ffdh |
| 803 | fi |
| 804 | } |
| 805 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 806 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 807 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 808 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 809 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 810 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 811 | fi |
| 812 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 813 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 814 | then |
| 815 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 816 | else |
| 817 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 818 | fi |
| 819 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 820 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 821 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 822 | fi |
| 823 | } |
| 824 | |
Gilles Peskine | 7f453bf | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 825 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 826 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 827 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 828 | case $($OPENSSL s_server -help 2>&1) in |
| 829 | *-client_renegotiation*) |
| 830 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 831 | esac |
| 832 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 833 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 834 | requires_gnutls_tls1_3() { |
| 835 | requires_gnutls_next |
| 836 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 837 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 838 | fi |
| 839 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 840 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 841 | then |
| 842 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 843 | else |
| 844 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 845 | fi |
| 846 | fi |
| 847 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 848 | SKIP_NEXT="YES" |
| 849 | fi |
| 850 | } |
| 851 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 852 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 853 | requires_gnutls_next_no_ticket() { |
| 854 | requires_gnutls_next |
| 855 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 856 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 857 | fi |
| 858 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 859 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 860 | then |
| 861 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 862 | else |
| 863 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 864 | fi |
| 865 | fi |
| 866 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 867 | SKIP_NEXT="YES" |
| 868 | fi |
| 869 | } |
| 870 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 871 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 872 | requires_gnutls_next_disable_tls13_compat() { |
| 873 | requires_gnutls_next |
| 874 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 875 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 876 | fi |
| 877 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 878 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 879 | then |
| 880 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 881 | else |
| 882 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 883 | fi |
| 884 | fi |
| 885 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 886 | SKIP_NEXT="YES" |
| 887 | fi |
| 888 | } |
| 889 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 890 | # skip next test if GnuTLS does not support the record size limit extension |
| 891 | requires_gnutls_record_size_limit() { |
| 892 | requires_gnutls_next |
| 893 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 894 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 895 | else |
| 896 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 897 | fi |
| 898 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 899 | SKIP_NEXT="YES" |
| 900 | fi |
| 901 | } |
| 902 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 903 | # skip next test if IPv6 isn't available on this host |
| 904 | requires_ipv6() { |
| 905 | if [ -z "${HAS_IPV6:-}" ]; then |
| 906 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 907 | SRV_PID=$! |
| 908 | sleep 1 |
| 909 | kill $SRV_PID >/dev/null 2>&1 |
| 910 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 911 | HAS_IPV6="NO" |
| 912 | else |
| 913 | HAS_IPV6="YES" |
| 914 | fi |
| 915 | rm -r $SRV_OUT |
| 916 | fi |
| 917 | |
| 918 | if [ "$HAS_IPV6" = "NO" ]; then |
| 919 | SKIP_NEXT="YES" |
| 920 | fi |
| 921 | } |
| 922 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 923 | # skip next test if it's i686 or uname is not available |
| 924 | requires_not_i686() { |
| 925 | if [ -z "${IS_I686:-}" ]; then |
| 926 | IS_I686="YES" |
| 927 | if which "uname" >/dev/null 2>&1; then |
| 928 | if [ -z "$(uname -a | grep i686)" ]; then |
| 929 | IS_I686="NO" |
| 930 | fi |
| 931 | fi |
| 932 | fi |
| 933 | if [ "$IS_I686" = "YES" ]; then |
| 934 | SKIP_NEXT="YES" |
| 935 | fi |
| 936 | } |
| 937 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 938 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 939 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 940 | 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] | 941 | if [ "$LIST_TESTS" -eq 0 ];then |
| 942 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 943 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 944 | # Calculate the maximum content length that fits both |
| 945 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 946 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 947 | fi |
| 948 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 949 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 950 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 951 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 952 | # skip the next test if the SSL output buffer is less than 16KB |
| 953 | requires_full_size_output_buffer() { |
| 954 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 955 | SKIP_NEXT="YES" |
| 956 | fi |
| 957 | } |
| 958 | |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 959 | # Skip the next test if called by all.sh in a component with MSan |
| 960 | # (which we also call MemSan) or Valgrind. |
| 961 | not_with_msan_or_valgrind() { |
| 962 | case "_${MBEDTLS_TEST_CONFIGURATION:-}_" in |
| 963 | *_msan_*|*_memsan_*|*_valgrind_*) SKIP_NEXT="YES";; |
| 964 | esac |
| 965 | } |
| 966 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 967 | # skip the next test if valgrind is in use |
| 968 | not_with_valgrind() { |
| 969 | if [ "$MEMCHECK" -gt 0 ]; then |
| 970 | SKIP_NEXT="YES" |
| 971 | fi |
| 972 | } |
| 973 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 974 | # skip the next test if valgrind is NOT in use |
| 975 | only_with_valgrind() { |
| 976 | if [ "$MEMCHECK" -eq 0 ]; then |
| 977 | SKIP_NEXT="YES" |
| 978 | fi |
| 979 | } |
| 980 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 981 | # 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] | 982 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 983 | CLI_DELAY_FACTOR=$1 |
| 984 | } |
| 985 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 986 | # wait for the given seconds after the client finished in the next test |
| 987 | server_needs_more_time() { |
| 988 | SRV_DELAY_SECONDS=$1 |
| 989 | } |
| 990 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 991 | # print_name <name> |
| 992 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 993 | TESTS=$(( $TESTS + 1 )) |
| 994 | LINE="" |
| 995 | |
| 996 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 997 | LINE="$TESTS " |
| 998 | fi |
| 999 | |
| 1000 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1001 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 1002 | printf "%s " "$LINE" |
| 1003 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 1004 | for i in `seq 1 $LEN`; do printf '.'; done |
| 1005 | printf ' ' |
| 1006 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1007 | } |
| 1008 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1009 | # record_outcome <outcome> [<failure-reason>] |
| 1010 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1011 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1012 | record_outcome() { |
| 1013 | echo "$1" |
| 1014 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1015 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1016 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1017 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1018 | "$1" "${2-}" \ |
| 1019 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1020 | fi |
| 1021 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1022 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1023 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1024 | # True if the presence of the given pattern in a log definitely indicates |
| 1025 | # that the test has failed. False if the presence is inconclusive. |
| 1026 | # |
| 1027 | # Inputs: |
| 1028 | # * $1: pattern found in the logs |
| 1029 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1030 | # |
| 1031 | # Outputs: |
| 1032 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1033 | # unchanged otherwise. |
| 1034 | # * Return value: 1 if the pattern is inconclusive, |
| 1035 | # 0 if the failure is definitive. |
| 1036 | log_pattern_presence_is_conclusive() { |
| 1037 | # If we've run out of attempts, then don't retry no matter what. |
| 1038 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1039 | return 0 |
| 1040 | fi |
| 1041 | case $1 in |
| 1042 | "resend") |
| 1043 | # An undesired resend may have been caused by the OS dropping or |
| 1044 | # delaying a packet at an inopportune time. |
| 1045 | outcome="RETRY(resend)" |
| 1046 | return 1;; |
| 1047 | esac |
| 1048 | } |
| 1049 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1050 | # fail <message> |
| 1051 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1052 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1053 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1054 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1055 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1056 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1057 | if [ -n "$PXY_CMD" ]; then |
| 1058 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1059 | fi |
| 1060 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1061 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1062 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1063 | echo " ! server output:" |
| 1064 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1065 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1066 | echo " ! client output:" |
| 1067 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1068 | if [ -n "$PXY_CMD" ]; then |
| 1069 | echo " ! ========================================================" |
| 1070 | echo " ! proxy output:" |
| 1071 | cat o-pxy-${TESTS}.log |
| 1072 | fi |
| 1073 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1074 | fi |
| 1075 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1076 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1077 | } |
| 1078 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1079 | # is_polar <cmd_line> |
| 1080 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1081 | case "$1" in |
| 1082 | *ssl_client2*) true;; |
| 1083 | *ssl_server2*) true;; |
| 1084 | *) false;; |
| 1085 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1086 | } |
| 1087 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1088 | # openssl s_server doesn't have -www with DTLS |
| 1089 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1090 | case "$SRV_CMD" in |
| 1091 | *s_server*-dtls*) |
| 1092 | NEEDS_INPUT=1 |
| 1093 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1094 | *) NEEDS_INPUT=0;; |
| 1095 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1096 | } |
| 1097 | |
| 1098 | # provide input to commands that need it |
| 1099 | provide_input() { |
| 1100 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1101 | return |
| 1102 | fi |
| 1103 | |
| 1104 | while true; do |
| 1105 | echo "HTTP/1.0 200 OK" |
| 1106 | sleep 1 |
| 1107 | done |
| 1108 | } |
| 1109 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1110 | # has_mem_err <log_file_name> |
| 1111 | has_mem_err() { |
| 1112 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1113 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1114 | then |
| 1115 | return 1 # false: does not have errors |
| 1116 | else |
| 1117 | return 0 # true: has errors |
| 1118 | fi |
| 1119 | } |
| 1120 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1121 | # 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] | 1122 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1123 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1124 | newline=' |
| 1125 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1126 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1127 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1128 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1129 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1130 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1131 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1132 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1133 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1134 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1135 | # When we use a proxy, it will be listening on the same port we |
| 1136 | # 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] | 1137 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1138 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1139 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1140 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1141 | echo "$3 START TIMEOUT" |
| 1142 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1143 | break |
| 1144 | fi |
| 1145 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1146 | # OSes this may be a tight loop. |
| 1147 | sleep 0.1 2>/dev/null || true |
| 1148 | done |
| 1149 | } |
| 1150 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1151 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1152 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1153 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1154 | } |
| 1155 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1156 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1157 | # Wait for server process $2 to be listening on port $1. |
| 1158 | wait_server_start() { |
| 1159 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1160 | } |
| 1161 | |
| 1162 | # Wait for proxy process $2 to be listening on port $1. |
| 1163 | wait_proxy_start() { |
| 1164 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1165 | } |
| 1166 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1167 | # 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] | 1168 | # 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] | 1169 | # acceptable bounds |
| 1170 | check_server_hello_time() { |
| 1171 | # 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] | 1172 | 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] | 1173 | # Get the Unix timestamp for now |
| 1174 | CUR_TIME=$(date +'%s') |
| 1175 | THRESHOLD_IN_SECS=300 |
| 1176 | |
| 1177 | # Check if the ServerHello time was printed |
| 1178 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1179 | return 1 |
| 1180 | fi |
| 1181 | |
| 1182 | # Check the time in ServerHello is within acceptable bounds |
| 1183 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1184 | # The time in ServerHello is at least 5 minutes before now |
| 1185 | return 1 |
| 1186 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1187 | # 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] | 1188 | return 1 |
| 1189 | else |
| 1190 | return 0 |
| 1191 | fi |
| 1192 | } |
| 1193 | |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 1194 | # Extract the exported key from the output. |
| 1195 | get_exported_key() { |
| 1196 | OUTPUT="$1" |
| 1197 | EXPORTED_KEY1=$(sed -n '/Exporting key of length 20 with label ".*": /s/.*: //p' $OUTPUT) |
| 1198 | } |
| 1199 | |
| 1200 | # Check that the exported key from the output matches the one obtained in get_exported_key(). |
| 1201 | check_exported_key() { |
| 1202 | OUTPUT="$1" |
| 1203 | EXPORTED_KEY2=$(sed -n '/Exporting key of length 20 with label ".*": /s/.*: //p' $OUTPUT) |
| 1204 | test "$EXPORTED_KEY1" = "$EXPORTED_KEY2" |
| 1205 | } |
| 1206 | |
| 1207 | # Check that the exported key from the output matches the one obtained in get_exported_key(). |
| 1208 | check_exported_key_openssl() { |
| 1209 | OUTPUT="$1" |
| 1210 | EXPORTED_KEY2=0x$(sed -n '/Keying material: /s/.*: //p' $OUTPUT) |
| 1211 | test "$EXPORTED_KEY1" = "$EXPORTED_KEY2" |
| 1212 | } |
| 1213 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1214 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1215 | handshake_memory_get() { |
| 1216 | OUTPUT_VARIABLE="$1" |
| 1217 | OUTPUT_FILE="$2" |
| 1218 | |
| 1219 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1220 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1221 | |
| 1222 | # Check if memory usage was read |
| 1223 | if [ -z "$MEM_USAGE" ]; then |
| 1224 | echo "Error: Can not read the value of handshake memory usage" |
| 1225 | return 1 |
| 1226 | else |
| 1227 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1228 | return 0 |
| 1229 | fi |
| 1230 | } |
| 1231 | |
| 1232 | # Get handshake memory usage from server or client output and check if this value |
| 1233 | # is not higher than the maximum given by the first argument |
| 1234 | handshake_memory_check() { |
| 1235 | MAX_MEMORY="$1" |
| 1236 | OUTPUT_FILE="$2" |
| 1237 | |
| 1238 | # Get memory usage |
| 1239 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1240 | return 1 |
| 1241 | fi |
| 1242 | |
| 1243 | # Check if memory usage is below max value |
| 1244 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1245 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1246 | "but should be below $MAX_MEMORY bytes" |
| 1247 | return 1 |
| 1248 | else |
| 1249 | return 0 |
| 1250 | fi |
| 1251 | } |
| 1252 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1253 | # wait for client to terminate and set CLI_EXIT |
| 1254 | # must be called right after starting the client |
| 1255 | wait_client_done() { |
| 1256 | CLI_PID=$! |
| 1257 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1258 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1259 | CLI_DELAY_FACTOR=1 |
| 1260 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1261 | ( 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] | 1262 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1263 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1264 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1265 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1266 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1267 | CLI_EXIT=$? |
| 1268 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1269 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1270 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1271 | |
| 1272 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1273 | |
| 1274 | sleep $SRV_DELAY_SECONDS |
| 1275 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1276 | } |
| 1277 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1278 | # check if the given command uses dtls and sets global variable DTLS |
| 1279 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1280 | case "$1" in |
Gilles Peskine | 6b4d693 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 1281 | *dtls=1*|*-dtls*|*-u*|*/dtls_*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1282 | *) DTLS=0;; |
| 1283 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1284 | } |
| 1285 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1286 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1287 | is_gnutls() { |
| 1288 | case "$1" in |
| 1289 | *gnutls-cli*) |
| 1290 | CMD_IS_GNUTLS=1 |
| 1291 | ;; |
| 1292 | *gnutls-serv*) |
| 1293 | CMD_IS_GNUTLS=1 |
| 1294 | ;; |
| 1295 | *) |
| 1296 | CMD_IS_GNUTLS=0 |
| 1297 | ;; |
| 1298 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1299 | } |
| 1300 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1301 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1302 | # 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] | 1303 | # and client command lines, given as input, to verify if the current test |
| 1304 | # is using one of these tools. |
| 1305 | use_ext_tool_without_ecdh_support() { |
| 1306 | case "$1" in |
| 1307 | *$GNUTLS_SERV*|\ |
| 1308 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1309 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1310 | echo "yes" |
| 1311 | return;; |
| 1312 | esac |
| 1313 | case "$2" in |
| 1314 | *$GNUTLS_CLI*|\ |
| 1315 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1316 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1317 | echo "yes" |
| 1318 | return;; |
| 1319 | esac |
| 1320 | echo "no" |
| 1321 | } |
| 1322 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1323 | # Generate random psk_list argument for ssl_server2 |
| 1324 | get_srv_psk_list () |
| 1325 | { |
| 1326 | case $(( TESTS % 3 )) in |
| 1327 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1328 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1329 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1330 | esac |
| 1331 | } |
| 1332 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1333 | # Determine what calc_verify trace is to be expected, if any. |
| 1334 | # |
| 1335 | # calc_verify is only called for two things: to calculate the |
| 1336 | # extended master secret, and to process client authentication. |
| 1337 | # |
| 1338 | # Warning: the current implementation assumes that extended_ms is not |
| 1339 | # disabled on the client or on the server. |
| 1340 | # |
| 1341 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1342 | # * $1: the value of the server auth_mode parameter. |
| 1343 | # 'required' if client authentication is expected, |
| 1344 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1345 | # * $CONFIGS_ENABLED |
| 1346 | # |
| 1347 | # Outputs: |
| 1348 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1349 | set_maybe_calc_verify() { |
| 1350 | maybe_calc_verify= |
| 1351 | case $CONFIGS_ENABLED in |
| 1352 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1353 | *) |
| 1354 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1355 | ''|none) return;; |
| 1356 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1357 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1358 | esac |
| 1359 | esac |
Gilles Peskine | fb31ebd | 2024-10-24 20:14:16 +0200 | [diff] [blame] | 1360 | maybe_calc_verify="PSA calc verify" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1361 | } |
| 1362 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1363 | # Compare file content |
| 1364 | # Usage: find_in_both pattern file1 file2 |
| 1365 | # extract from file1 the first line matching the pattern |
| 1366 | # check in file2 that the same line can be found |
| 1367 | find_in_both() { |
| 1368 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1369 | if [ -z "$srv_pattern" ]; then |
| 1370 | return 1; |
| 1371 | fi |
| 1372 | |
| 1373 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1374 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1375 | else |
| 1376 | return 1; |
| 1377 | fi |
| 1378 | } |
| 1379 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1380 | SKIP_HANDSHAKE_CHECK="NO" |
| 1381 | skip_handshake_stage_check() { |
| 1382 | SKIP_HANDSHAKE_CHECK="YES" |
| 1383 | } |
| 1384 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1385 | # Analyze the commands that will be used in a test. |
| 1386 | # |
| 1387 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1388 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1389 | # |
| 1390 | # Inputs: |
| 1391 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1392 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1393 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1394 | # |
| 1395 | # Outputs: |
| 1396 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1397 | analyze_test_commands() { |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1398 | # If the test uses DTLS, does not force a specific port, and does not |
| 1399 | # specify a custom proxy, add a simple proxy. |
| 1400 | # It provides timing info that's useful to debug failures. |
| 1401 | if [ "$DTLS" -eq 1 ] && |
| 1402 | [ "$THIS_SRV_PORT" = "$SRV_PORT" ] && |
| 1403 | [ -z "$PXY_CMD" ] |
| 1404 | then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1405 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1406 | case " $SRV_CMD " in |
| 1407 | *' server_addr=::1 '*) |
| 1408 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1409 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1410 | fi |
| 1411 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1412 | # update CMD_IS_GNUTLS variable |
| 1413 | is_gnutls "$SRV_CMD" |
| 1414 | |
| 1415 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1416 | # set the default priority |
| 1417 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1418 | case "$SRV_CMD" in |
| 1419 | *--priority*) :;; |
| 1420 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1421 | esac |
| 1422 | fi |
| 1423 | |
| 1424 | # update CMD_IS_GNUTLS variable |
| 1425 | is_gnutls "$CLI_CMD" |
| 1426 | |
| 1427 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1428 | # set the default priority |
| 1429 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1430 | case "$CLI_CMD" in |
| 1431 | *--priority*) :;; |
| 1432 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1433 | esac |
| 1434 | fi |
| 1435 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1436 | # fix client port |
| 1437 | if [ -n "$PXY_CMD" ]; then |
| 1438 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1439 | else |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1440 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$THIS_SRV_PORT/g ) |
| 1441 | fi |
| 1442 | |
| 1443 | # If the test forces a specific port and the server is OpenSSL or |
| 1444 | # GnuTLS, override its port specification. |
| 1445 | if [ "$THIS_SRV_PORT" != "$SRV_PORT" ]; then |
| 1446 | case "$SRV_CMD" in |
Gilles Peskine | 6ef5239 | 2024-09-04 23:33:36 +0200 | [diff] [blame] | 1447 | "$G_SRV"*|"$G_NEXT_SRV"*) |
| 1448 | SRV_CMD=$( |
| 1449 | printf %s "$SRV_CMD " | |
| 1450 | sed -e "s/ -p $SRV_PORT / -p $THIS_SRV_PORT /" |
| 1451 | );; |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1452 | "$O_SRV"*|"$O_NEXT_SRV"*) SRV_CMD="$SRV_CMD -accept $THIS_SRV_PORT";; |
| 1453 | esac |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1454 | fi |
| 1455 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1456 | # prepend valgrind to our commands if active |
| 1457 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1458 | if is_polar "$SRV_CMD"; then |
| 1459 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1460 | fi |
| 1461 | if is_polar "$CLI_CMD"; then |
| 1462 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1463 | fi |
| 1464 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1465 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1466 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1467 | # Check for failure conditions after a test case. |
| 1468 | # |
| 1469 | # Inputs from run_test: |
| 1470 | # * positional parameters: test options (see run_test documentation) |
| 1471 | # * $CLI_EXIT: client return code |
| 1472 | # * $CLI_EXPECT: expected client return code |
| 1473 | # * $SRV_RET: server return code |
| 1474 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1475 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1476 | # |
| 1477 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1478 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1479 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1480 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1481 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1482 | if [ $TIMES_LEFT -gt 0 ] && |
| 1483 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1484 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1485 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1486 | return |
| 1487 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1488 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1489 | # 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] | 1490 | # (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] | 1491 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1492 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1493 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1494 | then |
| 1495 | if is_polar "$SRV_CMD"; then |
| 1496 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1497 | else |
| 1498 | fail "server or client failed to reach handshake stage" |
| 1499 | return |
| 1500 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1501 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1502 | if is_polar "$CLI_CMD"; then |
| 1503 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1504 | else |
| 1505 | fail "server or client failed to reach handshake stage" |
| 1506 | return |
| 1507 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1508 | fi |
| 1509 | fi |
| 1510 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1511 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1512 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1513 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1514 | # care anyway), in case e.g. the server reports a memory leak. |
| 1515 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1516 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1517 | return |
| 1518 | fi |
| 1519 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1520 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1521 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1522 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1523 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1524 | 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] | 1525 | return |
| 1526 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1527 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1528 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1529 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1530 | # 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] | 1531 | while [ $# -gt 0 ] |
| 1532 | do |
| 1533 | case $1 in |
| 1534 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1535 | 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] | 1536 | fail "pattern '$2' MUST be present in the Server output" |
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 :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1543 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1544 | return |
| 1545 | fi |
| 1546 | ;; |
| 1547 | |
| 1548 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1549 | 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] | 1550 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1551 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1552 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1553 | return |
| 1554 | fi |
| 1555 | ;; |
| 1556 | |
| 1557 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1558 | 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] | 1559 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1560 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1561 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1562 | return |
| 1563 | fi |
| 1564 | ;; |
| 1565 | |
| 1566 | # The filtering in the following two options (-u and -U) do the following |
| 1567 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1568 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1569 | # - keep one of each non-unique line |
| 1570 | # - count how many lines remain |
| 1571 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1572 | # if there were no duplicates. |
| 1573 | "-U") |
| 1574 | 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 |
| 1575 | fail "lines following pattern '$2' must be unique in Server output" |
| 1576 | return |
| 1577 | fi |
| 1578 | ;; |
| 1579 | |
| 1580 | "-u") |
| 1581 | 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 |
| 1582 | 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] | 1583 | return |
| 1584 | fi |
| 1585 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1586 | "-F") |
| 1587 | if ! $2 "$SRV_OUT"; then |
| 1588 | fail "function call to '$2' failed on Server output" |
| 1589 | return |
| 1590 | fi |
| 1591 | ;; |
| 1592 | "-f") |
| 1593 | if ! $2 "$CLI_OUT"; then |
| 1594 | fail "function call to '$2' failed on Client output" |
| 1595 | return |
| 1596 | fi |
| 1597 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1598 | "-g") |
| 1599 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1600 | fail "function call to '$2' failed on Server and Client output" |
| 1601 | return |
| 1602 | fi |
| 1603 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1604 | |
| 1605 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1606 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1607 | exit 1 |
| 1608 | esac |
| 1609 | shift 2 |
| 1610 | done |
| 1611 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1612 | # check valgrind's results |
| 1613 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1614 | 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] | 1615 | fail "Server has memory errors" |
| 1616 | return |
| 1617 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1618 | 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] | 1619 | fail "Client has memory errors" |
| 1620 | return |
| 1621 | fi |
| 1622 | fi |
| 1623 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1624 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1625 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1626 | } |
| 1627 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1628 | # Run the current test case: start the server and if applicable the proxy, run |
| 1629 | # the client, wait for all processes to finish or time out. |
| 1630 | # |
| 1631 | # Inputs: |
| 1632 | # * $NAME: test case name |
| 1633 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1634 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1635 | # |
| 1636 | # Outputs: |
| 1637 | # * $CLI_EXIT: client return code |
| 1638 | # * $SRV_RET: server return code |
| 1639 | do_run_test_once() { |
| 1640 | # run the commands |
| 1641 | if [ -n "$PXY_CMD" ]; then |
| 1642 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1643 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1644 | PXY_PID=$! |
| 1645 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1646 | fi |
| 1647 | |
| 1648 | check_osrv_dtls |
| 1649 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1650 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1651 | SRV_PID=$! |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1652 | wait_server_start "$THIS_SRV_PORT" "$SRV_PID" |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1653 | |
| 1654 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1655 | # The client must be a subprocess of the script in order for killing it to |
| 1656 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1657 | # not at the end of the line: the latter approach will spawn eval as a |
| 1658 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1659 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1660 | wait_client_done |
| 1661 | |
| 1662 | sleep 0.05 |
| 1663 | |
| 1664 | # terminate the server (and the proxy) |
| 1665 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1666 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1667 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1668 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1669 | SRV_RET=$? |
| 1670 | |
| 1671 | if [ -n "$PXY_CMD" ]; then |
| 1672 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1673 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1674 | fi |
| 1675 | } |
| 1676 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1677 | # 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] | 1678 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1679 | # |
| 1680 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1681 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1682 | # for the sake of tests' filtering (especially in conjunction with the |
| 1683 | # detect_required_features() function), it does NOT guarantee that the |
| 1684 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1685 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1686 | # that we are going to use TLS 1.2 |
| 1687 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1688 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1689 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1690 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1691 | *tls12*) |
| 1692 | echo "TLS12" |
| 1693 | return;; |
| 1694 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1695 | echo "TLS13" |
| 1696 | return;; |
| 1697 | esac |
| 1698 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1699 | *tls12*) |
| 1700 | echo "TLS12" |
| 1701 | return;; |
| 1702 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1703 | echo "TLS13" |
| 1704 | return;; |
| 1705 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1706 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1707 | case $1 in |
| 1708 | tls1_2*) |
| 1709 | echo "TLS12" |
| 1710 | return;; |
| 1711 | *tls1_3) |
| 1712 | echo "TLS13" |
| 1713 | return;; |
| 1714 | esac |
| 1715 | case $2 in |
| 1716 | *tls1_2) |
| 1717 | echo "TLS12" |
| 1718 | return;; |
| 1719 | *tls1_3) |
| 1720 | echo "TLS13" |
| 1721 | return;; |
| 1722 | esac |
| 1723 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1724 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 9404169 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1725 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1726 | then |
| 1727 | echo "TLS13" |
| 1728 | else |
| 1729 | echo "TLS12" |
| 1730 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1731 | } |
| 1732 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1733 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1734 | # Options: -s pattern pattern that must be present in server output |
| 1735 | # -c pattern pattern that must be present in client output |
| 1736 | # -u pattern lines after pattern must be unique in client output |
| 1737 | # -f call shell function on client output |
| 1738 | # -S pattern pattern that must be absent in server output |
| 1739 | # -C pattern pattern that must be absent in client output |
| 1740 | # -U pattern lines after pattern must be unique in server output |
| 1741 | # -F call shell function on server output |
| 1742 | # -g call shell function on server and client output |
| 1743 | run_test() { |
| 1744 | NAME="$1" |
| 1745 | shift 1 |
| 1746 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1747 | if is_excluded "$NAME"; then |
| 1748 | SKIP_NEXT="NO" |
| 1749 | # There was no request to run the test, so don't record its outcome. |
| 1750 | return |
| 1751 | fi |
| 1752 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1753 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1754 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1755 | return |
| 1756 | fi |
| 1757 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1758 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1759 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1760 | # Do not skip next test and skip current test. |
| 1761 | SKIP_NEXT="NO" |
| 1762 | return |
| 1763 | fi |
| 1764 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1765 | print_name "$NAME" |
| 1766 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1767 | # Do we only run numbered tests? |
| 1768 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1769 | case ",$RUN_TEST_NUMBER," in |
| 1770 | *",$TESTS,"*) :;; |
| 1771 | *) SKIP_NEXT="YES";; |
| 1772 | esac |
| 1773 | fi |
| 1774 | |
Gilles Peskine | ae710c8 | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1775 | # Does this test specify a proxy? |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1776 | if [ "X$1" = "X-p" ]; then |
| 1777 | PXY_CMD="$2" |
| 1778 | shift 2 |
| 1779 | else |
| 1780 | PXY_CMD="" |
| 1781 | fi |
| 1782 | |
Gilles Peskine | 2bc5c80 | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1783 | # Does this test force a specific port? |
| 1784 | if [ "$1" = "-P" ]; then |
| 1785 | THIS_SRV_PORT="$2" |
| 1786 | shift 2 |
| 1787 | else |
| 1788 | THIS_SRV_PORT="$SRV_PORT" |
| 1789 | fi |
| 1790 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1791 | # get commands and client output |
| 1792 | SRV_CMD="$1" |
| 1793 | CLI_CMD="$2" |
| 1794 | CLI_EXPECT="$3" |
| 1795 | shift 3 |
| 1796 | |
| 1797 | # Check if test uses files |
| 1798 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1799 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1801 | esac |
| 1802 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1803 | # Check if the test uses DTLS. |
| 1804 | detect_dtls "$SRV_CMD" |
| 1805 | if [ "$DTLS" -eq 1 ]; then |
| 1806 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1807 | fi |
| 1808 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1809 | # 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] | 1810 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1811 | |
Gilles Peskine | cc7d6ae | 2024-09-11 21:03:05 +0200 | [diff] [blame] | 1812 | # Guess the TLS version which is going to be used. |
| 1813 | # Note that this detection is wrong in some cases, which causes unduly |
| 1814 | # skipped test cases in builds with TLS 1.3 but not TLS 1.2. |
| 1815 | # https://github.com/Mbed-TLS/mbedtls/issues/9560 |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1816 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1817 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1818 | else |
| 1819 | TLS_VERSION="TLS12" |
| 1820 | fi |
| 1821 | |
Gilles Peskine | 4f09864 | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1822 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1823 | maybe_adapt_for_psk "$@" |
| 1824 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1825 | # 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] | 1826 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1827 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1828 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1829 | |
| 1830 | # should we skip? |
| 1831 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1832 | SKIP_NEXT="NO" |
| 1833 | record_outcome "SKIP" |
| 1834 | SKIPS=$(( $SKIPS + 1 )) |
| 1835 | return |
| 1836 | fi |
| 1837 | |
| 1838 | analyze_test_commands "$@" |
| 1839 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1840 | # One regular run and two retries |
| 1841 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1842 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1843 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1844 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1845 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1846 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1847 | check_test_failure "$@" |
| 1848 | case $outcome in |
| 1849 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1850 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1851 | FAIL) return;; |
| 1852 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1853 | done |
| 1854 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1855 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1856 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1857 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1858 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1859 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1860 | if [ -n "$PXY_CMD" ]; then |
| 1861 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1862 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1863 | fi |
| 1864 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1865 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1866 | } |
| 1867 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1868 | run_test_psa() { |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1869 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1870 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1871 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1872 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1873 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1874 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1875 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1876 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1877 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1878 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1879 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1880 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1881 | -S "error" \ |
| 1882 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1883 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1884 | } |
| 1885 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1886 | run_test_psa_force_curve() { |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1887 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1888 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1889 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1890 | "$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] | 1891 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1892 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1893 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1894 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1895 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1896 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1897 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1898 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1899 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1900 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1901 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1902 | } |
| 1903 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1904 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1905 | # a maximum fragment length. |
| 1906 | # first argument ($1) is MFL for SSL client |
| 1907 | # 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] | 1908 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1909 | { |
| 1910 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1911 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1912 | |
| 1913 | # Leave some margin for robustness |
| 1914 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1915 | |
| 1916 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1917 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1918 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1919 | 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] | 1920 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1921 | 0 \ |
| 1922 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1923 | } |
| 1924 | |
| 1925 | |
| 1926 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1927 | # 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] | 1928 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1929 | { |
| 1930 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1931 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1932 | |
| 1933 | # first test with default MFU is to get reference memory usage |
| 1934 | MEMORY_USAGE_MFL_16K=0 |
| 1935 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1936 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1937 | "$P_CLI debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1938 | 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] | 1939 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1940 | 0 \ |
| 1941 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1942 | |
| 1943 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1944 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1945 | |
| 1946 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1947 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1948 | |
| 1949 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1950 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1951 | |
| 1952 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1953 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1954 | } |
| 1955 | |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 1956 | run_test_export_keying_material() { |
| 1957 | unset EXPORTED_KEY1 |
| 1958 | unset EXPORTED_KEY2 |
| 1959 | TLS_VERSION="$1" |
Max Fillinger | f8059db | 2024-11-13 15:27:23 +0100 | [diff] [blame] | 1960 | |
| 1961 | case $TLS_VERSION in |
| 1962 | tls12) TLS_VERSION_PRINT="TLS 1.2";; |
| 1963 | tls13) TLS_VERSION_PRINT="TLS 1.3";; |
| 1964 | esac |
| 1965 | |
| 1966 | run_test "$TLS_VERSION_PRINT: Export keying material" \ |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 1967 | "$P_SRV debug_level=4 force_version=$TLS_VERSION exp_label=test-label" \ |
| 1968 | "$P_CLI debug_level=4 force_version=$TLS_VERSION exp_label=test-label" \ |
| 1969 | 0 \ |
| 1970 | -s "Exporting key of length 20 with label \".*\": 0x" \ |
| 1971 | -c "Exporting key of length 20 with label \".*\": 0x" \ |
| 1972 | -f get_exported_key \ |
| 1973 | -F check_exported_key |
| 1974 | } |
| 1975 | |
| 1976 | run_test_export_keying_material_openssl_compat() { |
| 1977 | unset EXPORTED_KEY1 |
| 1978 | unset EXPORTED_KEY2 |
| 1979 | TLS_VERSION="$1" |
Max Fillinger | f8059db | 2024-11-13 15:27:23 +0100 | [diff] [blame] | 1980 | |
Max Fillinger | 4e21703 | 2024-11-14 17:50:42 +0100 | [diff] [blame] | 1981 | case $TLS_VERSION in |
| 1982 | tls12) TLS_VERSION_PRINT="TLS 1.2"; OPENSSL_CLIENT="$O_CLI";; |
| 1983 | tls13) TLS_VERSION_PRINT="TLS 1.3"; OPENSSL_CLIENT="$O_NEXT_CLI";; |
Max Fillinger | f8059db | 2024-11-13 15:27:23 +0100 | [diff] [blame] | 1984 | esac |
| 1985 | |
| 1986 | run_test "$TLS_VERSION_PRINT: Export keying material (OpenSSL compatibility)" \ |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 1987 | "$P_SRV debug_level=4 force_version=$TLS_VERSION exp_label=test-label" \ |
Max Fillinger | 4e21703 | 2024-11-14 17:50:42 +0100 | [diff] [blame] | 1988 | "$OPENSSL_CLIENT -keymatexport test-label" \ |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 1989 | 0 \ |
| 1990 | -s "Exporting key of length 20 with label \".*\": 0x" \ |
| 1991 | -c "Keying material exporter:" \ |
| 1992 | -F get_exported_key \ |
| 1993 | -f check_exported_key_openssl |
| 1994 | } |
| 1995 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1996 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1997 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1998 | rm -f context_srv.txt |
| 1999 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 2000 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 2001 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 2002 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 2003 | 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] | 2004 | exit 1 |
| 2005 | } |
| 2006 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 2007 | # |
| 2008 | # MAIN |
| 2009 | # |
| 2010 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 2011 | # Make the outcome file path relative to the original directory, not |
| 2012 | # to .../tests |
| 2013 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 2014 | [!/]*) |
| 2015 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 2016 | ;; |
| 2017 | esac |
| 2018 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 2019 | populate_enabled_hash_algs |
| 2020 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2021 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 2022 | # patterns rather than regular expressions, use a case statement instead |
| 2023 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 2024 | # detects simple cases: plain substring, everything, nothing. |
| 2025 | # |
| 2026 | # As an exception, the character '.' is treated as an ordinary character |
| 2027 | # if it is the only special character in the string. This is because it's |
| 2028 | # rare to need "any one character", but needing a literal '.' is common |
| 2029 | # (e.g. '-f "DTLS 1.2"'). |
| 2030 | need_grep= |
| 2031 | case "$FILTER" in |
| 2032 | '^$') simple_filter=;; |
| 2033 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 2034 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2035 | need_grep=1;; |
| 2036 | *) # No regexp or shell-pattern special character |
| 2037 | simple_filter="*$FILTER*";; |
| 2038 | esac |
| 2039 | case "$EXCLUDE" in |
| 2040 | '^$') simple_exclude=;; |
| 2041 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 2042 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2043 | need_grep=1;; |
| 2044 | *) # No regexp or shell-pattern special character |
| 2045 | simple_exclude="*$EXCLUDE*";; |
| 2046 | esac |
| 2047 | if [ -n "$need_grep" ]; then |
| 2048 | is_excluded () { |
| 2049 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 2050 | } |
| 2051 | else |
| 2052 | is_excluded () { |
| 2053 | case "$1" in |
| 2054 | $simple_exclude) true;; |
| 2055 | $simple_filter) false;; |
| 2056 | *) true;; |
| 2057 | esac |
| 2058 | } |
| 2059 | fi |
| 2060 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 2061 | # Filter tests according to TEST_SUITE_NAME |
| 2062 | is_excluded_test_suite () { |
| 2063 | if [ -n "$RUN_TEST_SUITE" ] |
| 2064 | then |
| 2065 | case ",$RUN_TEST_SUITE," in |
| 2066 | *",$1,"*) false;; |
| 2067 | *) true;; |
| 2068 | esac |
| 2069 | else |
| 2070 | false |
| 2071 | fi |
| 2072 | |
| 2073 | } |
| 2074 | |
| 2075 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2076 | if [ "$LIST_TESTS" -eq 0 ];then |
| 2077 | |
| 2078 | # sanity checks, avoid an avalanche of errors |
| 2079 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 2080 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 2081 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 2082 | if [ ! -x "$P_SRV_BIN" ]; then |
| 2083 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2084 | exit 1 |
| 2085 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2086 | if [ ! -x "$P_CLI_BIN" ]; then |
| 2087 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 2088 | exit 1 |
| 2089 | fi |
| 2090 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2091 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2092 | exit 1 |
| 2093 | fi |
| 2094 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2095 | if which valgrind >/dev/null 2>&1; then :; else |
| 2096 | echo "Memcheck not possible. Valgrind not found" |
| 2097 | exit 1 |
| 2098 | fi |
| 2099 | fi |
| 2100 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2101 | echo "Command '$OPENSSL' not found" |
| 2102 | exit 1 |
| 2103 | fi |
| 2104 | |
| 2105 | # used by watchdog |
| 2106 | MAIN_PID="$$" |
| 2107 | |
| 2108 | # We use somewhat arbitrary delays for tests: |
| 2109 | # - how long do we wait for the server to start (when lsof not available)? |
| 2110 | # - how long do we allow for the client to finish? |
| 2111 | # (not to check performance, just to avoid waiting indefinitely) |
| 2112 | # Things are slower with valgrind, so give extra time here. |
| 2113 | # |
| 2114 | # Note: without lsof, there is a trade-off between the running time of this |
| 2115 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2116 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2117 | # the script, only the case where a client or server gets stuck. |
| 2118 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2119 | START_DELAY=6 |
| 2120 | DOG_DELAY=60 |
| 2121 | else |
| 2122 | START_DELAY=2 |
| 2123 | DOG_DELAY=20 |
| 2124 | fi |
| 2125 | |
| 2126 | # some particular tests need more time: |
| 2127 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2128 | # - for the server, we sleep for a number of seconds after the client exits |
| 2129 | # see client_need_more_time() and server_needs_more_time() |
| 2130 | CLI_DELAY_FACTOR=1 |
| 2131 | SRV_DELAY_SECONDS=0 |
| 2132 | |
| 2133 | # fix commands to use this port, force IPv4 while at it |
| 2134 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2135 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2136 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2137 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2138 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2139 | 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"}" |
| 2140 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2141 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2142 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2143 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2144 | |
| 2145 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2146 | # low-security ones. This covers not just cipher suites but also protocol |
| 2147 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2148 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2149 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2150 | # a way to discover it from -help, so check the openssl version. |
| 2151 | case $($OPENSSL version) in |
| 2152 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2153 | *) |
| 2154 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2155 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2156 | ;; |
| 2157 | esac |
| 2158 | |
| 2159 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2160 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2161 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2162 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2163 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2164 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2165 | fi |
| 2166 | |
| 2167 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2168 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2169 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2170 | fi |
| 2171 | |
| 2172 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2173 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2174 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2175 | fi |
| 2176 | |
| 2177 | # Allow SHA-1, because many of our test certificates use it |
| 2178 | P_SRV="$P_SRV allow_sha1=1" |
| 2179 | P_CLI="$P_CLI allow_sha1=1" |
| 2180 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2181 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2182 | # Also pick a unique name for intermediate files |
| 2183 | SRV_OUT="srv_out.$$" |
| 2184 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2185 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2186 | SESSION="session.$$" |
| 2187 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2188 | SKIP_NEXT="NO" |
| 2189 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2190 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2191 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2192 | # Basic test |
| 2193 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2194 | # Checks that: |
| 2195 | # - 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] | 2196 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2197 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2198 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2199 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2200 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2201 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2202 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2203 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2204 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2205 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2206 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2207 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2208 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2209 | -S "error" \ |
| 2210 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2213 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2214 | run_test "Default, DTLS" \ |
| 2215 | "$P_SRV dtls=1" \ |
| 2216 | "$P_CLI dtls=1" \ |
| 2217 | 0 \ |
| 2218 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2219 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2220 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2221 | run_test "TLS client auth: required" \ |
| 2222 | "$P_SRV auth_mode=required" \ |
| 2223 | "$P_CLI" \ |
| 2224 | 0 \ |
| 2225 | -s "Verifying peer X.509 certificate... ok" |
| 2226 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2227 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2228 | "$P_SRV" \ |
| 2229 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2230 | 0 \ |
| 2231 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2232 | -c "Key size is 256" |
| 2233 | |
| 2234 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2235 | "$P_SRV" \ |
| 2236 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2237 | 0 \ |
| 2238 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2239 | -c "Key size is 128" |
| 2240 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2241 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2242 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2243 | # module does not support PSA dispatching so we need builtin support. |
| 2244 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2245 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2246 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2247 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2248 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2249 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2250 | "$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] | 2251 | 0 |
| 2252 | |
| 2253 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2254 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2255 | # module does not support PSA dispatching so we need builtin support. |
| 2256 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2257 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2258 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2259 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2260 | run_test "TLS: password protected server key" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2261 | "$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] | 2262 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2263 | 0 |
| 2264 | |
| 2265 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2267 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2268 | # module does not support PSA dispatching so we need builtin support. |
| 2269 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2270 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | d50e843 | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2271 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2272 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2273 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2274 | "$P_SRV force_version=tls12\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2275 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2276 | 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] | 2277 | "$P_CLI" \ |
| 2278 | 0 |
| 2279 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2281 | run_test "CA callback on client" \ |
| 2282 | "$P_SRV debug_level=3" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2283 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2284 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2285 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2286 | -S "error" \ |
| 2287 | -C "error" |
| 2288 | |
| 2289 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2290 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2291 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2292 | run_test "CA callback on server" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2293 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2294 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2295 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2296 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2297 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2298 | -s "Verifying peer X.509 certificate... ok" \ |
| 2299 | -S "error" \ |
| 2300 | -C "error" |
| 2301 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2302 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2303 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2305 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2306 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2307 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2308 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2309 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2310 | 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] | 2311 | 0 \ |
| 2312 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2313 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2314 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2315 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2316 | -S "error" \ |
| 2317 | -C "error" |
| 2318 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2319 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2320 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2323 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2324 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2325 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2326 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2327 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2328 | 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] | 2329 | 0 \ |
| 2330 | -c "key type: Opaque" \ |
| 2331 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2332 | -s "Verifying peer X.509 certificate... ok" \ |
| 2333 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2334 | -S "error" \ |
| 2335 | -C "error" |
| 2336 | |
| 2337 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2340 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2341 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2342 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2343 | 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] | 2344 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2345 | 0 \ |
| 2346 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2347 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2348 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2349 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2350 | -S "error" \ |
| 2351 | -C "error" |
| 2352 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2354 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2355 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2356 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2357 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2358 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2359 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2360 | 0 \ |
| 2361 | -c "Verifying peer X.509 certificate... ok" \ |
| 2362 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2363 | -s "key types: Opaque, none" \ |
| 2364 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2365 | -S "error" \ |
| 2366 | -C "error" |
| 2367 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2370 | requires_config_enabled MBEDTLS_RSA_C |
| 2371 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2372 | requires_hash_alg SHA_256 |
| 2373 | 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] | 2374 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2375 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2376 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2377 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2378 | 1 \ |
| 2379 | -s "key types: Opaque, none" \ |
| 2380 | -s "error" \ |
| 2381 | -c "error" \ |
| 2382 | -c "Public key type mismatch" |
| 2383 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2385 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2387 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2388 | 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] | 2389 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2390 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2391 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2392 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2393 | 1 \ |
| 2394 | -s "key types: Opaque, none" \ |
| 2395 | -s "got ciphersuites in common, but none of them usable" \ |
| 2396 | -s "error" \ |
| 2397 | -c "error" |
| 2398 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2400 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2401 | 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] | 2402 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2403 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2404 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2405 | "$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] | 2406 | 1 \ |
| 2407 | -s "key types: Opaque, none" \ |
| 2408 | -s "got ciphersuites in common, but none of them usable" \ |
| 2409 | -s "error" \ |
| 2410 | -c "error" |
| 2411 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2412 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2413 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2414 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2415 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2416 | 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] | 2417 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2418 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2419 | 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] | 2420 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2421 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2422 | 0 \ |
| 2423 | -c "Verifying peer X.509 certificate... ok" \ |
| 2424 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2425 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2426 | -s "key types: Opaque, Opaque" \ |
| 2427 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2428 | -S "error" \ |
| 2429 | -C "error" |
| 2430 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 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_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2450 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2451 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2452 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2453 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2454 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2455 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2456 | 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] | 2457 | "$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] | 2458 | 0 \ |
| 2459 | -c "Verifying peer X.509 certificate... ok" \ |
| 2460 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2461 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2462 | -s "key types: Opaque, Opaque" \ |
| 2463 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2464 | -S "error" \ |
| 2465 | -C "error" |
| 2466 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2468 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2469 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2470 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2471 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Gabor Mezei | 3ead04a | 2025-02-27 14:30:35 +0100 | [diff] [blame] | 2472 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2473 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-sign-pkcs1,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2474 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2475 | -c "key type: Opaque" \ |
| 2476 | -s "key types: Opaque, Opaque" \ |
| 2477 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2478 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2479 | |
| 2480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2481 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2483 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2484 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Gabor Mezei | 3ead04a | 2025-02-27 14:30:35 +0100 | [diff] [blame] | 2485 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pkcs1,rsa-sign-pss" \ |
| 2486 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-sign-pkcs1,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2487 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2488 | -c "key type: Opaque" \ |
| 2489 | -s "key types: Opaque, Opaque" \ |
| 2490 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2491 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2492 | |
| 2493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2495 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2496 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2497 | 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] | 2498 | "$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] | 2499 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2500 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2501 | -s "key types: Opaque, Opaque" \ |
| 2502 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2503 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2504 | -C "error" \ |
| 2505 | -S "error" \ |
| 2506 | |
| 2507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2510 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2511 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Gabor Mezei | 1ac784c | 2025-03-20 09:15:47 +0100 | [diff] [blame] | 2512 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-sign-pkcs1,rsa-sign-pss" \ |
Gabor Mezei | 3ead04a | 2025-02-27 14:30:35 +0100 | [diff] [blame] | 2513 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-sign-pkcs1,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2514 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2515 | -c "key type: Opaque" \ |
| 2516 | -s "key types: Opaque, Opaque" \ |
| 2517 | -C "error" \ |
| 2518 | -S "error" \ |
| 2519 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2520 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2524 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2525 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2526 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2527 | 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] | 2528 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2529 | 0 \ |
| 2530 | -c "Verifying peer X.509 certificate... ok" \ |
| 2531 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2532 | -s "key types: Opaque, none" \ |
| 2533 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2534 | -S "error" \ |
| 2535 | -C "error" |
| 2536 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2539 | requires_hash_alg SHA_256 |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
| 2541 | run_test "Opaque key for server authentication: ECDHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2542 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2543 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2544 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2545 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2546 | 1 \ |
| 2547 | -s "key types: Opaque, none" \ |
| 2548 | -s "got ciphersuites in common, but none of them usable" \ |
| 2549 | -s "error" \ |
| 2550 | -c "error" |
| 2551 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2552 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2553 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2554 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2555 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2557 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2558 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2559 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2560 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2561 | 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] | 2562 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2563 | 0 \ |
| 2564 | -c "Verifying peer X.509 certificate... ok" \ |
| 2565 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2566 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2567 | -s "key types: Opaque, Opaque" \ |
| 2568 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2569 | -S "error" \ |
| 2570 | -C "error" |
| 2571 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2573 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2574 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2575 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2576 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2577 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2578 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2579 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2580 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2581 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2582 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2583 | 0 \ |
| 2584 | -c "Verifying peer X.509 certificate... ok" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2585 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2586 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2587 | -s "key types: Opaque, Opaque" \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 2588 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2589 | -S "error" \ |
| 2590 | -C "error" |
| 2591 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2592 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2594 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2595 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2596 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2597 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2598 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2599 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2600 | 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] | 2601 | 0 \ |
| 2602 | -c "key type: Opaque" \ |
| 2603 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2604 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2605 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2606 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2607 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2608 | -S "error" \ |
| 2609 | -C "error" |
| 2610 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2611 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2613 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2614 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2616 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2617 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2618 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2619 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2620 | 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] | 2621 | 0 \ |
| 2622 | -c "key type: Opaque" \ |
| 2623 | -c "Verifying peer X.509 certificate... ok" \ |
| 2624 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2625 | -s "key types: Opaque, none" \ |
| 2626 | -s "Verifying peer X.509 certificate... ok" \ |
| 2627 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2628 | -S "error" \ |
| 2629 | -C "error" |
| 2630 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2631 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2632 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2633 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2634 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2635 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2636 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2637 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2638 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2639 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2640 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2641 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2642 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2643 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2644 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2645 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2646 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2647 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2648 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2649 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2650 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2651 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2652 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2653 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2654 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2655 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2656 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2657 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2658 | run_test_psa_force_curve "secp224r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2659 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2660 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2661 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2662 | run_test_psa_force_curve "secp192k1" |
| 2663 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2664 | # Test current time in ServerHello |
| 2665 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2666 | run_test "ServerHello contains gmt_unix_time" \ |
| 2667 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2668 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2669 | 0 \ |
| 2670 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2671 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2672 | |
| 2673 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2674 | run_test "Unique IV in GCM" \ |
| 2675 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2676 | "$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] | 2677 | 0 \ |
| 2678 | -u "IV used" \ |
| 2679 | -U "IV used" |
| 2680 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2681 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2682 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2683 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2684 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2685 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2687 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2688 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2689 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2690 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2691 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2692 | "$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] | 2693 | 0 \ |
| 2694 | -c "Supported Signature Algorithm found: 04 03" |
| 2695 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2697 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | cd4fe70 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2698 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2699 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2700 | requires_hash_alg SHA_256 |
| 2701 | run_test "Single supported algorithm sending: openssl client" \ |
| 2702 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2703 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2704 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2705 | 0 |
| 2706 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2707 | # Tests for certificate verification callback |
| 2708 | run_test "Configuration-specific CRT verification callback" \ |
| 2709 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2710 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2711 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2712 | -S "error" \ |
| 2713 | -c "Verify requested for " \ |
| 2714 | -c "Use configuration-specific verification callback" \ |
| 2715 | -C "Use context-specific verification callback" \ |
| 2716 | -C "error" |
| 2717 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2718 | run_test "Context-specific CRT verification callback" \ |
| 2719 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 843a00d | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2720 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2721 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2722 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2723 | -c "Verify requested for " \ |
| 2724 | -c "Use context-specific verification callback" \ |
| 2725 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2726 | -C "error" |
| 2727 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2728 | # Tests for SHA-1 support |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2729 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2730 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2731 | "$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] | 2732 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2733 | 1 \ |
| 2734 | -c "The certificate is signed with an unacceptable hash" |
| 2735 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2736 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2737 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2738 | "$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] | 2739 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2740 | 0 |
| 2741 | |
| 2742 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2743 | "$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] | 2744 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2745 | 0 |
| 2746 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2747 | requires_hash_alg SHA_1 |
| 2748 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2749 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2750 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2751 | "$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] | 2752 | 1 \ |
| 2753 | -s "The certificate is signed with an unacceptable hash" |
| 2754 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2755 | requires_hash_alg SHA_1 |
| 2756 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2757 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2758 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2759 | "$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] | 2760 | 0 |
| 2761 | |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2762 | requires_config_enabled MBEDTLS_RSA_C |
| 2763 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2764 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2765 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2766 | "$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] | 2767 | 0 |
| 2768 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2769 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2771 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2772 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2773 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2774 | 0 \ |
| 2775 | -c "next record in same datagram" \ |
| 2776 | -s "next record in same datagram" |
| 2777 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2779 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2780 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2781 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2782 | 0 \ |
| 2783 | -s "next record in same datagram" \ |
| 2784 | -C "next record in same datagram" |
| 2785 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2787 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2788 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2789 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2790 | 0 \ |
| 2791 | -S "next record in same datagram" \ |
| 2792 | -c "next record in same datagram" |
| 2793 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2795 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2796 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2797 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2798 | 0 \ |
| 2799 | -S "next record in same datagram" \ |
| 2800 | -C "next record in same datagram" |
| 2801 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2802 | # Tests for Context serialization |
| 2803 | |
| 2804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2805 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2806 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2807 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2808 | 0 \ |
| 2809 | -c "Deserializing connection..." \ |
| 2810 | -S "Deserializing connection..." |
| 2811 | |
| 2812 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2813 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2814 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2815 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2816 | 0 \ |
| 2817 | -c "Deserializing connection..." \ |
| 2818 | -S "Deserializing connection..." |
| 2819 | |
| 2820 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2821 | run_test "Context serialization, client serializes, GCM" \ |
| 2822 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2823 | "$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] | 2824 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2825 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2826 | -S "Deserializing connection..." |
| 2827 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2829 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2830 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2831 | run_test "Context serialization, client serializes, with CID" \ |
| 2832 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2833 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2834 | 0 \ |
| 2835 | -c "Deserializing connection..." \ |
| 2836 | -S "Deserializing connection..." |
| 2837 | |
| 2838 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2839 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2840 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2841 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2842 | 0 \ |
| 2843 | -C "Deserializing connection..." \ |
| 2844 | -s "Deserializing connection..." |
| 2845 | |
| 2846 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2847 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2848 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2849 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2850 | 0 \ |
| 2851 | -C "Deserializing connection..." \ |
| 2852 | -s "Deserializing connection..." |
| 2853 | |
| 2854 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2855 | run_test "Context serialization, server serializes, GCM" \ |
| 2856 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2857 | "$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] | 2858 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2859 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2860 | -s "Deserializing connection..." |
| 2861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2863 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2864 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2865 | run_test "Context serialization, server serializes, with CID" \ |
| 2866 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2867 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2868 | 0 \ |
| 2869 | -C "Deserializing connection..." \ |
| 2870 | -s "Deserializing connection..." |
| 2871 | |
| 2872 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2873 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2874 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2875 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2876 | 0 \ |
| 2877 | -c "Deserializing connection..." \ |
| 2878 | -s "Deserializing connection..." |
| 2879 | |
| 2880 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2881 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2882 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2883 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2884 | 0 \ |
| 2885 | -c "Deserializing connection..." \ |
| 2886 | -s "Deserializing connection..." |
| 2887 | |
| 2888 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2889 | run_test "Context serialization, both serialize, GCM" \ |
| 2890 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2891 | "$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] | 2892 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2893 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2894 | -s "Deserializing connection..." |
| 2895 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2898 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2899 | run_test "Context serialization, both serialize, with CID" \ |
| 2900 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2901 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2902 | 0 \ |
| 2903 | -c "Deserializing connection..." \ |
| 2904 | -s "Deserializing connection..." |
| 2905 | |
| 2906 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2907 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2908 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2909 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2910 | 0 \ |
| 2911 | -c "Deserializing connection..." \ |
| 2912 | -S "Deserializing connection..." |
| 2913 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2916 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2917 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2918 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2919 | 0 \ |
| 2920 | -c "Deserializing connection..." \ |
| 2921 | -S "Deserializing connection..." |
| 2922 | |
| 2923 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2924 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2925 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2926 | "$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] | 2927 | 0 \ |
| 2928 | -c "Deserializing connection..." \ |
| 2929 | -S "Deserializing connection..." |
| 2930 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2933 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2934 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2935 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2936 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2937 | 0 \ |
| 2938 | -c "Deserializing connection..." \ |
| 2939 | -S "Deserializing connection..." |
| 2940 | |
| 2941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2942 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2943 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2944 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2945 | 0 \ |
| 2946 | -C "Deserializing connection..." \ |
| 2947 | -s "Deserializing connection..." |
| 2948 | |
| 2949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2950 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2951 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2952 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2953 | 0 \ |
| 2954 | -C "Deserializing connection..." \ |
| 2955 | -s "Deserializing connection..." |
| 2956 | |
| 2957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2958 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2959 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2960 | "$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] | 2961 | 0 \ |
| 2962 | -C "Deserializing connection..." \ |
| 2963 | -s "Deserializing connection..." |
| 2964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2967 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2968 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2969 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2970 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2971 | 0 \ |
| 2972 | -C "Deserializing connection..." \ |
| 2973 | -s "Deserializing connection..." |
| 2974 | |
| 2975 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2976 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2977 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2978 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2979 | 0 \ |
| 2980 | -c "Deserializing connection..." \ |
| 2981 | -s "Deserializing connection..." |
| 2982 | |
| 2983 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2984 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2985 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2986 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2987 | 0 \ |
| 2988 | -c "Deserializing connection..." \ |
| 2989 | -s "Deserializing connection..." |
| 2990 | |
| 2991 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2992 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2993 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2994 | "$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] | 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 | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3000 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3001 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3002 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3003 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3004 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3005 | 0 \ |
| 3006 | -c "Deserializing connection..." \ |
| 3007 | -s "Deserializing connection..." |
| 3008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3010 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3011 | run_test "Saving the serialized context to a file" \ |
| 3012 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3013 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3014 | 0 \ |
| 3015 | -s "Save serialized context to a file... ok" \ |
| 3016 | -c "Save serialized context to a file... ok" |
Max Fillinger | 92b7a7e | 2024-11-11 17:50:34 +0100 | [diff] [blame] | 3017 | |
| 3018 | requires_config_enabled MBEDTLS_SSL_KEYING_MATERIAL_EXPORT |
| 3019 | requires_protocol_version tls12 |
| 3020 | run_test_export_keying_material tls12 |
| 3021 | |
| 3022 | requires_config_enabled MBEDTLS_SSL_KEYING_MATERIAL_EXPORT |
| 3023 | requires_protocol_version tls12 |
| 3024 | run_test_export_keying_material_openssl_compat tls12 |
| 3025 | |
| 3026 | requires_config_enabled MBEDTLS_SSL_KEYING_MATERIAL_EXPORT |
| 3027 | requires_protocol_version tls13 |
| 3028 | run_test_export_keying_material tls13 |
| 3029 | |
Max Fillinger | 4e21703 | 2024-11-14 17:50:42 +0100 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_KEYING_MATERIAL_EXPORT |
| 3031 | requires_protocol_version tls13 |
| 3032 | requires_openssl_next |
| 3033 | run_test_export_keying_material_openssl_compat tls13 |
| 3034 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3035 | rm -f context_srv.txt |
| 3036 | rm -f context_cli.txt |
| 3037 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3038 | # Tests for DTLS Connection ID extension |
| 3039 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3040 | # So far, the CID API isn't implemented, so we can't |
| 3041 | # grep for output witnessing its use. This needs to be |
| 3042 | # changed once the CID extension is implemented. |
| 3043 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3045 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3046 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3047 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3048 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3049 | 0 \ |
| 3050 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3051 | -s "found CID extension" \ |
| 3052 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3053 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3054 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3055 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3056 | -C "found CID extension" \ |
| 3057 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3058 | -C "Copy CIDs into SSL transform" \ |
| 3059 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3060 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3063 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3064 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3065 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3066 | 0 \ |
| 3067 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3068 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3069 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3070 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3071 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3072 | -C "found CID extension" \ |
| 3073 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3074 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3075 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3076 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3079 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3080 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3081 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3082 | 0 \ |
| 3083 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3084 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3085 | -c "client hello, adding CID extension" \ |
| 3086 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3087 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3088 | -s "server hello, adding CID extension" \ |
| 3089 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3090 | -c "Use of CID extension negotiated" \ |
| 3091 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3092 | -c "Copy CIDs into SSL transform" \ |
| 3093 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3094 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3095 | -s "Use of Connection ID has been negotiated" \ |
| 3096 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3100 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3101 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3102 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3103 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3104 | 0 \ |
| 3105 | -c "Enable use of CID extension." \ |
| 3106 | -s "Enable use of CID extension." \ |
| 3107 | -c "client hello, adding CID extension" \ |
| 3108 | -s "found CID extension" \ |
| 3109 | -s "Use of CID extension negotiated" \ |
| 3110 | -s "server hello, adding CID extension" \ |
| 3111 | -c "found CID extension" \ |
| 3112 | -c "Use of CID extension negotiated" \ |
| 3113 | -s "Copy CIDs into SSL transform" \ |
| 3114 | -c "Copy CIDs into SSL transform" \ |
| 3115 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3116 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3117 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3118 | -c "Use of Connection ID has been negotiated" \ |
| 3119 | -c "ignoring unexpected CID" \ |
| 3120 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3123 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3124 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3125 | -p "$P_PXY mtu=800" \ |
| 3126 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3127 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3128 | 0 \ |
| 3129 | -c "Enable use of CID extension." \ |
| 3130 | -s "Enable use of CID extension." \ |
| 3131 | -c "client hello, adding CID extension" \ |
| 3132 | -s "found CID extension" \ |
| 3133 | -s "Use of CID extension negotiated" \ |
| 3134 | -s "server hello, adding CID extension" \ |
| 3135 | -c "found CID extension" \ |
| 3136 | -c "Use of CID extension negotiated" \ |
| 3137 | -s "Copy CIDs into SSL transform" \ |
| 3138 | -c "Copy CIDs into SSL transform" \ |
| 3139 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3140 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3141 | -s "Use of Connection ID has been negotiated" \ |
| 3142 | -c "Use of Connection ID has been negotiated" |
| 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, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3147 | -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] | 3148 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3149 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3150 | 0 \ |
| 3151 | -c "Enable use of CID extension." \ |
| 3152 | -s "Enable use of CID extension." \ |
| 3153 | -c "client hello, adding CID extension" \ |
| 3154 | -s "found CID extension" \ |
| 3155 | -s "Use of CID extension negotiated" \ |
| 3156 | -s "server hello, adding CID extension" \ |
| 3157 | -c "found CID extension" \ |
| 3158 | -c "Use of CID extension negotiated" \ |
| 3159 | -s "Copy CIDs into SSL transform" \ |
| 3160 | -c "Copy CIDs into SSL transform" \ |
| 3161 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3162 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3163 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3164 | -c "Use of Connection ID has been negotiated" \ |
| 3165 | -c "ignoring unexpected CID" \ |
| 3166 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3167 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3170 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3171 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3172 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3173 | 0 \ |
| 3174 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3175 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3176 | -c "client hello, adding CID extension" \ |
| 3177 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3178 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3179 | -s "server hello, adding CID extension" \ |
| 3180 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3181 | -c "Use of CID extension negotiated" \ |
| 3182 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3183 | -c "Copy CIDs into SSL transform" \ |
| 3184 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3185 | -s "Peer CID (length 0 Bytes):" \ |
| 3186 | -s "Use of Connection ID has been negotiated" \ |
| 3187 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +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: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3192 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3193 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3194 | 0 \ |
| 3195 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3196 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3197 | -c "client hello, adding CID extension" \ |
| 3198 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3199 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3200 | -s "server hello, adding CID extension" \ |
| 3201 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3202 | -c "Use of CID extension negotiated" \ |
| 3203 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3204 | -c "Copy CIDs into SSL transform" \ |
| 3205 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3206 | -c "Peer CID (length 0 Bytes):" \ |
| 3207 | -s "Use of Connection ID has been negotiated" \ |
| 3208 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3209 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3211 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3212 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3213 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3214 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3215 | 0 \ |
| 3216 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3217 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3218 | -c "client hello, adding CID extension" \ |
| 3219 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3220 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3221 | -s "server hello, adding CID extension" \ |
| 3222 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3223 | -c "Use of CID extension negotiated" \ |
| 3224 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3225 | -c "Copy CIDs into SSL transform" \ |
| 3226 | -S "Use of Connection ID has been negotiated" \ |
| 3227 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3228 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3230 | 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] | 3231 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3232 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3233 | 0 \ |
| 3234 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3235 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3236 | -c "client hello, adding CID extension" \ |
| 3237 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3238 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3239 | -s "server hello, adding CID extension" \ |
| 3240 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3241 | -c "Use of CID extension negotiated" \ |
| 3242 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3243 | -c "Copy CIDs into SSL transform" \ |
| 3244 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3245 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3246 | -s "Use of Connection ID has been negotiated" \ |
| 3247 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3248 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3250 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3251 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3252 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3253 | 0 \ |
| 3254 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3255 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3256 | -c "client hello, adding CID extension" \ |
| 3257 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3258 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3259 | -s "server hello, adding CID extension" \ |
| 3260 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3261 | -c "Use of CID extension negotiated" \ |
| 3262 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3263 | -c "Copy CIDs into SSL transform" \ |
| 3264 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3265 | -s "Peer CID (length 0 Bytes):" \ |
| 3266 | -s "Use of Connection ID has been negotiated" \ |
| 3267 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3268 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3269 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3270 | 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] | 3271 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3272 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3273 | 0 \ |
| 3274 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3275 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3276 | -c "client hello, adding CID extension" \ |
| 3277 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3278 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3279 | -s "server hello, adding CID extension" \ |
| 3280 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3281 | -c "Use of CID extension negotiated" \ |
| 3282 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3283 | -c "Copy CIDs into SSL transform" \ |
| 3284 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3285 | -c "Peer CID (length 0 Bytes):" \ |
| 3286 | -s "Use of Connection ID has been negotiated" \ |
| 3287 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3288 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3289 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3290 | 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] | 3291 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3292 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3293 | 0 \ |
| 3294 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3295 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3296 | -c "client hello, adding CID extension" \ |
| 3297 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3298 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3299 | -s "server hello, adding CID extension" \ |
| 3300 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3301 | -c "Use of CID extension negotiated" \ |
| 3302 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3303 | -c "Copy CIDs into SSL transform" \ |
| 3304 | -S "Use of Connection ID has been negotiated" \ |
| 3305 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3306 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3307 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3308 | 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] | 3309 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3310 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3311 | 0 \ |
| 3312 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3313 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3314 | -c "client hello, adding CID extension" \ |
| 3315 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3316 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3317 | -s "server hello, adding CID extension" \ |
| 3318 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3319 | -c "Use of CID extension negotiated" \ |
| 3320 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3321 | -c "Copy CIDs into SSL transform" \ |
| 3322 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3323 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3324 | -s "Use of Connection ID has been negotiated" \ |
| 3325 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3326 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3327 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3328 | 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] | 3329 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3330 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3331 | 0 \ |
| 3332 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3333 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3334 | -c "client hello, adding CID extension" \ |
| 3335 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3336 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3337 | -s "server hello, adding CID extension" \ |
| 3338 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3339 | -c "Use of CID extension negotiated" \ |
| 3340 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3341 | -c "Copy CIDs into SSL transform" \ |
| 3342 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3343 | -s "Peer CID (length 0 Bytes):" \ |
| 3344 | -s "Use of Connection ID has been negotiated" \ |
| 3345 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3346 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3347 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3348 | 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] | 3349 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3350 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3351 | 0 \ |
| 3352 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3353 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3354 | -c "client hello, adding CID extension" \ |
| 3355 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3356 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3357 | -s "server hello, adding CID extension" \ |
| 3358 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3359 | -c "Use of CID extension negotiated" \ |
| 3360 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3361 | -c "Copy CIDs into SSL transform" \ |
| 3362 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3363 | -c "Peer CID (length 0 Bytes):" \ |
| 3364 | -s "Use of Connection ID has been negotiated" \ |
| 3365 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3366 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3368 | 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] | 3369 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3370 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3371 | 0 \ |
| 3372 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3373 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3374 | -c "client hello, adding CID extension" \ |
| 3375 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3376 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3377 | -s "server hello, adding CID extension" \ |
| 3378 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3379 | -c "Use of CID extension negotiated" \ |
| 3380 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3381 | -c "Copy CIDs into SSL transform" \ |
| 3382 | -S "Use of Connection ID has been negotiated" \ |
| 3383 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3388 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3389 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3390 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3391 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3392 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3393 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3394 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3395 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3396 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3397 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3398 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3399 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3400 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3403 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3404 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3405 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3406 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3407 | 0 \ |
| 3408 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3409 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3410 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3411 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3412 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3413 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3414 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3415 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3416 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3420 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3421 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3422 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3423 | 0 \ |
| 3424 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3425 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3426 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3427 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3428 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3429 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3430 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3431 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3432 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3436 | 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] | 3437 | -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] | 3438 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3439 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3440 | 0 \ |
| 3441 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3442 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3443 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3444 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3445 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3446 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3447 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3448 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3449 | -c "ignoring unexpected CID" \ |
| 3450 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +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 | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3455 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3456 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3457 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3458 | 0 \ |
| 3459 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3460 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3461 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3463 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3464 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3465 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3466 | -S "(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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3471 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3472 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3473 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 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): de ad" \ |
| 3480 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3481 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3482 | -S "(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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3487 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3488 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3489 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3490 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3491 | 0 \ |
| 3492 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3493 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3494 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3495 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3496 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3497 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3498 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3499 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3500 | -c "ignoring unexpected CID" \ |
| 3501 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3506 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3507 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3508 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3509 | 0 \ |
| 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): de ad" \ |
| 3513 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3514 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3515 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3518 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3520 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3521 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3522 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3523 | 0 \ |
| 3524 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3525 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3526 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3527 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3528 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3529 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3534 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3535 | -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] | 3536 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3537 | "$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" \ |
| 3538 | 0 \ |
| 3539 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3540 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3541 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3542 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3543 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3544 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3545 | -c "ignoring unexpected CID" \ |
| 3546 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3547 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3551 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3552 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3553 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3554 | 0 \ |
| 3555 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3556 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3557 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3558 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3559 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3560 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3561 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3562 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3563 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3568 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3569 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3570 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3571 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3572 | 0 \ |
| 3573 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3574 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3575 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3576 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3577 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3578 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3579 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3580 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3581 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3582 | -c "ignoring unexpected CID" \ |
| 3583 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3587 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3588 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3589 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3590 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3591 | 0 \ |
| 3592 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3593 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3594 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3595 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3596 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3597 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3598 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3599 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3600 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3603 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3604 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3605 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3606 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3607 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3608 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3609 | 0 \ |
| 3610 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3611 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3612 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3613 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3614 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3615 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3616 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3617 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3618 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3619 | -c "ignoring unexpected CID" \ |
| 3620 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3621 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3622 | # 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] | 3623 | # tests check that the buffer contents are reallocated when the message is |
| 3624 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3626 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3627 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3628 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3629 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3630 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3631 | 0 \ |
| 3632 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3633 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3634 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3635 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3636 | -s "Reallocating in_buf" \ |
| 3637 | -s "Reallocating out_buf" |
| 3638 | |
| 3639 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3640 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3641 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3642 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3643 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3644 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3645 | 0 \ |
| 3646 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3647 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3648 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3649 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3650 | -s "Reallocating in_buf" \ |
| 3651 | -s "Reallocating out_buf" |
| 3652 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3653 | # Tests for Encrypt-then-MAC extension |
| 3654 | |
| 3655 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3656 | "$P_SRV debug_level=3 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 3657 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3658 | "$P_CLI debug_level=3" \ |
| 3659 | 0 \ |
| 3660 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3661 | -s "found encrypt then mac extension" \ |
| 3662 | -s "server hello, adding encrypt then mac extension" \ |
| 3663 | -c "found encrypt_then_mac extension" \ |
| 3664 | -c "using encrypt then mac" \ |
| 3665 | -s "using encrypt then mac" |
| 3666 | |
| 3667 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3668 | "$P_SRV debug_level=3 etm=0 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 3669 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3670 | "$P_CLI debug_level=3 etm=1" \ |
| 3671 | 0 \ |
| 3672 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3673 | -s "found encrypt then mac extension" \ |
| 3674 | -S "server hello, adding encrypt then mac extension" \ |
| 3675 | -C "found encrypt_then_mac extension" \ |
| 3676 | -C "using encrypt then mac" \ |
| 3677 | -S "using encrypt then mac" |
| 3678 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3679 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3680 | "$P_SRV debug_level=3 etm=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 3681 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3682 | "$P_CLI debug_level=3 etm=1" \ |
| 3683 | 0 \ |
| 3684 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3685 | -s "found encrypt then mac extension" \ |
| 3686 | -S "server hello, adding encrypt then mac extension" \ |
| 3687 | -C "found encrypt_then_mac extension" \ |
| 3688 | -C "using encrypt then mac" \ |
| 3689 | -S "using encrypt then mac" |
| 3690 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3691 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3692 | "$P_SRV debug_level=3 etm=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 3693 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3694 | "$P_CLI debug_level=3 etm=0" \ |
| 3695 | 0 \ |
| 3696 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3697 | -S "found encrypt then mac extension" \ |
| 3698 | -S "server hello, adding encrypt then mac extension" \ |
| 3699 | -C "found encrypt_then_mac extension" \ |
| 3700 | -C "using encrypt then mac" \ |
| 3701 | -S "using encrypt then mac" |
| 3702 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3703 | # Tests for Extended Master Secret extension |
| 3704 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3706 | run_test "Extended Master Secret: default" \ |
| 3707 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3708 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3709 | 0 \ |
| 3710 | -c "client hello, adding extended_master_secret extension" \ |
| 3711 | -s "found extended master secret extension" \ |
| 3712 | -s "server hello, adding extended master secret extension" \ |
| 3713 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3714 | -c "session hash for extended master secret" \ |
| 3715 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3716 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3717 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3718 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3719 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3720 | "$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] | 3721 | 0 \ |
| 3722 | -c "client hello, adding extended_master_secret extension" \ |
| 3723 | -s "found extended master secret extension" \ |
| 3724 | -S "server hello, adding extended master secret extension" \ |
| 3725 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3726 | -C "session hash for extended master secret" \ |
| 3727 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3728 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3729 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3730 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3731 | "$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] | 3732 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3733 | 0 \ |
| 3734 | -C "client hello, adding extended_master_secret extension" \ |
| 3735 | -S "found extended master secret extension" \ |
| 3736 | -S "server hello, adding extended master secret extension" \ |
| 3737 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3738 | -C "session hash for extended master secret" \ |
| 3739 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3740 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3741 | # Test sending and receiving empty application data records |
| 3742 | |
| 3743 | run_test "Encrypt then MAC: empty application data record" \ |
| 3744 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3745 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3746 | 0 \ |
| 3747 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3748 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3749 | -c "0 bytes written in 1 fragments" |
| 3750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3752 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3753 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3754 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3755 | 0 \ |
| 3756 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3757 | -c "0 bytes written in 1 fragments" |
| 3758 | |
| 3759 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3760 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3761 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3762 | 0 \ |
| 3763 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3764 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3765 | -c "0 bytes written in 1 fragments" |
| 3766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3768 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3769 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3770 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3771 | 0 \ |
| 3772 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3773 | -c "0 bytes written in 1 fragments" |
| 3774 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3775 | # Tests for CBC 1/n-1 record splitting |
| 3776 | |
| 3777 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3778 | "$P_SRV force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 3779 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3780 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3781 | 0 \ |
| 3782 | -s "Read from client: 123 bytes read" \ |
| 3783 | -S "Read from client: 1 bytes read" \ |
| 3784 | -S "122 bytes read" |
| 3785 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3786 | # Tests for Session Tickets |
| 3787 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3788 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3789 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3790 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3791 | "$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] | 3792 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3793 | -c "client hello, adding session ticket extension" \ |
| 3794 | -s "found session ticket extension" \ |
| 3795 | -s "server hello, adding session ticket extension" \ |
| 3796 | -c "found session_ticket extension" \ |
| 3797 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3798 | -S "session successfully restored from cache" \ |
| 3799 | -s "session successfully restored from ticket" \ |
| 3800 | -s "a session has been resumed" \ |
| 3801 | -c "a session has been resumed" |
| 3802 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3803 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3804 | run_test "Session resume using tickets: manual rotation" \ |
| 3805 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3806 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3807 | 0 \ |
| 3808 | -c "client hello, adding session ticket extension" \ |
| 3809 | -s "found session ticket extension" \ |
| 3810 | -s "server hello, adding session ticket extension" \ |
| 3811 | -c "found session_ticket extension" \ |
| 3812 | -c "parse new session ticket" \ |
| 3813 | -S "session successfully restored from cache" \ |
| 3814 | -s "session successfully restored from ticket" \ |
| 3815 | -s "a session has been resumed" \ |
| 3816 | -c "a session has been resumed" |
| 3817 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3818 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3819 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3820 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3821 | "$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] | 3822 | 0 \ |
| 3823 | -c "client hello, adding session ticket extension" \ |
| 3824 | -s "found session ticket extension" \ |
| 3825 | -s "server hello, adding session ticket extension" \ |
| 3826 | -c "found session_ticket extension" \ |
| 3827 | -c "parse new session ticket" \ |
| 3828 | -S "session successfully restored from cache" \ |
| 3829 | -s "session successfully restored from ticket" \ |
| 3830 | -s "a session has been resumed" \ |
| 3831 | -c "a session has been resumed" |
| 3832 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3833 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3834 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3835 | "$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] | 3836 | "$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] | 3837 | 0 \ |
| 3838 | -c "client hello, adding session ticket extension" \ |
| 3839 | -s "found session ticket extension" \ |
| 3840 | -s "server hello, adding session ticket extension" \ |
| 3841 | -c "found session_ticket extension" \ |
| 3842 | -c "parse new session ticket" \ |
| 3843 | -S "session successfully restored from cache" \ |
| 3844 | -S "session successfully restored from ticket" \ |
| 3845 | -S "a session has been resumed" \ |
| 3846 | -C "a session has been resumed" |
| 3847 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3848 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3849 | run_test "Session resume using tickets: session copy" \ |
| 3850 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3851 | "$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] | 3852 | 0 \ |
| 3853 | -c "client hello, adding session ticket extension" \ |
| 3854 | -s "found session ticket extension" \ |
| 3855 | -s "server hello, adding session ticket extension" \ |
| 3856 | -c "found session_ticket extension" \ |
| 3857 | -c "parse new session ticket" \ |
| 3858 | -S "session successfully restored from cache" \ |
| 3859 | -s "session successfully restored from ticket" \ |
| 3860 | -s "a session has been resumed" \ |
| 3861 | -c "a session has been resumed" |
| 3862 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3864 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3865 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3866 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3867 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3868 | 0 \ |
| 3869 | -c "client hello, adding session ticket extension" \ |
| 3870 | -c "found session_ticket extension" \ |
| 3871 | -c "parse new session ticket" \ |
| 3872 | -c "a session has been resumed" |
| 3873 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3875 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3876 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3877 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3878 | "( $O_CLI -sess_out $SESSION; \ |
| 3879 | $O_CLI -sess_in $SESSION; \ |
| 3880 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3881 | 0 \ |
| 3882 | -s "found session ticket extension" \ |
| 3883 | -s "server hello, adding session ticket extension" \ |
| 3884 | -S "session successfully restored from cache" \ |
| 3885 | -s "session successfully restored from ticket" \ |
| 3886 | -s "a session has been resumed" |
| 3887 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3888 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3890 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3891 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3892 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3893 | 0 \ |
| 3894 | -c "client hello, adding session ticket extension" \ |
| 3895 | -s "found session ticket extension" \ |
| 3896 | -s "server hello, adding session ticket extension" \ |
| 3897 | -c "found session_ticket extension" \ |
| 3898 | -c "parse new session ticket" \ |
| 3899 | -S "session successfully restored from cache" \ |
| 3900 | -s "session successfully restored from ticket" \ |
| 3901 | -s "a session has been resumed" \ |
| 3902 | -c "a session has been resumed" |
| 3903 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3904 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3905 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3906 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3907 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3908 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3909 | 0 \ |
| 3910 | -c "client hello, adding session ticket extension" \ |
| 3911 | -s "found session ticket extension" \ |
| 3912 | -s "server hello, adding session ticket extension" \ |
| 3913 | -c "found session_ticket extension" \ |
| 3914 | -c "parse new session ticket" \ |
| 3915 | -S "session successfully restored from cache" \ |
| 3916 | -s "session successfully restored from ticket" \ |
| 3917 | -s "a session has been resumed" \ |
| 3918 | -c "a session has been resumed" |
| 3919 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3920 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3921 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3922 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3923 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3924 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3925 | 0 \ |
| 3926 | -c "client hello, adding session ticket extension" \ |
| 3927 | -s "found session ticket extension" \ |
| 3928 | -s "server hello, adding session ticket extension" \ |
| 3929 | -c "found session_ticket extension" \ |
| 3930 | -c "parse new session ticket" \ |
| 3931 | -S "session successfully restored from cache" \ |
| 3932 | -s "session successfully restored from ticket" \ |
| 3933 | -s "a session has been resumed" \ |
| 3934 | -c "a session has been resumed" |
| 3935 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3936 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3937 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3938 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3939 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3940 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3941 | 0 \ |
| 3942 | -c "client hello, adding session ticket extension" \ |
| 3943 | -s "found session ticket extension" \ |
| 3944 | -s "server hello, adding session ticket extension" \ |
| 3945 | -c "found session_ticket extension" \ |
| 3946 | -c "parse new session ticket" \ |
| 3947 | -S "session successfully restored from cache" \ |
| 3948 | -s "session successfully restored from ticket" \ |
| 3949 | -s "a session has been resumed" \ |
| 3950 | -c "a session has been resumed" |
| 3951 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3952 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3953 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3954 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3955 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3956 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3957 | 0 \ |
| 3958 | -c "client hello, adding session ticket extension" \ |
| 3959 | -s "found session ticket extension" \ |
| 3960 | -s "server hello, adding session ticket extension" \ |
| 3961 | -c "found session_ticket extension" \ |
| 3962 | -c "parse new session ticket" \ |
| 3963 | -S "session successfully restored from cache" \ |
| 3964 | -s "session successfully restored from ticket" \ |
| 3965 | -s "a session has been resumed" \ |
| 3966 | -c "a session has been resumed" |
| 3967 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3968 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3970 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3971 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3972 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3973 | 0 \ |
| 3974 | -c "client hello, adding session ticket extension" \ |
| 3975 | -s "found session ticket extension" \ |
| 3976 | -s "server hello, adding session ticket extension" \ |
| 3977 | -c "found session_ticket extension" \ |
| 3978 | -c "parse new session ticket" \ |
| 3979 | -S "session successfully restored from cache" \ |
| 3980 | -s "session successfully restored from ticket" \ |
| 3981 | -s "a session has been resumed" \ |
| 3982 | -c "a session has been resumed" |
| 3983 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3984 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3986 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3987 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3988 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3989 | 0 \ |
| 3990 | -c "client hello, adding session ticket extension" \ |
| 3991 | -s "found session ticket extension" \ |
| 3992 | -s "server hello, adding session ticket extension" \ |
| 3993 | -c "found session_ticket extension" \ |
| 3994 | -c "parse new session ticket" \ |
| 3995 | -S "session successfully restored from cache" \ |
| 3996 | -s "session successfully restored from ticket" \ |
| 3997 | -s "a session has been resumed" \ |
| 3998 | -c "a session has been resumed" |
| 3999 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4000 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4002 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4003 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4004 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4005 | 0 \ |
| 4006 | -c "client hello, adding session ticket extension" \ |
| 4007 | -s "found session ticket extension" \ |
| 4008 | -s "server hello, adding session ticket extension" \ |
| 4009 | -c "found session_ticket extension" \ |
| 4010 | -c "parse new session ticket" \ |
| 4011 | -S "session successfully restored from cache" \ |
| 4012 | -s "session successfully restored from ticket" \ |
| 4013 | -s "a session has been resumed" \ |
| 4014 | -c "a session has been resumed" |
| 4015 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4016 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4018 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4019 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4020 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4021 | 0 \ |
| 4022 | -c "client hello, adding session ticket extension" \ |
| 4023 | -s "found session ticket extension" \ |
| 4024 | -s "server hello, adding session ticket extension" \ |
| 4025 | -c "found session_ticket extension" \ |
| 4026 | -c "parse new session ticket" \ |
| 4027 | -S "session successfully restored from cache" \ |
| 4028 | -s "session successfully restored from ticket" \ |
| 4029 | -s "a session has been resumed" \ |
| 4030 | -c "a session has been resumed" |
| 4031 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4032 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4033 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4034 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4035 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4036 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4037 | 0 \ |
| 4038 | -c "client hello, adding session ticket extension" \ |
| 4039 | -s "found session ticket extension" \ |
| 4040 | -s "server hello, adding session ticket extension" \ |
| 4041 | -c "found session_ticket extension" \ |
| 4042 | -c "parse new session ticket" \ |
| 4043 | -S "session successfully restored from cache" \ |
| 4044 | -s "session successfully restored from ticket" \ |
| 4045 | -s "a session has been resumed" \ |
| 4046 | -c "a session has been resumed" |
| 4047 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4048 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4049 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4050 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4051 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4052 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4053 | 0 \ |
| 4054 | -c "client hello, adding session ticket extension" \ |
| 4055 | -s "found session ticket extension" \ |
| 4056 | -s "server hello, adding session ticket extension" \ |
| 4057 | -c "found session_ticket extension" \ |
| 4058 | -c "parse new session ticket" \ |
| 4059 | -S "session successfully restored from cache" \ |
| 4060 | -s "session successfully restored from ticket" \ |
| 4061 | -s "a session has been resumed" \ |
| 4062 | -c "a session has been resumed" |
| 4063 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4064 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4066 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4067 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4068 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4069 | 0 \ |
| 4070 | -c "client hello, adding session ticket extension" \ |
| 4071 | -s "found session ticket extension" \ |
| 4072 | -s "server hello, adding session ticket extension" \ |
| 4073 | -c "found session_ticket extension" \ |
| 4074 | -c "parse new session ticket" \ |
| 4075 | -S "session successfully restored from cache" \ |
| 4076 | -s "session successfully restored from ticket" \ |
| 4077 | -s "a session has been resumed" \ |
| 4078 | -c "a session has been resumed" |
| 4079 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4080 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4081 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4082 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4083 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4084 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4085 | 0 \ |
| 4086 | -c "client hello, adding session ticket extension" \ |
| 4087 | -s "found session ticket extension" \ |
| 4088 | -s "server hello, adding session ticket extension" \ |
| 4089 | -c "found session_ticket extension" \ |
| 4090 | -c "parse new session ticket" \ |
| 4091 | -S "session successfully restored from cache" \ |
| 4092 | -s "session successfully restored from ticket" \ |
| 4093 | -s "a session has been resumed" \ |
| 4094 | -c "a session has been resumed" |
| 4095 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4096 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4097 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4098 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4099 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4100 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4101 | 0 \ |
| 4102 | -c "client hello, adding session ticket extension" \ |
| 4103 | -s "found session ticket extension" \ |
| 4104 | -s "server hello, adding session ticket extension" \ |
| 4105 | -c "found session_ticket extension" \ |
| 4106 | -c "parse new session ticket" \ |
| 4107 | -S "session successfully restored from cache" \ |
| 4108 | -s "session successfully restored from ticket" \ |
| 4109 | -s "a session has been resumed" \ |
| 4110 | -c "a session has been resumed" |
| 4111 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4112 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4113 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4114 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4115 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4116 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4117 | 0 \ |
| 4118 | -c "client hello, adding session ticket extension" \ |
| 4119 | -s "found session ticket extension" \ |
| 4120 | -s "server hello, adding session ticket extension" \ |
| 4121 | -c "found session_ticket extension" \ |
| 4122 | -c "parse new session ticket" \ |
| 4123 | -S "session successfully restored from cache" \ |
| 4124 | -s "session successfully restored from ticket" \ |
| 4125 | -s "a session has been resumed" \ |
| 4126 | -c "a session has been resumed" |
| 4127 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4128 | # Tests for Session Tickets with DTLS |
| 4129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4131 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4132 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4133 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4134 | "$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] | 4135 | 0 \ |
| 4136 | -c "client hello, adding session ticket extension" \ |
| 4137 | -s "found session ticket extension" \ |
| 4138 | -s "server hello, adding session ticket extension" \ |
| 4139 | -c "found session_ticket extension" \ |
| 4140 | -c "parse new session ticket" \ |
| 4141 | -S "session successfully restored from cache" \ |
| 4142 | -s "session successfully restored from ticket" \ |
| 4143 | -s "a session has been resumed" \ |
| 4144 | -c "a session has been resumed" |
| 4145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4147 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4148 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4149 | "$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] | 4150 | "$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] | 4151 | 0 \ |
| 4152 | -c "client hello, adding session ticket extension" \ |
| 4153 | -s "found session ticket extension" \ |
| 4154 | -s "server hello, adding session ticket extension" \ |
| 4155 | -c "found session_ticket extension" \ |
| 4156 | -c "parse new session ticket" \ |
| 4157 | -S "session successfully restored from cache" \ |
| 4158 | -s "session successfully restored from ticket" \ |
| 4159 | -s "a session has been resumed" \ |
| 4160 | -c "a session has been resumed" |
| 4161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4163 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4164 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4165 | "$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] | 4166 | "$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] | 4167 | 0 \ |
| 4168 | -c "client hello, adding session ticket extension" \ |
| 4169 | -s "found session ticket extension" \ |
| 4170 | -s "server hello, adding session ticket extension" \ |
| 4171 | -c "found session_ticket extension" \ |
| 4172 | -c "parse new session ticket" \ |
| 4173 | -S "session successfully restored from cache" \ |
| 4174 | -S "session successfully restored from ticket" \ |
| 4175 | -S "a session has been resumed" \ |
| 4176 | -C "a session has been resumed" |
| 4177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4180 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4181 | "$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] | 4182 | "$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] | 4183 | 0 \ |
| 4184 | -c "client hello, adding session ticket extension" \ |
| 4185 | -s "found session ticket extension" \ |
| 4186 | -s "server hello, adding session ticket extension" \ |
| 4187 | -c "found session_ticket extension" \ |
| 4188 | -c "parse new session ticket" \ |
| 4189 | -S "session successfully restored from cache" \ |
| 4190 | -s "session successfully restored from ticket" \ |
| 4191 | -s "a session has been resumed" \ |
| 4192 | -c "a session has been resumed" |
| 4193 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4194 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4196 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4197 | "$O_SRV -dtls" \ |
| 4198 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4199 | 0 \ |
| 4200 | -c "client hello, adding session ticket extension" \ |
| 4201 | -c "found session_ticket extension" \ |
| 4202 | -c "parse new session ticket" \ |
| 4203 | -c "a session has been resumed" |
| 4204 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4205 | # 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] | 4206 | # 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] | 4207 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4209 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4210 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4211 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4212 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4213 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4214 | rm -f $SESSION )" \ |
| 4215 | 0 \ |
| 4216 | -s "found session ticket extension" \ |
| 4217 | -s "server hello, adding session ticket extension" \ |
| 4218 | -S "session successfully restored from cache" \ |
| 4219 | -s "session successfully restored from ticket" \ |
| 4220 | -s "a session has been resumed" |
| 4221 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4222 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4223 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4225 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4226 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4227 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4228 | "$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] | 4229 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4230 | -c "client hello, adding session ticket extension" \ |
| 4231 | -s "found session ticket extension" \ |
| 4232 | -S "server hello, adding session ticket extension" \ |
| 4233 | -C "found session_ticket extension" \ |
| 4234 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4235 | -s "session successfully restored from cache" \ |
| 4236 | -S "session successfully restored from ticket" \ |
| 4237 | -s "a session has been resumed" \ |
| 4238 | -c "a session has been resumed" |
| 4239 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4242 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4243 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4244 | "$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] | 4245 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4246 | -C "client hello, adding session ticket extension" \ |
| 4247 | -S "found session ticket extension" \ |
| 4248 | -S "server hello, adding session ticket extension" \ |
| 4249 | -C "found session_ticket extension" \ |
| 4250 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4251 | -s "session successfully restored from cache" \ |
| 4252 | -S "session successfully restored from ticket" \ |
| 4253 | -s "a session has been resumed" \ |
| 4254 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4255 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4257 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4258 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4259 | "$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] | 4260 | 0 \ |
| 4261 | -S "session successfully restored from cache" \ |
| 4262 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4263 | -S "a session has been resumed" \ |
| 4264 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4265 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4266 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4267 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4268 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4269 | "$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] | 4270 | 0 \ |
| 4271 | -s "session successfully restored from cache" \ |
| 4272 | -S "session successfully restored from ticket" \ |
| 4273 | -s "a session has been resumed" \ |
| 4274 | -c "a session has been resumed" |
| 4275 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4277 | run_test "Session resume using cache: cache removed" \ |
| 4278 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4279 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4280 | 0 \ |
| 4281 | -C "client hello, adding session ticket extension" \ |
| 4282 | -S "found session ticket extension" \ |
| 4283 | -S "server hello, adding session ticket extension" \ |
| 4284 | -C "found session_ticket extension" \ |
| 4285 | -C "parse new session ticket" \ |
| 4286 | -S "session successfully restored from cache" \ |
| 4287 | -S "session successfully restored from ticket" \ |
| 4288 | -S "a session has been resumed" \ |
| 4289 | -C "a session has been resumed" |
| 4290 | |
| 4291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4292 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4293 | run_test "Session resume using cache: timeout > delay" \ |
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=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4296 | 0 \ |
| 4297 | -s "session successfully restored from cache" \ |
| 4298 | -S "session successfully restored from ticket" \ |
| 4299 | -s "a session has been resumed" \ |
| 4300 | -c "a session has been resumed" |
| 4301 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4302 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4303 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4304 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4305 | "$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] | 4306 | 0 \ |
| 4307 | -S "session successfully restored from cache" \ |
| 4308 | -S "session successfully restored from ticket" \ |
| 4309 | -S "a session has been resumed" \ |
| 4310 | -C "a session has been resumed" |
| 4311 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4313 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4314 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4315 | "$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] | 4316 | 0 \ |
| 4317 | -s "session successfully restored from cache" \ |
| 4318 | -S "session successfully restored from ticket" \ |
| 4319 | -s "a session has been resumed" \ |
| 4320 | -c "a session has been resumed" |
| 4321 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4322 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4323 | run_test "Session resume using cache: session copy" \ |
| 4324 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4325 | "$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] | 4326 | 0 \ |
| 4327 | -s "session successfully restored from cache" \ |
| 4328 | -S "session successfully restored from ticket" \ |
| 4329 | -s "a session has been resumed" \ |
| 4330 | -c "a session has been resumed" |
| 4331 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4332 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4333 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4334 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4335 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4336 | "( $O_CLI -sess_out $SESSION; \ |
| 4337 | $O_CLI -sess_in $SESSION; \ |
| 4338 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4339 | 0 \ |
| 4340 | -s "found session ticket extension" \ |
| 4341 | -S "server hello, adding session ticket extension" \ |
| 4342 | -s "session successfully restored from cache" \ |
| 4343 | -S "session successfully restored from ticket" \ |
| 4344 | -s "a session has been resumed" |
| 4345 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4347 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4348 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4349 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4350 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4351 | 0 \ |
| 4352 | -C "found session_ticket extension" \ |
| 4353 | -C "parse new session ticket" \ |
| 4354 | -c "a session has been resumed" |
| 4355 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4356 | # Tests for Session resume and extensions |
| 4357 | |
| 4358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4359 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4360 | run_test "Session resume and connection ID" \ |
| 4361 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4362 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4363 | 0 \ |
| 4364 | -c "Enable use of CID extension." \ |
| 4365 | -s "Enable use of CID extension." \ |
| 4366 | -c "client hello, adding CID extension" \ |
| 4367 | -s "found CID extension" \ |
| 4368 | -s "Use of CID extension negotiated" \ |
| 4369 | -s "server hello, adding CID extension" \ |
| 4370 | -c "found CID extension" \ |
| 4371 | -c "Use of CID extension negotiated" \ |
| 4372 | -s "Copy CIDs into SSL transform" \ |
| 4373 | -c "Copy CIDs into SSL transform" \ |
| 4374 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4375 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4376 | -s "Use of Connection ID has been negotiated" \ |
| 4377 | -c "Use of Connection ID has been negotiated" |
| 4378 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4379 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4380 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4383 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4384 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4385 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4386 | "$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] | 4387 | 0 \ |
| 4388 | -c "client hello, adding session ticket extension" \ |
| 4389 | -s "found session ticket extension" \ |
| 4390 | -S "server hello, adding session ticket extension" \ |
| 4391 | -C "found session_ticket extension" \ |
| 4392 | -C "parse new session ticket" \ |
| 4393 | -s "session successfully restored from cache" \ |
| 4394 | -S "session successfully restored from ticket" \ |
| 4395 | -s "a session has been resumed" \ |
| 4396 | -c "a session has been resumed" |
| 4397 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
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 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4401 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4402 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4403 | "$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] | 4404 | 0 \ |
| 4405 | -C "client hello, adding session ticket extension" \ |
| 4406 | -S "found session ticket extension" \ |
| 4407 | -S "server hello, adding session ticket extension" \ |
| 4408 | -C "found session_ticket extension" \ |
| 4409 | -C "parse new session ticket" \ |
| 4410 | -s "session successfully restored from cache" \ |
| 4411 | -S "session successfully restored from ticket" \ |
| 4412 | -s "a session has been resumed" \ |
| 4413 | -c "a session has been resumed" |
| 4414 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4416 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4417 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4418 | "$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] | 4419 | "$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] | 4420 | 0 \ |
| 4421 | -S "session successfully restored from cache" \ |
| 4422 | -S "session successfully restored from ticket" \ |
| 4423 | -S "a session has been resumed" \ |
| 4424 | -C "a session has been resumed" |
| 4425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4428 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4429 | "$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] | 4430 | "$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] | 4431 | 0 \ |
| 4432 | -s "session successfully restored from cache" \ |
| 4433 | -S "session successfully restored from ticket" \ |
| 4434 | -s "a session has been resumed" \ |
| 4435 | -c "a session has been resumed" |
| 4436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4439 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4440 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4441 | "$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] | 4442 | 0 \ |
| 4443 | -s "session successfully restored from cache" \ |
| 4444 | -S "session successfully restored from ticket" \ |
| 4445 | -s "a session has been resumed" \ |
| 4446 | -c "a session has been resumed" |
| 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 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4450 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4451 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4452 | "$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] | 4453 | 0 \ |
| 4454 | -S "session successfully restored from cache" \ |
| 4455 | -S "session successfully restored from ticket" \ |
| 4456 | -S "a session has been resumed" \ |
| 4457 | -C "a session has been resumed" |
| 4458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4460 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4461 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4462 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4463 | "$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] | 4464 | 0 \ |
| 4465 | -s "session successfully restored from cache" \ |
| 4466 | -S "session successfully restored from ticket" \ |
| 4467 | -s "a session has been resumed" \ |
| 4468 | -c "a session has been resumed" |
| 4469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4471 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4472 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4473 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4474 | "$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] | 4475 | 0 \ |
| 4476 | -s "session successfully restored from cache" \ |
| 4477 | -S "session successfully restored from ticket" \ |
| 4478 | -s "a session has been resumed" \ |
| 4479 | -c "a session has been resumed" |
| 4480 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4481 | # 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] | 4482 | # 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] | 4483 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4486 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4487 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4488 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4489 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4490 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4491 | rm -f $SESSION )" \ |
| 4492 | 0 \ |
| 4493 | -s "found session ticket extension" \ |
| 4494 | -S "server hello, adding session ticket extension" \ |
| 4495 | -s "session successfully restored from cache" \ |
| 4496 | -S "session successfully restored from ticket" \ |
| 4497 | -s "a session has been resumed" |
| 4498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4500 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4501 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4502 | "$O_SRV -dtls" \ |
| 4503 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4504 | 0 \ |
| 4505 | -C "found session_ticket extension" \ |
| 4506 | -C "parse new session ticket" \ |
| 4507 | -c "a session has been resumed" |
| 4508 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4509 | # Tests for Max Fragment Length extension |
| 4510 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4511 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4513 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4514 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4515 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4516 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4517 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4518 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4519 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4520 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4521 | -C "client hello, adding max_fragment_length extension" \ |
| 4522 | -S "found max fragment length extension" \ |
| 4523 | -S "server hello, max_fragment_length extension" \ |
| 4524 | -C "found max_fragment_length extension" |
| 4525 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4526 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4528 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4529 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4530 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4531 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4532 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4533 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4534 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4535 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4536 | -C "client hello, adding max_fragment_length extension" \ |
| 4537 | -S "found max fragment length extension" \ |
| 4538 | -S "server hello, max_fragment_length extension" \ |
| 4539 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4540 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4541 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4542 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4543 | |
| 4544 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4546 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4547 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4548 | "$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] | 4549 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4550 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4551 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4552 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4553 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4554 | -C "client hello, adding max_fragment_length extension" \ |
| 4555 | -S "found max fragment length extension" \ |
| 4556 | -S "server hello, max_fragment_length extension" \ |
| 4557 | -C "found max_fragment_length extension" \ |
| 4558 | -c "fragment larger than.*maximum " |
| 4559 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4560 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4561 | # (session fragment length will be 16384 regardless of mbedtls |
| 4562 | # content length configuration.) |
| 4563 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4564 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4566 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4567 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4568 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4569 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4570 | -C "Maximum incoming record payload length is 16384" \ |
| 4571 | -C "Maximum outgoing record payload length is 16384" \ |
| 4572 | -S "Maximum incoming record payload length is 16384" \ |
| 4573 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4574 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4575 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4576 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4577 | |
| 4578 | requires_config_disabled 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 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4580 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4581 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4582 | "$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] | 4583 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4584 | -C "Maximum incoming record payload length is 16384" \ |
| 4585 | -C "Maximum outgoing record payload length is 16384" \ |
| 4586 | -S "Maximum incoming record payload length is 16384" \ |
| 4587 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4588 | -c "fragment larger than.*maximum " |
| 4589 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4590 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4591 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4592 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4593 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4594 | "$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] | 4595 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4596 | -c "Maximum incoming record payload length is 4096" \ |
| 4597 | -c "Maximum outgoing record payload length is 4096" \ |
| 4598 | -s "Maximum incoming record payload length is 4096" \ |
| 4599 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4600 | -c "client hello, adding max_fragment_length extension" \ |
| 4601 | -s "found max fragment length extension" \ |
| 4602 | -s "server hello, max_fragment_length extension" \ |
| 4603 | -c "found max_fragment_length extension" |
| 4604 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4605 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4606 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4607 | run_test "Max fragment length: client 512, server 1024" \ |
| 4608 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4609 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4610 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4611 | -c "Maximum incoming record payload length is 512" \ |
| 4612 | -c "Maximum outgoing record payload length is 512" \ |
| 4613 | -s "Maximum incoming record payload length is 512" \ |
| 4614 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4615 | -c "client hello, adding max_fragment_length extension" \ |
| 4616 | -s "found max fragment length extension" \ |
| 4617 | -s "server hello, max_fragment_length extension" \ |
| 4618 | -c "found max_fragment_length extension" |
| 4619 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4620 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4621 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4622 | run_test "Max fragment length: client 512, server 2048" \ |
| 4623 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4624 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4625 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4626 | -c "Maximum incoming record payload length is 512" \ |
| 4627 | -c "Maximum outgoing record payload length is 512" \ |
| 4628 | -s "Maximum incoming record payload length is 512" \ |
| 4629 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4630 | -c "client hello, adding max_fragment_length extension" \ |
| 4631 | -s "found max fragment length extension" \ |
| 4632 | -s "server hello, max_fragment_length extension" \ |
| 4633 | -c "found max_fragment_length extension" |
| 4634 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4635 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4636 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4637 | run_test "Max fragment length: client 512, server 4096" \ |
| 4638 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4639 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4640 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4641 | -c "Maximum incoming record payload length is 512" \ |
| 4642 | -c "Maximum outgoing record payload length is 512" \ |
| 4643 | -s "Maximum incoming record payload length is 512" \ |
| 4644 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4645 | -c "client hello, adding max_fragment_length extension" \ |
| 4646 | -s "found max fragment length extension" \ |
| 4647 | -s "server hello, max_fragment_length extension" \ |
| 4648 | -c "found max_fragment_length extension" |
| 4649 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4650 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4651 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4652 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4653 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4654 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4655 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4656 | -c "Maximum incoming record payload length is 1024" \ |
| 4657 | -c "Maximum outgoing record payload length is 1024" \ |
| 4658 | -s "Maximum incoming record payload length is 1024" \ |
| 4659 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4660 | -c "client hello, adding max_fragment_length extension" \ |
| 4661 | -s "found max fragment length extension" \ |
| 4662 | -s "server hello, max_fragment_length extension" \ |
| 4663 | -c "found max_fragment_length extension" |
| 4664 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4665 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4666 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4667 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4668 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4669 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4670 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4671 | -c "Maximum incoming record payload length is 1024" \ |
| 4672 | -c "Maximum outgoing record payload length is 1024" \ |
| 4673 | -s "Maximum incoming record payload length is 1024" \ |
| 4674 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4675 | -c "client hello, adding max_fragment_length extension" \ |
| 4676 | -s "found max fragment length extension" \ |
| 4677 | -s "server hello, max_fragment_length extension" \ |
| 4678 | -c "found max_fragment_length extension" |
| 4679 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4680 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4681 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4682 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4683 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4684 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4685 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4686 | -c "Maximum incoming record payload length is 1024" \ |
| 4687 | -c "Maximum outgoing record payload length is 1024" \ |
| 4688 | -s "Maximum incoming record payload length is 1024" \ |
| 4689 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4690 | -c "client hello, adding max_fragment_length extension" \ |
| 4691 | -s "found max fragment length extension" \ |
| 4692 | -s "server hello, max_fragment_length extension" \ |
| 4693 | -c "found max_fragment_length extension" |
| 4694 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4695 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4696 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4697 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4698 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4699 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4700 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4701 | -c "Maximum incoming record payload length is 2048" \ |
| 4702 | -c "Maximum outgoing record payload length is 2048" \ |
| 4703 | -s "Maximum incoming record payload length is 2048" \ |
| 4704 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4705 | -c "client hello, adding max_fragment_length extension" \ |
| 4706 | -s "found max fragment length extension" \ |
| 4707 | -s "server hello, max_fragment_length extension" \ |
| 4708 | -c "found max_fragment_length extension" |
| 4709 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4710 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4711 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4712 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4713 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4714 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4715 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4716 | -c "Maximum incoming record payload length is 2048" \ |
| 4717 | -c "Maximum outgoing record payload length is 2048" \ |
| 4718 | -s "Maximum incoming record payload length is 2048" \ |
| 4719 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4720 | -c "client hello, adding max_fragment_length extension" \ |
| 4721 | -s "found max fragment length extension" \ |
| 4722 | -s "server hello, max_fragment_length extension" \ |
| 4723 | -c "found max_fragment_length extension" |
| 4724 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4725 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4726 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4727 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4728 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4729 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4730 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4731 | -c "Maximum incoming record payload length is 2048" \ |
| 4732 | -c "Maximum outgoing record payload length is 2048" \ |
| 4733 | -s "Maximum incoming record payload length is 2048" \ |
| 4734 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4735 | -c "client hello, adding max_fragment_length extension" \ |
| 4736 | -s "found max fragment length extension" \ |
| 4737 | -s "server hello, max_fragment_length extension" \ |
| 4738 | -c "found max_fragment_length extension" |
| 4739 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4740 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4741 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4742 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4743 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4744 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4745 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4746 | -c "Maximum incoming record payload length is 4096" \ |
| 4747 | -c "Maximum outgoing record payload length is 4096" \ |
| 4748 | -s "Maximum incoming record payload length is 4096" \ |
| 4749 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4750 | -c "client hello, adding max_fragment_length extension" \ |
| 4751 | -s "found max fragment length extension" \ |
| 4752 | -s "server hello, max_fragment_length extension" \ |
| 4753 | -c "found max_fragment_length extension" |
| 4754 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4755 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4756 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4757 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4758 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4759 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4760 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4761 | -c "Maximum incoming record payload length is 4096" \ |
| 4762 | -c "Maximum outgoing record payload length is 4096" \ |
| 4763 | -s "Maximum incoming record payload length is 4096" \ |
| 4764 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4765 | -c "client hello, adding max_fragment_length extension" \ |
| 4766 | -s "found max fragment length extension" \ |
| 4767 | -s "server hello, max_fragment_length extension" \ |
| 4768 | -c "found max_fragment_length extension" |
| 4769 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4770 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4772 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4773 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4774 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4775 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4776 | -c "Maximum incoming record payload length is 4096" \ |
| 4777 | -c "Maximum outgoing record payload length is 4096" \ |
| 4778 | -s "Maximum incoming record payload length is 4096" \ |
| 4779 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4780 | -c "client hello, adding max_fragment_length extension" \ |
| 4781 | -s "found max fragment length extension" \ |
| 4782 | -s "server hello, max_fragment_length extension" \ |
| 4783 | -c "found max_fragment_length extension" |
| 4784 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4785 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4787 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4788 | "$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] | 4789 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4790 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4791 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4792 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4793 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4794 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4795 | -C "client hello, adding max_fragment_length extension" \ |
| 4796 | -S "found max fragment length extension" \ |
| 4797 | -S "server hello, max_fragment_length extension" \ |
| 4798 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4799 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4800 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4801 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4802 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4804 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4805 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4806 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4807 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4808 | -c "Maximum incoming record payload length is 4096" \ |
| 4809 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4810 | -c "client hello, adding max_fragment_length extension" \ |
| 4811 | -c "found max_fragment_length extension" |
| 4812 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4813 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4814 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4815 | run_test "Max fragment length: client, message just fits" \ |
| 4816 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4817 | "$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] | 4818 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4819 | -c "Maximum incoming record payload length is 2048" \ |
| 4820 | -c "Maximum outgoing record payload length is 2048" \ |
| 4821 | -s "Maximum incoming record payload length is 2048" \ |
| 4822 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4823 | -c "client hello, adding max_fragment_length extension" \ |
| 4824 | -s "found max fragment length extension" \ |
| 4825 | -s "server hello, max_fragment_length extension" \ |
| 4826 | -c "found max_fragment_length extension" \ |
| 4827 | -c "2048 bytes written in 1 fragments" \ |
| 4828 | -s "2048 bytes read" |
| 4829 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4830 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4831 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4832 | run_test "Max fragment length: client, larger message" \ |
| 4833 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4834 | "$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] | 4835 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4836 | -c "Maximum incoming record payload length is 2048" \ |
| 4837 | -c "Maximum outgoing record payload length is 2048" \ |
| 4838 | -s "Maximum incoming record payload length is 2048" \ |
| 4839 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4840 | -c "client hello, adding max_fragment_length extension" \ |
| 4841 | -s "found max fragment length extension" \ |
| 4842 | -s "server hello, max_fragment_length extension" \ |
| 4843 | -c "found max_fragment_length extension" \ |
| 4844 | -c "2345 bytes written in 2 fragments" \ |
| 4845 | -s "2048 bytes read" \ |
| 4846 | -s "297 bytes read" |
| 4847 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4848 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4851 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4852 | "$P_SRV debug_level=3 dtls=1" \ |
| 4853 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4854 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4855 | -c "Maximum incoming record payload length is 2048" \ |
| 4856 | -c "Maximum outgoing record payload length is 2048" \ |
| 4857 | -s "Maximum incoming record payload length is 2048" \ |
| 4858 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4859 | -c "client hello, adding max_fragment_length extension" \ |
| 4860 | -s "found max fragment length extension" \ |
| 4861 | -s "server hello, max_fragment_length extension" \ |
| 4862 | -c "found max_fragment_length extension" \ |
| 4863 | -c "fragment larger than.*maximum" |
| 4864 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4865 | # Tests for Record Size Limit extension |
| 4866 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4867 | requires_gnutls_tls1_3 |
| 4868 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4869 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4870 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4871 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4872 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4873 | 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] | 4874 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4875 | "$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] | 4876 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4877 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4878 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4879 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4880 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4881 | |
| 4882 | requires_gnutls_tls1_3 |
| 4883 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 4885 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4886 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4887 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4888 | 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] | 4889 | "$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] | 4890 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4891 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4892 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4893 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4894 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4895 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4896 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4897 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4898 | # maximum record size using gnutls_record_set_max_size() |
| 4899 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4900 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4901 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4902 | # more recent function gnutls_record_set_max_recv_size() |
| 4903 | # (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] | 4904 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4905 | # 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] | 4906 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4907 | # Also, the value sent in the extension will be one larger than the value |
| 4908 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4909 | # 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] | 4910 | |
| 4911 | # 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] | 4912 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4913 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4914 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4915 | requires_gnutls_tls1_3 |
| 4916 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4917 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4918 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4919 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4920 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4921 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4922 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4923 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4924 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4925 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4926 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4927 | 0 \ |
| 4928 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4929 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4930 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4931 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4932 | -s "Maximum outgoing record payload length is 511" \ |
| 4933 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4934 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4935 | requires_gnutls_tls1_3 |
| 4936 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4937 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4938 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4939 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4940 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4941 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4942 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4943 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4944 | response_size=768" \ |
| 4945 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4946 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4947 | 0 \ |
| 4948 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4949 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4950 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4951 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4952 | -s "Maximum outgoing record payload length is 511" \ |
| 4953 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4954 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4955 | requires_gnutls_tls1_3 |
| 4956 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4957 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4958 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4959 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4960 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4961 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4962 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4963 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4964 | response_size=1280" \ |
| 4965 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4966 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4967 | 0 \ |
| 4968 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4969 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4970 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4971 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4972 | -s "Maximum outgoing record payload length is 511" \ |
| 4973 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4974 | |
| 4975 | requires_gnutls_tls1_3 |
| 4976 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4977 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4978 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4979 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4980 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4981 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 4982 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 4983 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4984 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4985 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4986 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4987 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4988 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4989 | -s "Maximum outgoing record payload length is 1023" \ |
| 4990 | -s "512 bytes written in 1 fragments" |
| 4991 | |
| 4992 | requires_gnutls_tls1_3 |
| 4993 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4994 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4995 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4996 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4997 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4998 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 4999 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5000 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5001 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5002 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5003 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5004 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5005 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5006 | -s "Maximum outgoing record payload length is 1023" \ |
| 5007 | -s "1536 bytes written in 2 fragments" |
| 5008 | |
| 5009 | requires_gnutls_tls1_3 |
| 5010 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5011 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5012 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5013 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5015 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5016 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5017 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5018 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5019 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5020 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5021 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5022 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5023 | -s "Maximum outgoing record payload length is 1023" \ |
| 5024 | -s "2560 bytes written in 3 fragments" |
| 5025 | |
| 5026 | requires_gnutls_tls1_3 |
| 5027 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5028 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5029 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5030 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5032 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5033 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5034 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5035 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5036 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5037 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5038 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5039 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5040 | -s "Maximum outgoing record payload length is 4095" \ |
| 5041 | -s "2048 bytes written in 1 fragments" |
| 5042 | |
| 5043 | requires_gnutls_tls1_3 |
| 5044 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5045 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5046 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5049 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5050 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5051 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5052 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5053 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5054 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5055 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5056 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5057 | -s "Maximum outgoing record payload length is 4095" \ |
| 5058 | -s "6144 bytes written in 2 fragments" |
| 5059 | |
| 5060 | requires_gnutls_tls1_3 |
| 5061 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5062 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5063 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5064 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5066 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5067 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5068 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5069 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5070 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5071 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5072 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5073 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5074 | -s "Maximum outgoing record payload length is 4095" \ |
| 5075 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5076 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5077 | requires_gnutls_tls1_3 |
| 5078 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5079 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5080 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5081 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5082 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5083 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5084 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5085 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5086 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5087 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5088 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5089 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5090 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5091 | -c "Maximum outgoing record payload length is 511" \ |
| 5092 | -c "256 bytes written in 1 fragments" |
| 5093 | |
| 5094 | requires_gnutls_tls1_3 |
| 5095 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5096 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5097 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5099 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5100 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5101 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5102 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5103 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5104 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5105 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5106 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5107 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5108 | -c "Maximum outgoing record payload length is 511" \ |
| 5109 | -c "768 bytes written in 2 fragments" |
| 5110 | |
| 5111 | requires_gnutls_tls1_3 |
| 5112 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5113 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5114 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5115 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5116 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5117 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5118 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5119 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5120 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5121 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5122 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5123 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5124 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5125 | -c "Maximum outgoing record payload length is 511" \ |
| 5126 | -c "1280 bytes written in 3 fragments" |
| 5127 | |
| 5128 | requires_gnutls_tls1_3 |
| 5129 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5130 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5131 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5133 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5134 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5135 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5136 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5137 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5138 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5139 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5140 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5141 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5142 | -c "Maximum outgoing record payload length is 1023" \ |
| 5143 | -c "512 bytes written in 1 fragments" |
| 5144 | |
| 5145 | requires_gnutls_tls1_3 |
| 5146 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5147 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5148 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5149 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5150 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5151 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5152 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5153 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5154 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5155 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5156 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5157 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5158 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5159 | -c "Maximum outgoing record payload length is 1023" \ |
| 5160 | -c "1536 bytes written in 2 fragments" |
| 5161 | |
| 5162 | requires_gnutls_tls1_3 |
| 5163 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5164 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5165 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5166 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5167 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5168 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5169 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5170 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5171 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5172 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5173 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5174 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5175 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5176 | -c "Maximum outgoing record payload length is 1023" \ |
| 5177 | -c "2560 bytes written in 3 fragments" |
| 5178 | |
| 5179 | requires_gnutls_tls1_3 |
| 5180 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5181 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5182 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5183 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5184 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5185 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5186 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5187 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5188 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5189 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5190 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5191 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5192 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5193 | -c "Maximum outgoing record payload length is 4095" \ |
| 5194 | -c "2048 bytes written in 1 fragments" |
| 5195 | |
| 5196 | requires_gnutls_tls1_3 |
| 5197 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5198 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5199 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5200 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5202 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5203 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5204 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5205 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5206 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5207 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5208 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5209 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5210 | -c "Maximum outgoing record payload length is 4095" \ |
| 5211 | -c "6144 bytes written in 2 fragments" |
| 5212 | |
| 5213 | requires_gnutls_tls1_3 |
| 5214 | requires_gnutls_record_size_limit |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5215 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5216 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5217 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5218 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5219 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5220 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5221 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5222 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5223 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5224 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5225 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5226 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5227 | -c "Maximum outgoing record payload length is 4095" \ |
| 5228 | -c "10240 bytes written in 3 fragments" |
| 5229 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5230 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5231 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5232 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5233 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5234 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5235 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5236 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5237 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5238 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5239 | 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] | 5240 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5241 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5242 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5243 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5244 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5245 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5246 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5247 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5248 | -s "Maximum incoming record payload length is 16384" |
| 5249 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5250 | # End of Record size limit tests |
| 5251 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5252 | # Tests for renegotiation |
| 5253 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5254 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5255 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5256 | # TLS 1.3 extensions in the initial handshake. |
| 5257 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5258 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5259 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5260 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5261 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5262 | 0 \ |
| 5263 | -C "client hello, adding renegotiation extension" \ |
| 5264 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5265 | -S "found renegotiation extension" \ |
| 5266 | -s "server hello, secure renegotiation extension" \ |
| 5267 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5268 | -C "=> renegotiate" \ |
| 5269 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5270 | -S "write hello request" |
| 5271 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5272 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5273 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5274 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5275 | "$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] | 5276 | 0 \ |
| 5277 | -c "client hello, adding renegotiation extension" \ |
| 5278 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5279 | -s "found renegotiation extension" \ |
| 5280 | -s "server hello, secure renegotiation extension" \ |
| 5281 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5282 | -c "=> renegotiate" \ |
| 5283 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5284 | -S "write hello request" |
| 5285 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5286 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5287 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5288 | "$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] | 5289 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5290 | 0 \ |
| 5291 | -c "client hello, adding renegotiation extension" \ |
| 5292 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5293 | -s "found renegotiation extension" \ |
| 5294 | -s "server hello, secure renegotiation extension" \ |
| 5295 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5296 | -c "=> renegotiate" \ |
| 5297 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5298 | -s "write hello request" |
| 5299 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5300 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5301 | # 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] | 5302 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5304 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5305 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5306 | "$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] | 5307 | 0 \ |
| 5308 | -c "client hello, adding renegotiation extension" \ |
| 5309 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5310 | -s "found renegotiation extension" \ |
| 5311 | -s "server hello, secure renegotiation extension" \ |
| 5312 | -c "found renegotiation extension" \ |
| 5313 | -c "=> renegotiate" \ |
| 5314 | -s "=> renegotiate" \ |
| 5315 | -S "write hello request" \ |
| 5316 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5317 | |
| 5318 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5319 | # 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] | 5320 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5322 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5323 | "$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] | 5324 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5325 | 0 \ |
| 5326 | -c "client hello, adding renegotiation extension" \ |
| 5327 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5328 | -s "found renegotiation extension" \ |
| 5329 | -s "server hello, secure renegotiation extension" \ |
| 5330 | -c "found renegotiation extension" \ |
| 5331 | -c "=> renegotiate" \ |
| 5332 | -s "=> renegotiate" \ |
| 5333 | -s "write hello request" \ |
| 5334 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5335 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5337 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5338 | "$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] | 5339 | "$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] | 5340 | 0 \ |
| 5341 | -c "client hello, adding renegotiation extension" \ |
| 5342 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5343 | -s "found renegotiation extension" \ |
| 5344 | -s "server hello, secure renegotiation extension" \ |
| 5345 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5346 | -c "=> renegotiate" \ |
| 5347 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5348 | -s "write hello request" |
| 5349 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5350 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5351 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5352 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5353 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5354 | "$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] | 5355 | "$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" \ |
| 5356 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5357 | -c "Maximum incoming record payload length is 2048" \ |
| 5358 | -c "Maximum outgoing record payload length is 2048" \ |
| 5359 | -s "Maximum incoming record payload length is 2048" \ |
| 5360 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5361 | -c "client hello, adding max_fragment_length extension" \ |
| 5362 | -s "found max fragment length extension" \ |
| 5363 | -s "server hello, max_fragment_length extension" \ |
| 5364 | -c "found max_fragment_length extension" \ |
| 5365 | -c "client hello, adding renegotiation extension" \ |
| 5366 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5367 | -s "found renegotiation extension" \ |
| 5368 | -s "server hello, secure renegotiation extension" \ |
| 5369 | -c "found renegotiation extension" \ |
| 5370 | -c "=> renegotiate" \ |
| 5371 | -s "=> renegotiate" \ |
| 5372 | -s "write hello request" |
| 5373 | |
| 5374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5375 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5376 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5377 | "$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] | 5378 | 1 \ |
| 5379 | -c "client hello, adding renegotiation extension" \ |
| 5380 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5381 | -S "found renegotiation extension" \ |
| 5382 | -s "server hello, secure renegotiation extension" \ |
| 5383 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5384 | -c "=> renegotiate" \ |
| 5385 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5386 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5387 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5388 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5389 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5390 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5391 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5392 | "$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] | 5393 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5394 | 0 \ |
| 5395 | -C "client hello, adding renegotiation extension" \ |
| 5396 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5397 | -S "found renegotiation extension" \ |
| 5398 | -s "server hello, secure renegotiation extension" \ |
| 5399 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5400 | -C "=> renegotiate" \ |
| 5401 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5402 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5403 | -S "SSL - An unexpected message was received from our peer" \ |
| 5404 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5405 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5407 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5408 | "$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] | 5409 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5410 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5411 | 0 \ |
| 5412 | -C "client hello, adding renegotiation extension" \ |
| 5413 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5414 | -S "found renegotiation extension" \ |
| 5415 | -s "server hello, secure renegotiation extension" \ |
| 5416 | -c "found renegotiation extension" \ |
| 5417 | -C "=> renegotiate" \ |
| 5418 | -S "=> renegotiate" \ |
| 5419 | -s "write hello request" \ |
| 5420 | -S "SSL - An unexpected message was received from our peer" \ |
| 5421 | -S "failed" |
| 5422 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5423 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5425 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5426 | "$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] | 5427 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5428 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5429 | 0 \ |
| 5430 | -C "client hello, adding renegotiation extension" \ |
| 5431 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5432 | -S "found renegotiation extension" \ |
| 5433 | -s "server hello, secure renegotiation extension" \ |
| 5434 | -c "found renegotiation extension" \ |
| 5435 | -C "=> renegotiate" \ |
| 5436 | -S "=> renegotiate" \ |
| 5437 | -s "write hello request" \ |
| 5438 | -S "SSL - An unexpected message was received from our peer" \ |
| 5439 | -S "failed" |
| 5440 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 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: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5443 | "$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] | 5444 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5445 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5446 | 0 \ |
| 5447 | -C "client hello, adding renegotiation extension" \ |
| 5448 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5449 | -S "found renegotiation extension" \ |
| 5450 | -s "server hello, secure renegotiation extension" \ |
| 5451 | -c "found renegotiation extension" \ |
| 5452 | -C "=> renegotiate" \ |
| 5453 | -S "=> renegotiate" \ |
| 5454 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5455 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [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-accepted, delay 0" \ |
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 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5460 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5461 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5462 | 0 \ |
| 5463 | -c "client hello, adding renegotiation extension" \ |
| 5464 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5465 | -s "found renegotiation extension" \ |
| 5466 | -s "server hello, secure renegotiation extension" \ |
| 5467 | -c "found renegotiation extension" \ |
| 5468 | -c "=> renegotiate" \ |
| 5469 | -s "=> renegotiate" \ |
| 5470 | -s "write hello request" \ |
| 5471 | -S "SSL - An unexpected message was received from our peer" \ |
| 5472 | -S "failed" |
| 5473 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5475 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5476 | "$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] | 5477 | "$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] | 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 | -S "record counter limit reached: renegotiate" \ |
| 5485 | -C "=> renegotiate" \ |
| 5486 | -S "=> renegotiate" \ |
| 5487 | -S "write hello request" \ |
| 5488 | -S "SSL - An unexpected message was received from our peer" \ |
| 5489 | -S "failed" |
| 5490 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5491 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5493 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5494 | "$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] | 5495 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [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 | -s "record counter limit reached: renegotiate" \ |
| 5503 | -c "=> renegotiate" \ |
| 5504 | -s "=> renegotiate" \ |
| 5505 | -s "write hello request" \ |
| 5506 | -S "SSL - An unexpected message was received from our peer" \ |
| 5507 | -S "failed" |
| 5508 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5510 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5511 | "$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] | 5512 | "$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] | 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 | -s "record counter limit reached: renegotiate" \ |
| 5520 | -c "=> renegotiate" \ |
| 5521 | -s "=> renegotiate" \ |
| 5522 | -s "write hello request" \ |
| 5523 | -S "SSL - An unexpected message was received from our peer" \ |
| 5524 | -S "failed" |
| 5525 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5526 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5527 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5528 | "$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] | 5529 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5530 | 0 \ |
| 5531 | -C "client hello, adding renegotiation extension" \ |
| 5532 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5533 | -S "found renegotiation extension" \ |
| 5534 | -s "server hello, secure renegotiation extension" \ |
| 5535 | -c "found renegotiation extension" \ |
| 5536 | -S "record counter limit reached: renegotiate" \ |
| 5537 | -C "=> renegotiate" \ |
| 5538 | -S "=> renegotiate" \ |
| 5539 | -S "write hello request" \ |
| 5540 | -S "SSL - An unexpected message was received from our peer" \ |
| 5541 | -S "failed" |
| 5542 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5543 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5544 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5545 | "$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] | 5546 | "$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] | 5547 | 0 \ |
| 5548 | -c "client hello, adding renegotiation extension" \ |
| 5549 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5550 | -s "found renegotiation extension" \ |
| 5551 | -s "server hello, secure renegotiation extension" \ |
| 5552 | -c "found renegotiation extension" \ |
| 5553 | -c "=> renegotiate" \ |
| 5554 | -s "=> renegotiate" \ |
| 5555 | -S "write hello request" |
| 5556 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5558 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5559 | "$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] | 5560 | "$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] | 5561 | 0 \ |
| 5562 | -c "client hello, adding renegotiation extension" \ |
| 5563 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5564 | -s "found renegotiation extension" \ |
| 5565 | -s "server hello, secure renegotiation extension" \ |
| 5566 | -c "found renegotiation extension" \ |
| 5567 | -c "=> renegotiate" \ |
| 5568 | -s "=> renegotiate" \ |
| 5569 | -s "write hello request" |
| 5570 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5571 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5573 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | 56ee69d | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5574 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5575 | "$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] | 5576 | 0 \ |
| 5577 | -c "client hello, adding renegotiation extension" \ |
| 5578 | -c "found renegotiation extension" \ |
| 5579 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5580 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5581 | -C "error" \ |
| 5582 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5583 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5584 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5585 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5587 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5588 | "$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] | 5589 | "$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] | 5590 | 0 \ |
| 5591 | -c "client hello, adding renegotiation extension" \ |
| 5592 | -c "found renegotiation extension" \ |
| 5593 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5594 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5595 | -C "error" \ |
| 5596 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5597 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5598 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5599 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5601 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5602 | "$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] | 5603 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5604 | 1 \ |
| 5605 | -c "client hello, adding renegotiation extension" \ |
| 5606 | -C "found renegotiation extension" \ |
| 5607 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5608 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5609 | -c "error" \ |
| 5610 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5611 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5612 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5613 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5615 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5616 | "$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] | 5617 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5618 | allow_legacy=0" \ |
| 5619 | 1 \ |
| 5620 | -c "client hello, adding renegotiation extension" \ |
| 5621 | -C "found renegotiation extension" \ |
| 5622 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5623 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5624 | -c "error" \ |
| 5625 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5626 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5627 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5628 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5630 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5631 | "$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] | 5632 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5633 | allow_legacy=1" \ |
| 5634 | 0 \ |
| 5635 | -c "client hello, adding renegotiation extension" \ |
| 5636 | -C "found renegotiation extension" \ |
| 5637 | -c "=> renegotiate" \ |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5638 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5639 | -C "error" \ |
| 5640 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5641 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5644 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5645 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5646 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5647 | 0 \ |
| 5648 | -c "client hello, adding renegotiation extension" \ |
| 5649 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5650 | -s "found renegotiation extension" \ |
| 5651 | -s "server hello, secure renegotiation extension" \ |
| 5652 | -c "found renegotiation extension" \ |
| 5653 | -c "=> renegotiate" \ |
| 5654 | -s "=> renegotiate" \ |
| 5655 | -S "write hello request" |
| 5656 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5657 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5659 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5660 | "$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] | 5661 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5662 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5663 | 0 \ |
| 5664 | -c "client hello, adding renegotiation extension" \ |
| 5665 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5666 | -s "found renegotiation extension" \ |
| 5667 | -s "server hello, secure renegotiation extension" \ |
| 5668 | -c "found renegotiation extension" \ |
| 5669 | -c "=> renegotiate" \ |
| 5670 | -s "=> renegotiate" \ |
| 5671 | -s "write hello request" |
| 5672 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5673 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5675 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5676 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5677 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5678 | 0 \ |
| 5679 | -c "client hello, adding renegotiation extension" \ |
| 5680 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5681 | -s "found renegotiation extension" \ |
| 5682 | -s "server hello, secure renegotiation extension" \ |
| 5683 | -s "record counter limit reached: renegotiate" \ |
| 5684 | -c "=> renegotiate" \ |
| 5685 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5686 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5687 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5688 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5689 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5691 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5692 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5693 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5694 | 0 \ |
| 5695 | -c "client hello, adding renegotiation extension" \ |
| 5696 | -c "found renegotiation extension" \ |
| 5697 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5698 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5699 | -C "error" \ |
| 5700 | -s "Extra-header:" |
| 5701 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5702 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5703 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5704 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5707 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5708 | "$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] | 5709 | "$P_CLI debug_level=3" \ |
| 5710 | 0 \ |
| 5711 | -c "found renegotiation extension" \ |
| 5712 | -C "error" \ |
| 5713 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5714 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5715 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5718 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5719 | "$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] | 5720 | "$P_CLI debug_level=3" \ |
| 5721 | 0 \ |
| 5722 | -C "found renegotiation extension" \ |
| 5723 | -C "error" \ |
| 5724 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5725 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5726 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5727 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5729 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5730 | "$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] | 5731 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5732 | 1 \ |
| 5733 | -C "found renegotiation extension" \ |
| 5734 | -c "error" \ |
| 5735 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5736 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5737 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5738 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5740 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5741 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5742 | "$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] | 5743 | 0 \ |
| 5744 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5745 | -s "server hello, secure renegotiation extension" |
| 5746 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5747 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5748 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5750 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5751 | "$P_SRV debug_level=3" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5752 | "$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] | 5753 | 0 \ |
| 5754 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5755 | -S "server hello, secure renegotiation extension" |
| 5756 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5757 | requires_gnutls |
Gilles Peskine | 6191f4a | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5760 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5761 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | 01fde2c | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5762 | "$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] | 5763 | 1 \ |
| 5764 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5765 | -S "server hello, secure renegotiation extension" |
| 5766 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5767 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5768 | |
| 5769 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5771 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5772 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5773 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5774 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5775 | 0 \ |
| 5776 | -c "Handshake was completed" \ |
| 5777 | |
| 5778 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5780 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5781 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5782 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5783 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5784 | 0 \ |
| 5785 | -c "Handshake was completed" \ |
| 5786 | |
| 5787 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5789 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5790 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5791 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5792 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5793 | 0 \ |
| 5794 | -c "Handshake was completed" \ |
| 5795 | |
| 5796 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5798 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5799 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5800 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5801 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5802 | 0 \ |
| 5803 | -c "Handshake was completed" \ |
| 5804 | |
| 5805 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5807 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5808 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5809 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5810 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5811 | 0 \ |
| 5812 | -c "Handshake was completed" \ |
| 5813 | |
| 5814 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5816 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5817 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5818 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5819 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5820 | 0 \ |
| 5821 | -c "Handshake was completed" \ |
| 5822 | |
| 5823 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5825 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5826 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5827 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5828 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5829 | 0 \ |
| 5830 | -c "Handshake was completed" \ |
| 5831 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5832 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5833 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5834 | |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5835 | # 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] | 5836 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5837 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5838 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5839 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5840 | 1 \ |
| 5841 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5842 | -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] | 5843 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5844 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5845 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5846 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5847 | # We don't check that the server receives the alert because it might |
| 5848 | # detect that its write end of the connection is closed and abort |
| 5849 | # before reading the alert message. |
| 5850 | |
| 5851 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5852 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5853 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5854 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5855 | 1 \ |
| 5856 | -c "x509_verify_cert() returned" \ |
| 5857 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5858 | -c "! mbedtls_ssl_handshake returned" \ |
| 5859 | -c "send alert level=2 message=48" \ |
| 5860 | -c "X509 - Certificate verification failed" |
| 5861 | # 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] | 5862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5863 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5864 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5865 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5866 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5867 | 0 \ |
| 5868 | -c "x509_verify_cert() returned" \ |
| 5869 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5870 | -C "! mbedtls_ssl_handshake returned" \ |
| 5871 | -C "send alert level=2 message=48" \ |
| 5872 | -C "X509 - Certificate verification failed" |
| 5873 | |
| 5874 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5875 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5876 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5877 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5880 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5881 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5882 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5883 | -C "X509 - Certificate verification failed" |
| 5884 | |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5885 | run_test "Authentication: server badcert, client none" \ |
| 5886 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5887 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5888 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5889 | 0 \ |
| 5890 | -C "x509_verify_cert() returned" \ |
| 5891 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5892 | -C "! mbedtls_ssl_handshake returned" \ |
| 5893 | -C "send alert level=2 message=48" \ |
| 5894 | -C "X509 - Certificate verification failed" |
| 5895 | |
| 5896 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 5897 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5898 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5899 | "$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] | 5900 | 0 \ |
| 5901 | -C "x509_verify_cert() returned" \ |
| 5902 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5903 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0274175 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5904 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 946d14a | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5905 | -C "X509 - Certificate verification failed" |
| 5906 | |
Manuel Pégourié-Gonnard | 18dd213 | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 5907 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5908 | "$P_SRV" \ |
| 5909 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5910 | 1 \ |
| 5911 | -c "x509_verify_cert() returned" \ |
| 5912 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5913 | -c "! Certificate verification flags"\ |
| 5914 | -c "! mbedtls_ssl_handshake returned" \ |
| 5915 | -c "SSL - No CA Chain is set, but required to operate" |
| 5916 | |
| 5917 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5918 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5919 | "$P_SRV force_version=tls12" \ |
| 5920 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5921 | 1 \ |
| 5922 | -c "x509_verify_cert() returned" \ |
| 5923 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5924 | -c "! Certificate verification flags"\ |
| 5925 | -c "! mbedtls_ssl_handshake returned" \ |
| 5926 | -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] | 5927 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5928 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5929 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5930 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5931 | 0 \ |
| 5932 | -c "x509_verify_cert() returned" \ |
| 5933 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5934 | -c "! Certificate verification flags"\ |
| 5935 | -C "! mbedtls_ssl_handshake returned" \ |
| 5936 | -C "X509 - Certificate verification failed" \ |
| 5937 | -C "SSL - No CA Chain is set, but required to operate" |
| 5938 | |
| 5939 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5940 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 5941 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5942 | "$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] | 5943 | 0 \ |
| 5944 | -c "x509_verify_cert() returned" \ |
| 5945 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5946 | -c "! Certificate verification flags"\ |
| 5947 | -C "! mbedtls_ssl_handshake returned" \ |
| 5948 | -C "X509 - Certificate verification failed" \ |
| 5949 | -C "SSL - No CA Chain is set, but required to operate" |
| 5950 | |
Manuel Pégourié-Gonnard | 6901504 | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5951 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 5952 | "$P_SRV" \ |
| 5953 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5954 | 0 \ |
| 5955 | -C "x509_verify_cert() returned" \ |
| 5956 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5957 | -C "! Certificate verification flags"\ |
| 5958 | -C "! mbedtls_ssl_handshake returned" \ |
| 5959 | -C "X509 - Certificate verification failed" \ |
| 5960 | -C "SSL - No CA Chain is set, but required to operate" |
| 5961 | |
| 5962 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5963 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 5964 | "$P_SRV" \ |
| 5965 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 5966 | 0 \ |
| 5967 | -C "x509_verify_cert() returned" \ |
| 5968 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5969 | -C "! Certificate verification flags"\ |
| 5970 | -C "! mbedtls_ssl_handshake returned" \ |
| 5971 | -C "X509 - Certificate verification failed" \ |
| 5972 | -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] | 5973 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5974 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5975 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5976 | # the client informs the server about the supported curves - it does, though, in the |
| 5977 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5978 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5979 | # different means to have the server ignoring the client's supported curve list. |
| 5980 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5981 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5982 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5983 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5984 | "$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] | 5985 | 1 \ |
| 5986 | -c "bad certificate (EC key curve)"\ |
| 5987 | -c "! Certificate verification flags"\ |
| 5988 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5989 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5990 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5991 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5992 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5993 | "$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] | 5994 | 1 \ |
| 5995 | -c "bad certificate (EC key curve)"\ |
| 5996 | -c "! Certificate verification flags"\ |
| 5997 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5998 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5999 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6000 | run_test "Authentication: client SHA256, server required" \ |
| 6001 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6002 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6003 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6004 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6005 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6006 | -c "Supported Signature Algorithm found: 04 " \ |
| 6007 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6008 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6009 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6010 | run_test "Authentication: client SHA384, server required" \ |
| 6011 | "$P_SRV auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6012 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6013 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6014 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6015 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6016 | -c "Supported Signature Algorithm found: 04 " \ |
| 6017 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6018 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6019 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6020 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6021 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6022 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6023 | 1 \ |
| 6024 | -S "skip write certificate request" \ |
| 6025 | -C "skip parse certificate request" \ |
| 6026 | -c "got a certificate request" \ |
| 6027 | -c "= write certificate$" \ |
| 6028 | -C "skip write certificate$" \ |
| 6029 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6030 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6031 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6032 | -s "No client certification received from the client, but required by the authentication mode" |
| 6033 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6034 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6035 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6036 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6037 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6038 | 1 \ |
| 6039 | -S "skip write certificate request" \ |
| 6040 | -C "skip parse certificate request" \ |
| 6041 | -c "got a certificate request" \ |
| 6042 | -C "skip write certificate" \ |
| 6043 | -C "skip write certificate verify" \ |
| 6044 | -S "skip parse certificate verify" \ |
| 6045 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6046 | -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] | 6047 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6048 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6049 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6050 | # We don't check that the client receives the alert because it might |
| 6051 | # detect that its write end of the connection is closed and abort |
| 6052 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6053 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6054 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6055 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6056 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6057 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6058 | 0 \ |
| 6059 | -S "skip write certificate request" \ |
| 6060 | -C "skip parse certificate request" \ |
| 6061 | -c "got a certificate request" \ |
| 6062 | -C "skip write certificate" \ |
| 6063 | -C "skip write certificate verify" \ |
| 6064 | -S "skip parse certificate verify" \ |
| 6065 | -S "x509_verify_cert() returned" \ |
| 6066 | -S "! The certificate is not correctly signed" \ |
| 6067 | -S "X509 - Certificate verification failed" |
| 6068 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6069 | run_test "Authentication: client cert not trusted, server required" \ |
| 6070 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6071 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6072 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6073 | 1 \ |
| 6074 | -S "skip write certificate request" \ |
| 6075 | -C "skip parse certificate request" \ |
| 6076 | -c "got a certificate request" \ |
| 6077 | -C "skip write certificate" \ |
| 6078 | -C "skip write certificate verify" \ |
| 6079 | -S "skip parse certificate verify" \ |
| 6080 | -s "x509_verify_cert() returned" \ |
| 6081 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6082 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6083 | -s "X509 - Certificate verification failed" |
| 6084 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6085 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6086 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6087 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6088 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6089 | 0 \ |
| 6090 | -S "skip write certificate request" \ |
| 6091 | -C "skip parse certificate request" \ |
| 6092 | -c "got a certificate request" \ |
| 6093 | -C "skip write certificate" \ |
| 6094 | -C "skip write certificate verify" \ |
| 6095 | -S "skip parse certificate verify" \ |
| 6096 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6097 | -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] | 6098 | -S "! mbedtls_ssl_handshake returned" \ |
| 6099 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6100 | -S "X509 - Certificate verification failed" |
| 6101 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6102 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6103 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6104 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6105 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6106 | 0 \ |
| 6107 | -s "skip write certificate request" \ |
| 6108 | -C "skip parse certificate request" \ |
| 6109 | -c "got no certificate request" \ |
| 6110 | -c "skip write certificate" \ |
| 6111 | -c "skip write certificate verify" \ |
| 6112 | -s "skip parse certificate verify" \ |
| 6113 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6114 | -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] | 6115 | -S "! mbedtls_ssl_handshake returned" \ |
| 6116 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6117 | -S "X509 - Certificate verification failed" |
| 6118 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6119 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6120 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6121 | "$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] | 6122 | 0 \ |
| 6123 | -S "skip write certificate request" \ |
| 6124 | -C "skip parse certificate request" \ |
| 6125 | -c "got a certificate request" \ |
| 6126 | -C "skip write certificate$" \ |
| 6127 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6128 | -c "skip write certificate verify" \ |
| 6129 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6130 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6131 | -S "! mbedtls_ssl_handshake returned" \ |
| 6132 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6133 | -S "X509 - Certificate verification failed" |
| 6134 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6135 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6136 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6137 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6138 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6139 | 0 \ |
| 6140 | -S "skip write certificate request" \ |
| 6141 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6142 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6143 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6144 | -S "X509 - Certificate verification failed" |
| 6145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6147 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6148 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6149 | "$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] | 6150 | 0 \ |
| 6151 | -C "skip parse certificate request" \ |
| 6152 | -c "got a certificate request" \ |
| 6153 | -C "skip write certificate$" \ |
| 6154 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6155 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6158 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6159 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6160 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6161 | 1 \ |
| 6162 | -C "skip parse certificate request" \ |
| 6163 | -c "got a certificate request" \ |
| 6164 | -C "skip write certificate$" \ |
| 6165 | -c "skip write certificate verify" \ |
| 6166 | -c "! mbedtls_ssl_handshake returned" |
| 6167 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6168 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6169 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6170 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6171 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6172 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6173 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6174 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6175 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6176 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6177 | # 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] | 6178 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6179 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6180 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6181 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6182 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6183 | "$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] | 6184 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6185 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6186 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6187 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6188 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6189 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6190 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6191 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6192 | "$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] | 6193 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6194 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6195 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6196 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6197 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6198 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6199 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6200 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 58ab9ba | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6201 | "$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] | 6202 | auth_mode=optional" \ |
| 6203 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6204 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6205 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6206 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6207 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6208 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6209 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6210 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6211 | "$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] | 6212 | auth_mode=none" \ |
| 6213 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6214 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6215 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6216 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6217 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6218 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6219 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6220 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6221 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6222 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6223 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6224 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6225 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6226 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6227 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6228 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6229 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6230 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6231 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6232 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6233 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6234 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6235 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6236 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6237 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6238 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6239 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6240 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6241 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6242 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6243 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6244 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6245 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6246 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6247 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6248 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6249 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6250 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6251 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6252 | # Tests for CA list in CertificateRequest messages |
| 6253 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6254 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6255 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6256 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6257 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6258 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6259 | 0 \ |
| 6260 | -s "requested DN" |
| 6261 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6262 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6263 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6264 | "$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] | 6265 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6266 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6267 | 0 \ |
| 6268 | -S "requested DN" |
| 6269 | |
| 6270 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6271 | "$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] | 6272 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6273 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6274 | 1 \ |
| 6275 | -S "requested DN" \ |
| 6276 | -s "x509_verify_cert() returned" \ |
| 6277 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6278 | -s "! mbedtls_ssl_handshake returned" \ |
| 6279 | -c "! mbedtls_ssl_handshake returned" \ |
| 6280 | -s "X509 - Certificate verification failed" |
| 6281 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6282 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6283 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6284 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6285 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6286 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6287 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6288 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6289 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6290 | 0 \ |
| 6291 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6292 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6293 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6294 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6295 | "$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] | 6296 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6297 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6298 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6299 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6300 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6301 | 0 \ |
| 6302 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6303 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6304 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6305 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6306 | "$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] | 6307 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6308 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6309 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6310 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6311 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6312 | 0 \ |
| 6313 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6314 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6315 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6316 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6317 | |
| 6318 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6319 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6320 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6321 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6322 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6323 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6324 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6325 | -c "x509_verify_cert() returned" \ |
| 6326 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6327 | -c "! mbedtls_ssl_handshake returned" \ |
| 6328 | -c "X509 - Certificate verification failed" |
| 6329 | |
| 6330 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6331 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6332 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6333 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6334 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6335 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6336 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6337 | -c "x509_verify_cert() returned" \ |
| 6338 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6339 | -C "! mbedtls_ssl_handshake returned" \ |
| 6340 | -C "X509 - Certificate verification failed" |
| 6341 | |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6342 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6343 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6344 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6345 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6346 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6347 | 0 \ |
| 6348 | -C "use CA callback for X.509 CRT verification" \ |
| 6349 | -C "x509_verify_cert() returned" \ |
| 6350 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6351 | -C "! mbedtls_ssl_handshake returned" \ |
| 6352 | -C "X509 - Certificate verification failed" |
| 6353 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6354 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6355 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6356 | # the client informs the server about the supported curves - it does, though, in the |
| 6357 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6358 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6359 | # different means to have the server ignoring the client's supported curve list. |
| 6360 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6361 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6362 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6363 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6364 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6365 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required groups=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6366 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6367 | -c "use CA callback for X.509 CRT verification" \ |
| 6368 | -c "bad certificate (EC key curve)" \ |
| 6369 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6370 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6371 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6372 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6373 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6374 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6375 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6376 | "$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] | 6377 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6378 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6379 | -c "bad certificate (EC key curve)"\ |
| 6380 | -c "! Certificate verification flags"\ |
| 6381 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6382 | |
| 6383 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6384 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6385 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6386 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6387 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6388 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6389 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6390 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6391 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6392 | -c "Supported Signature Algorithm found: 04 " \ |
| 6393 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6394 | |
| 6395 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6396 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 7a442c9 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6397 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6398 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6399 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6400 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6401 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6402 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6403 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6404 | -c "Supported Signature Algorithm found: 04 " \ |
| 6405 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6406 | |
| 6407 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6408 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6409 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6410 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6411 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6412 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6413 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6414 | -S "skip write certificate request" \ |
| 6415 | -C "skip parse certificate request" \ |
| 6416 | -c "got a certificate request" \ |
| 6417 | -C "skip write certificate" \ |
| 6418 | -C "skip write certificate verify" \ |
| 6419 | -S "skip parse certificate verify" \ |
| 6420 | -s "x509_verify_cert() returned" \ |
| 6421 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6422 | -s "! mbedtls_ssl_handshake returned" \ |
| 6423 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6424 | -s "X509 - Certificate verification failed" |
| 6425 | # We don't check that the client receives the alert because it might |
| 6426 | # detect that its write end of the connection is closed and abort |
| 6427 | # before reading the alert message. |
| 6428 | |
| 6429 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6430 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6431 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6432 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6433 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6434 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6435 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6436 | -S "skip write certificate request" \ |
| 6437 | -C "skip parse certificate request" \ |
| 6438 | -c "got a certificate request" \ |
| 6439 | -C "skip write certificate" \ |
| 6440 | -C "skip write certificate verify" \ |
| 6441 | -S "skip parse certificate verify" \ |
| 6442 | -s "x509_verify_cert() returned" \ |
| 6443 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6444 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6445 | -s "X509 - Certificate verification failed" |
| 6446 | |
| 6447 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6448 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6449 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6450 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6451 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6452 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6453 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6454 | -S "skip write certificate request" \ |
| 6455 | -C "skip parse certificate request" \ |
| 6456 | -c "got a certificate request" \ |
| 6457 | -C "skip write certificate" \ |
| 6458 | -C "skip write certificate verify" \ |
| 6459 | -S "skip parse certificate verify" \ |
| 6460 | -s "x509_verify_cert() returned" \ |
| 6461 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6462 | -S "! mbedtls_ssl_handshake returned" \ |
| 6463 | -C "! mbedtls_ssl_handshake returned" \ |
| 6464 | -S "X509 - Certificate verification failed" |
| 6465 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6466 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6467 | requires_full_size_output_buffer |
| 6468 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6469 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6470 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6471 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6472 | "$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] | 6473 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6474 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6475 | -C "X509 - A fatal error occurred" |
| 6476 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6477 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6478 | requires_full_size_output_buffer |
| 6479 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6480 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6481 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6482 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6483 | "$P_CLI 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] | 6484 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6485 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6486 | -c "X509 - A fatal error occurred" |
| 6487 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6488 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6489 | requires_full_size_output_buffer |
| 6490 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6491 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6492 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6493 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6494 | "$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] | 6495 | debug_level=3 auth_mode=optional" \ |
| 6496 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6497 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6498 | -c "X509 - A fatal error occurred" |
| 6499 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6500 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6501 | requires_full_size_output_buffer |
| 6502 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6503 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6504 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6505 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6506 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6507 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6508 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6509 | -s "X509 - A fatal error occurred" |
| 6510 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6511 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6512 | requires_full_size_output_buffer |
| 6513 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6514 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6515 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6516 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6517 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6518 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6519 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6520 | -s "X509 - A fatal error occurred" |
| 6521 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6522 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6523 | requires_full_size_output_buffer |
| 6524 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6525 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 95dd6f5 | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6526 | "$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] | 6527 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6528 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6529 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6530 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6531 | -S "X509 - A fatal error occurred" |
| 6532 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6533 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6534 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6535 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6536 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6537 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6538 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6539 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6540 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6541 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6542 | 0 \ |
| 6543 | -c "signed using.*ECDSA with SHA256" \ |
| 6544 | -C "signed using.*ECDSA with SHA1" |
| 6545 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6546 | # tests for SNI |
| 6547 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6548 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6549 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6550 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6551 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6552 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6553 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6554 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6555 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6556 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6557 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6558 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6559 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6560 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6561 | 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] | 6562 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6563 | 0 \ |
| 6564 | -s "parse ServerName extension" \ |
| 6565 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6566 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6567 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6568 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6569 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6570 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6571 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6572 | 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] | 6573 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6574 | 0 \ |
| 6575 | -s "parse ServerName extension" \ |
| 6576 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6577 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6578 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6579 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6580 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6581 | "$P_SRV debug_level=3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6582 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6583 | 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] | 6584 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6585 | 1 \ |
| 6586 | -s "parse ServerName extension" \ |
| 6587 | -s "ssl_sni_wrapper() returned" \ |
| 6588 | -s "mbedtls_ssl_handshake returned" \ |
| 6589 | -c "mbedtls_ssl_handshake returned" \ |
| 6590 | -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] | 6591 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6592 | run_test "SNI: client auth no override: optional" \ |
| 6593 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6594 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6595 | 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] | 6596 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6597 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6598 | -S "skip write certificate request" \ |
| 6599 | -C "skip parse certificate request" \ |
| 6600 | -c "got a certificate request" \ |
| 6601 | -C "skip write certificate" \ |
| 6602 | -C "skip write certificate verify" \ |
| 6603 | -S "skip parse certificate verify" |
| 6604 | |
| 6605 | run_test "SNI: client auth override: none -> optional" \ |
| 6606 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6607 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6608 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,optional" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6609 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6610 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6611 | -S "skip write certificate request" \ |
| 6612 | -C "skip parse certificate request" \ |
| 6613 | -c "got a certificate request" \ |
| 6614 | -C "skip write certificate" \ |
| 6615 | -C "skip write certificate verify" \ |
| 6616 | -S "skip parse certificate verify" |
| 6617 | |
| 6618 | run_test "SNI: client auth override: optional -> none" \ |
| 6619 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6620 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6621 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6622 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6623 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6624 | -s "skip write certificate request" \ |
| 6625 | -C "skip parse certificate request" \ |
| 6626 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6627 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6628 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6629 | run_test "SNI: CA no override" \ |
| 6630 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6631 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6632 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6633 | 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] | 6634 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6635 | 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] | 6636 | 1 \ |
| 6637 | -S "skip write certificate request" \ |
| 6638 | -C "skip parse certificate request" \ |
| 6639 | -c "got a certificate request" \ |
| 6640 | -C "skip write certificate" \ |
| 6641 | -C "skip write certificate verify" \ |
| 6642 | -S "skip parse certificate verify" \ |
| 6643 | -s "x509_verify_cert() returned" \ |
| 6644 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6645 | -S "The certificate has been revoked (is on a CRL)" |
| 6646 | |
| 6647 | run_test "SNI: CA override" \ |
| 6648 | "$P_SRV debug_level=3 auth_mode=optional \ |
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 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6651 | 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] | 6652 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6653 | 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] | 6654 | 0 \ |
| 6655 | -S "skip write certificate request" \ |
| 6656 | -C "skip parse certificate request" \ |
| 6657 | -c "got a certificate request" \ |
| 6658 | -C "skip write certificate" \ |
| 6659 | -C "skip write certificate verify" \ |
| 6660 | -S "skip parse certificate verify" \ |
| 6661 | -S "x509_verify_cert() returned" \ |
| 6662 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6663 | -S "The certificate has been revoked (is on a CRL)" |
| 6664 | |
| 6665 | run_test "SNI: CA override with CRL" \ |
| 6666 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6667 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6668 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6669 | 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] | 6670 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6671 | 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] | 6672 | 1 \ |
| 6673 | -S "skip write certificate request" \ |
| 6674 | -C "skip parse certificate request" \ |
| 6675 | -c "got a certificate request" \ |
| 6676 | -C "skip write certificate" \ |
| 6677 | -C "skip write certificate verify" \ |
| 6678 | -S "skip parse certificate verify" \ |
| 6679 | -s "x509_verify_cert() returned" \ |
| 6680 | -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] | 6681 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6682 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6683 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6684 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6685 | # Tests for SNI and DTLS |
| 6686 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6687 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6689 | run_test "SNI: DTLS, no SNI callback" \ |
| 6690 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6691 | 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] | 6692 | "$P_CLI server_name=localhost dtls=1" \ |
| 6693 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6694 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6695 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6696 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6697 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6699 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6700 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6701 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6702 | 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] | 6703 | "$P_CLI server_name=localhost dtls=1" \ |
| 6704 | 0 \ |
| 6705 | -s "parse ServerName extension" \ |
| 6706 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6707 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6708 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6709 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6711 | run_test "SNI: DTLS, matching cert 2" \ |
| 6712 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6713 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6714 | 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] | 6715 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6716 | 0 \ |
| 6717 | -s "parse ServerName extension" \ |
| 6718 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6719 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6720 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6722 | run_test "SNI: DTLS, no matching cert" \ |
| 6723 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6724 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6725 | 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] | 6726 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6727 | 1 \ |
| 6728 | -s "parse ServerName extension" \ |
| 6729 | -s "ssl_sni_wrapper() returned" \ |
| 6730 | -s "mbedtls_ssl_handshake returned" \ |
| 6731 | -c "mbedtls_ssl_handshake returned" \ |
| 6732 | -c "SSL - A fatal alert message was received from our peer" |
| 6733 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6735 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6736 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6737 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6738 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6739 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6740 | 0 \ |
| 6741 | -S "skip write certificate request" \ |
| 6742 | -C "skip parse certificate request" \ |
| 6743 | -c "got a certificate request" \ |
| 6744 | -C "skip write certificate" \ |
| 6745 | -C "skip write certificate verify" \ |
| 6746 | -S "skip parse certificate verify" |
| 6747 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6749 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6750 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6751 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6752 | 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] | 6753 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6754 | 0 \ |
| 6755 | -S "skip write certificate request" \ |
| 6756 | -C "skip parse certificate request" \ |
| 6757 | -c "got a certificate request" \ |
| 6758 | -C "skip write certificate" \ |
| 6759 | -C "skip write certificate verify" \ |
| 6760 | -S "skip parse certificate verify" |
| 6761 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6763 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6764 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6765 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6766 | 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] | 6767 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6768 | 0 \ |
| 6769 | -s "skip write certificate request" \ |
| 6770 | -C "skip parse certificate request" \ |
| 6771 | -c "got no certificate request" \ |
| 6772 | -c "skip write certificate" \ |
| 6773 | -c "skip write certificate verify" \ |
| 6774 | -s "skip parse certificate verify" |
| 6775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6777 | run_test "SNI: DTLS, CA no override" \ |
| 6778 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6779 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6780 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6781 | 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] | 6782 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6783 | 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] | 6784 | 1 \ |
| 6785 | -S "skip write certificate request" \ |
| 6786 | -C "skip parse certificate request" \ |
| 6787 | -c "got a certificate request" \ |
| 6788 | -C "skip write certificate" \ |
| 6789 | -C "skip write certificate verify" \ |
| 6790 | -S "skip parse certificate verify" \ |
| 6791 | -s "x509_verify_cert() returned" \ |
| 6792 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6793 | -S "The certificate has been revoked (is on a CRL)" |
| 6794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6796 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6797 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6798 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6799 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6800 | 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] | 6801 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6802 | 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] | 6803 | 0 \ |
| 6804 | -S "skip write certificate request" \ |
| 6805 | -C "skip parse certificate request" \ |
| 6806 | -c "got a certificate request" \ |
| 6807 | -C "skip write certificate" \ |
| 6808 | -C "skip write certificate verify" \ |
| 6809 | -S "skip parse certificate verify" \ |
| 6810 | -S "x509_verify_cert() returned" \ |
| 6811 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6812 | -S "The certificate has been revoked (is on a CRL)" |
| 6813 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6815 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6816 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6817 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6818 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6819 | 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] | 6820 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6821 | 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] | 6822 | 1 \ |
| 6823 | -S "skip write certificate request" \ |
| 6824 | -C "skip parse certificate request" \ |
| 6825 | -c "got a certificate request" \ |
| 6826 | -C "skip write certificate" \ |
| 6827 | -C "skip write certificate verify" \ |
| 6828 | -S "skip parse certificate verify" \ |
| 6829 | -s "x509_verify_cert() returned" \ |
| 6830 | -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] | 6831 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6832 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 2ffa53a | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6833 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6834 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6835 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6837 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6838 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6839 | "$P_CLI nbio=2 tickets=0" \ |
| 6840 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6841 | -S "mbedtls_ssl_handshake returned" \ |
| 6842 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6843 | -c "Read from server: .* bytes read" |
| 6844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6845 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6846 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6847 | "$P_CLI nbio=2 tickets=0" \ |
| 6848 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6849 | -S "mbedtls_ssl_handshake returned" \ |
| 6850 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6851 | -c "Read from server: .* bytes read" |
| 6852 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6853 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6854 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6855 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6856 | "$P_CLI nbio=2 tickets=1" \ |
| 6857 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6858 | -S "mbedtls_ssl_handshake returned" \ |
| 6859 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6860 | -c "Read from server: .* bytes read" |
| 6861 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6862 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6863 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6864 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6865 | "$P_CLI nbio=2 tickets=1" \ |
| 6866 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6867 | -S "mbedtls_ssl_handshake returned" \ |
| 6868 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6869 | -c "Read from server: .* bytes read" |
| 6870 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6871 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6872 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6873 | 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] | 6874 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6875 | "$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] | 6876 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6877 | -S "mbedtls_ssl_handshake returned" \ |
| 6878 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6879 | -c "Read from server: .* bytes read" |
| 6880 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6882 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6883 | 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] | 6884 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6885 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6886 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6887 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6888 | 0 \ |
| 6889 | -S "mbedtls_ssl_handshake returned" \ |
| 6890 | -C "mbedtls_ssl_handshake returned" \ |
| 6891 | -c "Read from server: .* bytes read" |
| 6892 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6893 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6894 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6895 | 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] | 6896 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6897 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6898 | 0 \ |
| 6899 | -S "mbedtls_ssl_handshake returned" \ |
| 6900 | -C "mbedtls_ssl_handshake returned" \ |
| 6901 | -c "Read from server: .* bytes read" |
| 6902 | |
| 6903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6904 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6905 | 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] | 6906 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6907 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6908 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6909 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6910 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6911 | -S "mbedtls_ssl_handshake returned" \ |
| 6912 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6913 | -c "Read from server: .* bytes read" |
| 6914 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6915 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6916 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6917 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6918 | "$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] | 6919 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6920 | -S "mbedtls_ssl_handshake returned" \ |
| 6921 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6922 | -c "Read from server: .* bytes read" |
| 6923 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6924 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6925 | |
| 6926 | run_test "Event-driven I/O: basic handshake" \ |
| 6927 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6928 | "$P_CLI event=1 tickets=0" \ |
| 6929 | 0 \ |
| 6930 | -S "mbedtls_ssl_handshake returned" \ |
| 6931 | -C "mbedtls_ssl_handshake returned" \ |
| 6932 | -c "Read from server: .* bytes read" |
| 6933 | |
| 6934 | run_test "Event-driven I/O: client auth" \ |
| 6935 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6936 | "$P_CLI event=1 tickets=0" \ |
| 6937 | 0 \ |
| 6938 | -S "mbedtls_ssl_handshake returned" \ |
| 6939 | -C "mbedtls_ssl_handshake returned" \ |
| 6940 | -c "Read from server: .* bytes read" |
| 6941 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6942 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6943 | run_test "Event-driven I/O: ticket" \ |
| 6944 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6945 | "$P_CLI event=1 tickets=1" \ |
| 6946 | 0 \ |
| 6947 | -S "mbedtls_ssl_handshake returned" \ |
| 6948 | -C "mbedtls_ssl_handshake returned" \ |
| 6949 | -c "Read from server: .* bytes read" |
| 6950 | |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6951 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6952 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6953 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6954 | "$P_CLI event=1 tickets=1" \ |
| 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 "Event-driven I/O: TLS 1.2 + ticket + client auth + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6963 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6964 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6965 | 0 \ |
| 6966 | -S "mbedtls_ssl_handshake returned" \ |
| 6967 | -C "mbedtls_ssl_handshake returned" \ |
| 6968 | -c "Read from server: .* bytes read" |
| 6969 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 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 "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6975 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6976 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6977 | 0 \ |
| 6978 | -S "mbedtls_ssl_handshake returned" \ |
| 6979 | -C "mbedtls_ssl_handshake returned" \ |
| 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 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6983 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6984 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6985 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6986 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6987 | 0 \ |
| 6988 | -S "mbedtls_ssl_handshake returned" \ |
| 6989 | -C "mbedtls_ssl_handshake returned" \ |
| 6990 | -c "Read from server: .* bytes read" |
| 6991 | |
| 6992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6993 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6994 | 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] | 6995 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6996 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6997 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6998 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6999 | 0 \ |
| 7000 | -S "mbedtls_ssl_handshake returned" \ |
| 7001 | -C "mbedtls_ssl_handshake returned" \ |
| 7002 | -c "Read from server: .* bytes read" |
| 7003 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7004 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7005 | run_test "Event-driven I/O: session-id resume" \ |
| 7006 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7007 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7008 | 0 \ |
| 7009 | -S "mbedtls_ssl_handshake returned" \ |
| 7010 | -C "mbedtls_ssl_handshake returned" \ |
| 7011 | -c "Read from server: .* bytes read" |
| 7012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7014 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7015 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7016 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7017 | 0 \ |
| 7018 | -c "Read from server: .* bytes read" |
| 7019 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7021 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7022 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7023 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7024 | 0 \ |
| 7025 | -c "Read from server: .* bytes read" |
| 7026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7028 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7029 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7030 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7031 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7032 | 0 \ |
| 7033 | -c "Read from server: .* bytes read" |
| 7034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7036 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7037 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7038 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7039 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7040 | 0 \ |
| 7041 | -c "Read from server: .* bytes read" |
| 7042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7045 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7046 | "$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] | 7047 | "$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] | 7048 | 0 \ |
| 7049 | -c "Read from server: .* bytes read" |
| 7050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7052 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7053 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7054 | "$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] | 7055 | "$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] | 7056 | 0 \ |
| 7057 | -c "Read from server: .* bytes read" |
| 7058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7060 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7061 | "$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] | 7062 | "$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] | 7063 | 0 \ |
| 7064 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7065 | |
| 7066 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7067 | # During session resumption, the client will send its ApplicationData record |
| 7068 | # within the same datagram as the Finished messages. In this situation, the |
| 7069 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7070 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7072 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7073 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7074 | "$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] | 7075 | "$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] | 7076 | 0 \ |
| 7077 | -c "Read from server: .* bytes read" |
| 7078 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7079 | # Tests for version negotiation. Some information to ease the understanding |
| 7080 | # of the version negotiation test titles below: |
| 7081 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7082 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7083 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7084 | # TLS 1.3/1.2 may be enabled or not. |
| 7085 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7086 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7087 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7088 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7089 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7090 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7091 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7092 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7093 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7094 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7095 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7096 | 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] | 7097 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7098 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7099 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7100 | -S "mbedtls_ssl_handshake returned" \ |
| 7101 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7102 | -s "Protocol is TLSv1.2" \ |
| 7103 | -c "Protocol is TLSv1.2" |
| 7104 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7106 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7109 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7110 | 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] | 7111 | "$P_SRV max_version=tls12" \ |
| 7112 | "$P_CLI max_version=tls12" \ |
| 7113 | 0 \ |
| 7114 | -S "mbedtls_ssl_handshake returned" \ |
| 7115 | -C "mbedtls_ssl_handshake returned" \ |
| 7116 | -s "Protocol is TLSv1.2" \ |
| 7117 | -c "Protocol is TLSv1.2" |
| 7118 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7119 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7120 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7121 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7122 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7123 | 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] | 7124 | "$P_SRV" \ |
| 7125 | "$P_CLI" \ |
| 7126 | 0 \ |
| 7127 | -S "mbedtls_ssl_handshake returned" \ |
| 7128 | -C "mbedtls_ssl_handshake returned" \ |
| 7129 | -s "Protocol is TLSv1.3" \ |
| 7130 | -c "Protocol is TLSv1.3" |
| 7131 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7132 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7133 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7136 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7137 | 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] | 7138 | "$P_SRV min_version=tls13" \ |
| 7139 | "$P_CLI min_version=tls13" \ |
| 7140 | 0 \ |
| 7141 | -S "mbedtls_ssl_handshake returned" \ |
| 7142 | -C "mbedtls_ssl_handshake returned" \ |
| 7143 | -s "Protocol is TLSv1.3" \ |
| 7144 | -c "Protocol is TLSv1.3" |
| 7145 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7147 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7150 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7151 | 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] | 7152 | "$P_SRV" \ |
| 7153 | "$P_CLI" \ |
| 7154 | 0 \ |
| 7155 | -S "mbedtls_ssl_handshake returned" \ |
| 7156 | -C "mbedtls_ssl_handshake returned" \ |
| 7157 | -s "Protocol is TLSv1.3" \ |
| 7158 | -c "Protocol is TLSv1.3" |
| 7159 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7161 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7164 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7165 | 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] | 7166 | "$P_SRV min_version=tls13" \ |
| 7167 | "$P_CLI" \ |
| 7168 | 0 \ |
| 7169 | -S "mbedtls_ssl_handshake returned" \ |
| 7170 | -C "mbedtls_ssl_handshake returned" \ |
| 7171 | -s "Protocol is TLSv1.3" \ |
| 7172 | -c "Protocol is TLSv1.3" |
| 7173 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7175 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7178 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7179 | 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] | 7180 | "$P_SRV max_version=tls12" \ |
| 7181 | "$P_CLI" \ |
| 7182 | 0 \ |
| 7183 | -S "mbedtls_ssl_handshake returned" \ |
| 7184 | -C "mbedtls_ssl_handshake returned" \ |
| 7185 | -s "Protocol is TLSv1.2" \ |
| 7186 | -c "Protocol is TLSv1.2" |
| 7187 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7188 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7189 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7192 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7193 | 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] | 7194 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7195 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7196 | 0 \ |
| 7197 | -S "mbedtls_ssl_handshake returned" \ |
| 7198 | -C "mbedtls_ssl_handshake returned" \ |
| 7199 | -s "Protocol is TLSv1.2" \ |
| 7200 | -c "Protocol is TLSv1.2" |
| 7201 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7202 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7203 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7206 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7207 | 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] | 7208 | "$P_SRV" \ |
| 7209 | "$P_CLI min_version=tls13" \ |
| 7210 | 0 \ |
| 7211 | -S "mbedtls_ssl_handshake returned" \ |
| 7212 | -C "mbedtls_ssl_handshake returned" \ |
| 7213 | -s "Protocol is TLSv1.3" \ |
| 7214 | -c "Protocol is TLSv1.3" |
| 7215 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7216 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7217 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7220 | 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] | 7221 | "$P_SRV min_version=tls13" \ |
| 7222 | "$P_CLI max_version=tls12" \ |
| 7223 | 1 \ |
| 7224 | -s "Handshake protocol not within min/max boundaries" \ |
| 7225 | -S "Protocol is TLSv1.2" \ |
| 7226 | -C "Protocol is TLSv1.2" \ |
| 7227 | -S "Protocol is TLSv1.3" \ |
| 7228 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7229 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7231 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7234 | 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] | 7235 | "$P_SRV max_version=tls12" \ |
| 7236 | "$P_CLI min_version=tls13" \ |
| 7237 | 1 \ |
| 7238 | -s "The handshake negotiation failed" \ |
| 7239 | -S "Protocol is TLSv1.2" \ |
| 7240 | -C "Protocol is TLSv1.2" \ |
| 7241 | -S "Protocol is TLSv1.3" \ |
| 7242 | -C "Protocol is TLSv1.3" |
| 7243 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7244 | # Tests of version negotiation on server side against GnuTLS client |
| 7245 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7246 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7248 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7249 | 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] | 7250 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7251 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7252 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7253 | -S "mbedtls_ssl_handshake returned" \ |
| 7254 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7255 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 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 | dfad493 | 2024-03-06 15:05:14 +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 "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] | 7261 | "$P_SRV max_version=tls12" \ |
| 7262 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7263 | 0 \ |
| 7264 | -S "mbedtls_ssl_handshake returned" \ |
| 7265 | -s "Protocol is TLSv1.2" |
| 7266 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7267 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7269 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7270 | 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] | 7271 | "$P_SRV" \ |
| 7272 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7273 | 0 \ |
| 7274 | -S "mbedtls_ssl_handshake returned" \ |
| 7275 | -s "Protocol is TLSv1.3" |
| 7276 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7277 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7280 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7281 | 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] | 7282 | "$P_SRV min_version=tls13" \ |
| 7283 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7284 | 0 \ |
| 7285 | -S "mbedtls_ssl_handshake returned" \ |
| 7286 | -s "Protocol is TLSv1.3" |
| 7287 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7288 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7290 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7291 | 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] | 7292 | "$P_SRV" \ |
| 7293 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7294 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7295 | -S "mbedtls_ssl_handshake returned" \ |
| 7296 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7297 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7298 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7301 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7302 | 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] | 7303 | "$P_SRV" \ |
| 7304 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7305 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7306 | -S "mbedtls_ssl_handshake returned" \ |
| 7307 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7308 | |
| 7309 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7310 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7311 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7312 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7313 | # client then detects the downgrade indication and aborts the handshake even |
| 7314 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7315 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7316 | # implementation that are otherwise not exercised. |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7317 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7320 | run_test "Server version nego G->m: cli 1.2+1.3 (1.2 preferred!), srv 1.2+1.3 -> 1.2" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7321 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7322 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7323 | 1 \ |
| 7324 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7325 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7329 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7330 | run_test "Server version nego G->m: cli 1.2+1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7331 | "$P_SRV min_version=tls13" \ |
| 7332 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7333 | 0 \ |
| 7334 | -S "mbedtls_ssl_handshake returned" \ |
| 7335 | -s "Protocol is TLSv1.3" |
| 7336 | |
| 7337 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7338 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7339 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7340 | run_test "Server version nego G->m: cli 1.2+1.3, srv 1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7341 | "$P_SRV" \ |
| 7342 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7343 | 0 \ |
| 7344 | -S "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.2" |
| 7346 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7350 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7351 | 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] | 7352 | "$P_SRV max_version=tls12" \ |
| 7353 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7354 | 0 \ |
| 7355 | -S "mbedtls_ssl_handshake returned" \ |
| 7356 | -s "Protocol is TLSv1.2" |
| 7357 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7358 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7359 | 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] | 7360 | "$P_SRV" \ |
| 7361 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7362 | 1 \ |
| 7363 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7364 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7365 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7366 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7367 | 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] | 7368 | "$P_SRV" \ |
| 7369 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7370 | 1 \ |
| 7371 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7372 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7373 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7374 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7375 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7376 | 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] | 7377 | "$P_SRV" \ |
| 7378 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7379 | 1 \ |
| 7380 | -s "Handshake protocol not within min/max boundaries" \ |
| 7381 | -S "Protocol is TLSv1.2" |
| 7382 | |
| 7383 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7384 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7385 | 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] | 7386 | "$P_SRV" \ |
| 7387 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7388 | 1 \ |
| 7389 | -S "Handshake protocol not within min/max boundaries" \ |
| 7390 | -s "The handshake negotiation failed" \ |
| 7391 | -S "Protocol is TLSv1.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 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7396 | 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] | 7397 | "$P_SRV min_version=tls13" \ |
| 7398 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7399 | 1 \ |
| 7400 | -s "Handshake protocol not within min/max boundaries" \ |
| 7401 | -S "Protocol is TLSv1.2" |
| 7402 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7403 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7406 | 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] | 7407 | "$P_SRV max_version=tls12" \ |
| 7408 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7409 | 1 \ |
| 7410 | -S "Handshake protocol not within min/max boundaries" \ |
| 7411 | -s "The handshake negotiation failed" \ |
| 7412 | -S "Protocol is TLSv1.3" |
| 7413 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7414 | # Tests of version negotiation on server side against OpenSSL client |
| 7415 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7418 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7419 | 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] | 7420 | "$P_SRV" \ |
| 7421 | "$O_NEXT_CLI -tls1_2" \ |
| 7422 | 0 \ |
| 7423 | -S "mbedtls_ssl_handshake returned" \ |
| 7424 | -s "Protocol is TLSv1.2" |
| 7425 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7426 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7429 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7430 | 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] | 7431 | "$P_SRV max_version=tls12" \ |
| 7432 | "$O_NEXT_CLI -tls1_2" \ |
| 7433 | 0 \ |
| 7434 | -S "mbedtls_ssl_handshake returned" \ |
| 7435 | -s "Protocol is TLSv1.2" |
| 7436 | |
| 7437 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7440 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7441 | 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] | 7442 | "$P_SRV" \ |
| 7443 | "$O_NEXT_CLI -tls1_3" \ |
| 7444 | 0 \ |
| 7445 | -S "mbedtls_ssl_handshake returned" \ |
| 7446 | -s "Protocol is TLSv1.3" |
| 7447 | |
| 7448 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7453 | run_test "Server version nego O->m: cli 1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7454 | "$P_SRV min_version=tls13" \ |
| 7455 | "$O_NEXT_CLI -tls1_3" \ |
| 7456 | 0 \ |
| 7457 | -S "mbedtls_ssl_handshake returned" \ |
| 7458 | -s "Protocol is TLSv1.3" |
| 7459 | |
| 7460 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7463 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7464 | 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] | 7465 | "$P_SRV" \ |
| 7466 | "$O_NEXT_CLI" \ |
| 7467 | 0 \ |
| 7468 | -S "mbedtls_ssl_handshake returned" \ |
| 7469 | -s "Protocol is TLSv1.3" |
| 7470 | |
| 7471 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7472 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7474 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7475 | 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] | 7476 | "$P_SRV" \ |
| 7477 | "$O_NEXT_CLI -no_middlebox" \ |
| 7478 | 0 \ |
| 7479 | -S "mbedtls_ssl_handshake returned" \ |
| 7480 | -s "Protocol is TLSv1.3" |
| 7481 | |
| 7482 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7483 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7486 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7487 | 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] | 7488 | "$P_SRV min_version=tls13" \ |
| 7489 | "$O_NEXT_CLI" \ |
| 7490 | 0 \ |
| 7491 | -S "mbedtls_ssl_handshake returned" \ |
| 7492 | -s "Protocol is TLSv1.3" |
| 7493 | |
| 7494 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7495 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 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+1.3, srv 1.2 -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7498 | "$P_SRV" \ |
| 7499 | "$O_NEXT_CLI" \ |
| 7500 | 0 \ |
| 7501 | -S "mbedtls_ssl_handshake returned" \ |
| 7502 | -s "Protocol is TLSv1.2" |
| 7503 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7504 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7507 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7508 | 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] | 7509 | "$P_SRV max_version=tls12" \ |
| 7510 | "$O_NEXT_CLI" \ |
| 7511 | 0 \ |
| 7512 | -S "mbedtls_ssl_handshake returned" \ |
| 7513 | -s "Protocol is TLSv1.2" |
| 7514 | |
| 7515 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7516 | 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] | 7517 | "$P_SRV" \ |
| 7518 | "$O_CLI -tls1" \ |
| 7519 | 1 \ |
| 7520 | -s "Handshake protocol not within min/max boundaries" \ |
| 7521 | -S "Protocol is TLSv1.0" |
| 7522 | |
| 7523 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7524 | 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] | 7525 | "$P_SRV" \ |
| 7526 | "$O_CLI -tls1_1" \ |
| 7527 | 1 \ |
| 7528 | -s "Handshake protocol not within min/max boundaries" \ |
| 7529 | -S "Protocol is TLSv1.1" |
| 7530 | |
| 7531 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7532 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7533 | 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] | 7534 | "$P_SRV" \ |
| 7535 | "$O_NEXT_CLI -tls1_2" \ |
| 7536 | 1 \ |
| 7537 | -s "Handshake protocol not within min/max boundaries" \ |
| 7538 | -S "Protocol is TLSv1.2" |
| 7539 | |
| 7540 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7541 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7542 | 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] | 7543 | "$P_SRV" \ |
| 7544 | "$O_NEXT_CLI -tls1_3" \ |
| 7545 | 1 \ |
| 7546 | -S "Handshake protocol not within min/max boundaries" \ |
| 7547 | -s "The handshake negotiation failed" \ |
| 7548 | -S "Protocol is TLSv1.3" |
| 7549 | |
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 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7553 | 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] | 7554 | "$P_SRV min_version=tls13" \ |
| 7555 | "$O_NEXT_CLI -tls1_2" \ |
| 7556 | 1 \ |
| 7557 | -s "Handshake protocol not within min/max boundaries" \ |
| 7558 | -S "Protocol is TLSv1.2" |
| 7559 | |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7560 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7563 | 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] | 7564 | "$P_SRV max_version=tls12" \ |
| 7565 | "$O_NEXT_CLI -tls1_3" \ |
| 7566 | 1 \ |
| 7567 | -S "Handshake protocol not within min/max boundaries" \ |
| 7568 | -s "The handshake negotiation failed" \ |
| 7569 | -S "Protocol is TLSv1.3" |
| 7570 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7571 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7574 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7575 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7576 | "$P_CLI" \ |
| 7577 | 1 \ |
| 7578 | -s "Error in protocol version" \ |
| 7579 | -c "Handshake protocol not within min/max boundaries" \ |
| 7580 | -S "Version: TLS1.0" \ |
| 7581 | -C "Protocol is TLSv1.0" |
| 7582 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7584 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7585 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7586 | "$P_CLI" \ |
| 7587 | 1 \ |
| 7588 | -s "Error in protocol version" \ |
| 7589 | -c "Handshake protocol not within min/max boundaries" \ |
| 7590 | -S "Version: TLS1.1" \ |
| 7591 | -C "Protocol is TLSv1.1" |
| 7592 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7594 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7595 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7596 | skip_handshake_stage_check |
| 7597 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7598 | 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] | 7599 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7600 | "$P_CLI debug_level=4" \ |
| 7601 | 1 \ |
| 7602 | -s "Client's version: 3.3" \ |
| 7603 | -S "Version: TLS1.0" \ |
| 7604 | -C "Protocol is TLSv1.0" |
| 7605 | |
| 7606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7607 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7608 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7609 | skip_handshake_stage_check |
| 7610 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7611 | 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] | 7612 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7613 | "$P_CLI debug_level=4" \ |
| 7614 | 1 \ |
| 7615 | -s "Client's version: 3.3" \ |
| 7616 | -S "Version: TLS1.1" \ |
| 7617 | -C "Protocol is TLSv1.1" |
| 7618 | |
| 7619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7620 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7621 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7622 | skip_handshake_stage_check |
| 7623 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7624 | 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] | 7625 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7626 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7627 | 1 \ |
| 7628 | -s "Client's version: 3.3" \ |
| 7629 | -c "is a fatal alert message (msg 40)" \ |
| 7630 | -S "Version: TLS1.2" \ |
| 7631 | -C "Protocol is TLSv1.2" |
| 7632 | |
| 7633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7634 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7635 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7636 | skip_handshake_stage_check |
| 7637 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7638 | 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] | 7639 | "$O_NEXT_SRV -msg -tls1" \ |
| 7640 | "$P_CLI debug_level=4" \ |
| 7641 | 1 \ |
| 7642 | -s "fatal protocol_version" \ |
| 7643 | -c "is a fatal alert message (msg 70)" \ |
| 7644 | -S "Version: TLS1.0" \ |
| 7645 | -C "Protocol : TLSv1.0" |
| 7646 | |
| 7647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7648 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7649 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7650 | skip_handshake_stage_check |
| 7651 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7652 | 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] | 7653 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7654 | "$P_CLI debug_level=4" \ |
| 7655 | 1 \ |
| 7656 | -s "fatal protocol_version" \ |
| 7657 | -c "is a fatal alert message (msg 70)" \ |
| 7658 | -S "Version: TLS1.1" \ |
| 7659 | -C "Protocol : TLSv1.1" |
| 7660 | |
| 7661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7662 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7663 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7664 | skip_handshake_stage_check |
| 7665 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7666 | 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] | 7667 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7668 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7669 | 1 \ |
| 7670 | -s "fatal protocol_version" \ |
| 7671 | -c "is a fatal alert message (msg 70)" \ |
| 7672 | -S "Version: TLS1.2" \ |
| 7673 | -C "Protocol : TLSv1.2" |
| 7674 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7675 | # Tests for ALPN extension |
| 7676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7677 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7678 | "$P_SRV debug_level=3" \ |
| 7679 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7680 | 0 \ |
| 7681 | -C "client hello, adding alpn extension" \ |
| 7682 | -S "found alpn extension" \ |
| 7683 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7684 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7685 | -C "found alpn extension " \ |
| 7686 | -C "Application Layer Protocol is" \ |
| 7687 | -S "Application Layer Protocol is" |
| 7688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7689 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7690 | "$P_SRV debug_level=3" \ |
| 7691 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7692 | 0 \ |
| 7693 | -c "client hello, adding alpn extension" \ |
| 7694 | -s "found alpn extension" \ |
| 7695 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7696 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7697 | -C "found alpn extension " \ |
| 7698 | -c "Application Layer Protocol is (none)" \ |
| 7699 | -S "Application Layer Protocol is" |
| 7700 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7701 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7702 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7703 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7704 | 0 \ |
| 7705 | -C "client hello, adding alpn extension" \ |
| 7706 | -S "found alpn extension" \ |
| 7707 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7708 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7709 | -C "found alpn extension " \ |
| 7710 | -C "Application Layer Protocol is" \ |
| 7711 | -s "Application Layer Protocol is (none)" |
| 7712 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7713 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7714 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7715 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7716 | 0 \ |
| 7717 | -c "client hello, adding alpn extension" \ |
| 7718 | -s "found alpn extension" \ |
| 7719 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7720 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7721 | -c "found alpn extension" \ |
| 7722 | -c "Application Layer Protocol is abc" \ |
| 7723 | -s "Application Layer Protocol is abc" |
| 7724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7725 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7726 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7727 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7728 | 0 \ |
| 7729 | -c "client hello, adding alpn extension" \ |
| 7730 | -s "found alpn extension" \ |
| 7731 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7732 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7733 | -c "found alpn extension" \ |
| 7734 | -c "Application Layer Protocol is abc" \ |
| 7735 | -s "Application Layer Protocol is abc" |
| 7736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7737 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7738 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7739 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7740 | 0 \ |
| 7741 | -c "client hello, adding alpn extension" \ |
| 7742 | -s "found alpn extension" \ |
| 7743 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7744 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7745 | -c "found alpn extension" \ |
| 7746 | -c "Application Layer Protocol is 1234" \ |
| 7747 | -s "Application Layer Protocol is 1234" |
| 7748 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7749 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7750 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7751 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7752 | 1 \ |
| 7753 | -c "client hello, adding alpn extension" \ |
| 7754 | -s "found alpn extension" \ |
| 7755 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7756 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7757 | -C "found alpn extension" \ |
| 7758 | -C "Application Layer Protocol is 1234" \ |
| 7759 | -S "Application Layer Protocol is 1234" |
| 7760 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7761 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7762 | # Tests for keyUsage in leaf certificates, part 1: |
| 7763 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7764 | # |
| 7765 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7766 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7767 | # 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] | 7768 | |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 7769 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> ECDHE-RSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7770 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7771 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7772 | "$P_CLI" \ |
| 7773 | 0 \ |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 7774 | -c "Ciphersuite is TLS-ECDHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7775 | |
Gabor Mezei | 3ead04a | 2025-02-27 14:30:35 +0100 | [diff] [blame] | 7776 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7777 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7778 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7779 | "$P_CLI" \ |
Gabor Mezei | 3ead04a | 2025-02-27 14:30:35 +0100 | [diff] [blame] | 7780 | 1 \ |
| 7781 | -C "Ciphersuite is " |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7782 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7783 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7784 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7785 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7786 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7787 | 1 \ |
| 7788 | -C "Ciphersuite is " |
| 7789 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7790 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7791 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7792 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7793 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7794 | "$P_CLI" \ |
| 7795 | 0 \ |
| 7796 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7797 | |
| 7798 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7799 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7800 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7801 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7802 | "$P_CLI" \ |
| 7803 | 0 \ |
| 7804 | -c "Ciphersuite is TLS-ECDH-" |
| 7805 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7806 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7807 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7808 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7809 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7810 | 1 \ |
| 7811 | -C "Ciphersuite is " |
| 7812 | |
| 7813 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7814 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7815 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7816 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, ECDHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7817 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7818 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7819 | "$P_CLI debug_level=1 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7820 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7821 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7822 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7823 | -C "Processing of the Certificate handshake message failed" \ |
| 7824 | -c "Ciphersuite is TLS-" |
| 7825 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7826 | run_test "keyUsage cli 1.2: KeyEncipherment, ECDHE-RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7827 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7828 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7829 | "$P_CLI debug_level=3 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7830 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7831 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7832 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7833 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7834 | -C "Ciphersuite is TLS-" \ |
| 7835 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7836 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7837 | # 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] | 7838 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7839 | run_test "keyUsage cli 1.2: KeyEncipherment, ECDHE-RSA: fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7840 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7841 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7842 | "$P_CLI debug_level=3 auth_mode=optional \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7843 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7844 | 0 \ |
| 7845 | -c "bad certificate (usage extensions)" \ |
| 7846 | -C "Processing of the Certificate handshake message failed" \ |
| 7847 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | 8e70c2b | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7848 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7849 | -c "! Usage does not match the keyUsage extension" |
| 7850 | |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7851 | run_test "keyUsage cli 1.2: DigitalSignature, ECDHE-RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7852 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7853 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7854 | "$P_CLI debug_level=1 \ |
Valerio Setti | 309a7ec | 2025-01-20 13:07:39 +0100 | [diff] [blame] | 7855 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7856 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7857 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7858 | -C "Processing of the Certificate handshake message failed" \ |
| 7859 | -c "Ciphersuite is TLS-" |
| 7860 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7861 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7862 | 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] | 7863 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7864 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7865 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7866 | "$P_CLI debug_level=3" \ |
| 7867 | 0 \ |
| 7868 | -C "bad certificate (usage extensions)" \ |
| 7869 | -C "Processing of the Certificate handshake message failed" \ |
| 7870 | -c "Ciphersuite is" |
| 7871 | |
| 7872 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7873 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7874 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7875 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7876 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7877 | "$P_CLI debug_level=3" \ |
| 7878 | 0 \ |
| 7879 | -C "bad certificate (usage extensions)" \ |
| 7880 | -C "Processing of the Certificate handshake message failed" \ |
| 7881 | -c "Ciphersuite is" |
| 7882 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7883 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7884 | 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] | 7885 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7886 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7887 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7888 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7889 | 1 \ |
| 7890 | -c "bad certificate (usage extensions)" \ |
| 7891 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7892 | -C "Ciphersuite is" \ |
| 7893 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7894 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7895 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7896 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7897 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7898 | 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] | 7899 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7900 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7901 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7902 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7903 | 1 \ |
| 7904 | -c "bad certificate (usage extensions)" \ |
| 7905 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7906 | -C "Ciphersuite is" \ |
| 7907 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7908 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7909 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7910 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7911 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7912 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7913 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7914 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7915 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7916 | "$P_CLI debug_level=3" \ |
| 7917 | 0 \ |
| 7918 | -C "bad certificate (usage extensions)" \ |
| 7919 | -C "Processing of the Certificate handshake message failed" \ |
| 7920 | -c "Ciphersuite is" |
| 7921 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7922 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7923 | 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] | 7924 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7925 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7926 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7927 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7928 | 1 \ |
| 7929 | -c "bad certificate (usage extensions)" \ |
| 7930 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7931 | -C "Ciphersuite is" \ |
| 7932 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7933 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7934 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7935 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7936 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7937 | 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] | 7938 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7939 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7940 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7941 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7942 | 1 \ |
| 7943 | -c "bad certificate (usage extensions)" \ |
| 7944 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7945 | -C "Ciphersuite is" \ |
| 7946 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7947 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7948 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7949 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7950 | # Tests for keyUsage in leaf certificates, part 3: |
| 7951 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7952 | # |
| 7953 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7954 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7956 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7957 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7958 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7959 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7960 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7961 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7962 | -S "bad certificate (usage extensions)" \ |
| 7963 | -S "Processing of the Certificate handshake message failed" |
| 7964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7966 | 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] | 7967 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7968 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 19d6d34 | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7969 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 7970 | 0 \ |
| 7971 | -s "Verifying peer X.509 certificate... ok" \ |
| 7972 | -S "bad certificate (usage extensions)" \ |
| 7973 | -S "Processing of the Certificate handshake message failed" |
| 7974 | |
| 7975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7976 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 7977 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7978 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7979 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7980 | 0 \ |
| 7981 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7982 | -S "send alert level=2 message=43" \ |
| 7983 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7984 | -S "Processing of the Certificate handshake message failed" |
| 7985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7987 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 7988 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7989 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7990 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7991 | 1 \ |
| 7992 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7993 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7994 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7995 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7996 | # 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] | 7997 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7999 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8000 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8001 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8002 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8003 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8004 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8005 | -S "bad certificate (usage extensions)" \ |
| 8006 | -S "Processing of the Certificate handshake message failed" |
| 8007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8009 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8010 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8011 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8012 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8013 | 0 \ |
| 8014 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8015 | -S "send alert level=2 message=43" \ |
| 8016 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8017 | -S "Processing of the Certificate handshake message failed" |
| 8018 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8020 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8021 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8022 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8023 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8024 | 1 \ |
| 8025 | -s "bad certificate (usage extensions)" \ |
| 8026 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8027 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8028 | -s "Processing of the Certificate handshake message failed" |
| 8029 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8030 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8031 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8032 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8033 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8034 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8035 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8036 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8037 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8038 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8039 | -S "bad certificate (usage extensions)" \ |
| 8040 | -S "Processing of the Certificate handshake message failed" |
| 8041 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8042 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8043 | 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] | 8044 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8045 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8046 | "$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] | 8047 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8048 | 0 \ |
| 8049 | -s "Verifying peer X.509 certificate... ok" \ |
| 8050 | -S "bad certificate (usage extensions)" \ |
| 8051 | -S "Processing of the Certificate handshake message failed" |
| 8052 | |
| 8053 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8054 | 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] | 8055 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8056 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8057 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8058 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8059 | 0 \ |
| 8060 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8061 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8062 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8063 | -S "Processing of the Certificate handshake message failed" |
| 8064 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8065 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8067 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8068 | "$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] | 8069 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8070 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8071 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8072 | -s "bad certificate (usage extensions)" \ |
| 8073 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8074 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8075 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8076 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8077 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8078 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8079 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8080 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8081 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8082 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8083 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8084 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8085 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8086 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8087 | -S "bad certificate (usage extensions)" \ |
| 8088 | -S "Processing of the Certificate handshake message failed" |
| 8089 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8090 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8091 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8092 | 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] | 8093 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8094 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8095 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8096 | 0 \ |
| 8097 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8098 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8099 | -S "Processing of the Certificate handshake message failed" |
| 8100 | |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8101 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8102 | 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] | 8103 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8104 | "$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] | 8105 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8106 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8107 | 1 \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8108 | -s "bad certificate (usage extensions)" \ |
| 8109 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 4956e32 | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8110 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 92a391e | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8111 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8112 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 5a4c8f0 | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8113 | # 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] | 8114 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8115 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8117 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8118 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8119 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8120 | "$P_CLI" \ |
| 8121 | 0 |
| 8122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8123 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8124 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8125 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8126 | "$P_CLI" \ |
| 8127 | 0 |
| 8128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8129 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8130 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8131 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8132 | "$P_CLI" \ |
| 8133 | 0 |
| 8134 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8135 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8136 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8137 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8138 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8139 | 1 |
| 8140 | |
| 8141 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8144 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8145 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8146 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8147 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8148 | 0 \ |
| 8149 | -C "bad certificate (usage extensions)" \ |
| 8150 | -C "Processing of the Certificate handshake message failed" \ |
| 8151 | -c "Ciphersuite is TLS-" |
| 8152 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8154 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8155 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8156 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8157 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8158 | 0 \ |
| 8159 | -C "bad certificate (usage extensions)" \ |
| 8160 | -C "Processing of the Certificate handshake message failed" \ |
| 8161 | -c "Ciphersuite is TLS-" |
| 8162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8164 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8165 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8166 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8167 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8168 | 0 \ |
| 8169 | -C "bad certificate (usage extensions)" \ |
| 8170 | -C "Processing of the Certificate handshake message failed" \ |
| 8171 | -c "Ciphersuite is TLS-" |
| 8172 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8174 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8175 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8176 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8177 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8178 | 0 \ |
| 8179 | -c "bad certificate (usage extensions)" \ |
| 8180 | -C "Processing of the Certificate handshake message failed" \ |
| 8181 | -c "Ciphersuite is TLS-" \ |
| 8182 | -C "send alert level=2 message=43" \ |
| 8183 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8184 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8185 | |
| 8186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8187 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | dcf18dd | 2024-06-11 17:44:00 +0100 | [diff] [blame] | 8188 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8189 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8190 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8191 | 1 \ |
| 8192 | -c "bad certificate (usage extensions)" \ |
| 8193 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8194 | -C "Ciphersuite is TLS-" \ |
| 8195 | -c "send alert level=2 message=43" \ |
| 8196 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8197 | # 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] | 8198 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8199 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8200 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8201 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8202 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8203 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8204 | "$P_CLI debug_level=1" \ |
| 8205 | 0 \ |
| 8206 | -C "bad certificate (usage extensions)" \ |
| 8207 | -C "Processing of the Certificate handshake message failed" \ |
| 8208 | -c "Ciphersuite is" |
| 8209 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8210 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8211 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8212 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8213 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8214 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8215 | "$P_CLI debug_level=1" \ |
| 8216 | 0 \ |
| 8217 | -C "bad certificate (usage extensions)" \ |
| 8218 | -C "Processing of the Certificate handshake message failed" \ |
| 8219 | -c "Ciphersuite is" |
| 8220 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8221 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8222 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8223 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8224 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8225 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8226 | "$P_CLI debug_level=1" \ |
| 8227 | 0 \ |
| 8228 | -C "bad certificate (usage extensions)" \ |
| 8229 | -C "Processing of the Certificate handshake message failed" \ |
| 8230 | -c "Ciphersuite is" |
| 8231 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8232 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8233 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8234 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8235 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8236 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8237 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8238 | 1 \ |
| 8239 | -c "bad certificate (usage extensions)" \ |
| 8240 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8241 | -C "Ciphersuite is" \ |
| 8242 | -c "send alert level=2 message=43" \ |
| 8243 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8244 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8245 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8246 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8249 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8250 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8251 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8252 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8253 | 0 \ |
| 8254 | -S "bad certificate (usage extensions)" \ |
| 8255 | -S "Processing of the Certificate handshake message failed" |
| 8256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8258 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8259 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8260 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8261 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8262 | 0 \ |
| 8263 | -S "bad certificate (usage extensions)" \ |
| 8264 | -S "Processing of the Certificate handshake message failed" |
| 8265 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8267 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8268 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8269 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8270 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8271 | 0 \ |
| 8272 | -S "bad certificate (usage extensions)" \ |
| 8273 | -S "Processing of the Certificate handshake message failed" |
| 8274 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8276 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8277 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8278 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8279 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8280 | 0 \ |
| 8281 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8282 | -S "send alert level=2 message=43" \ |
| 8283 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8284 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8285 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8287 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8288 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8289 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8290 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8291 | 1 \ |
| 8292 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8293 | -s "send alert level=2 message=43" \ |
| 8294 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8295 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8296 | # 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] | 8297 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8298 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8299 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8300 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8301 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8302 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8303 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8304 | 0 \ |
| 8305 | -S "bad certificate (usage extensions)" \ |
| 8306 | -S "Processing of the Certificate handshake message failed" |
| 8307 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8308 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8309 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8310 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8311 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8312 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8313 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8314 | 0 \ |
| 8315 | -S "bad certificate (usage extensions)" \ |
| 8316 | -S "Processing of the Certificate handshake message failed" |
| 8317 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8318 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8319 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8320 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8321 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8322 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8323 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8324 | 0 \ |
| 8325 | -S "bad certificate (usage extensions)" \ |
| 8326 | -S "Processing of the Certificate handshake message failed" |
| 8327 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8328 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8329 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8330 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8331 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8332 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8333 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8334 | 0 \ |
| 8335 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | 6a04b16 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8336 | -S "send alert level=2 message=43" \ |
| 8337 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8338 | -S "Processing of the Certificate handshake message failed" |
| 8339 | |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8340 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8341 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | f48bfb0 | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8342 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8343 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8344 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8345 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8346 | 1 \ |
| 8347 | -s "bad certificate (usage extensions)" \ |
| 8348 | -s "send alert level=2 message=43" \ |
| 8349 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8350 | -s "Processing of the Certificate handshake message failed" |
| 8351 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8352 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8353 | # Tests for PSK callback |
| 8354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8355 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8356 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8357 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8358 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8359 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8360 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8361 | -S "SSL - Unknown identity received" \ |
| 8362 | -S "SSL - Verification of the message MAC failed" |
| 8363 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8364 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8365 | "$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] | 8366 | "$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] | 8367 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8368 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8369 | -C "session hash for extended master secret"\ |
| 8370 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8371 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8372 | -S "SSL - Unknown identity received" \ |
| 8373 | -S "SSL - Verification of the message MAC failed" |
| 8374 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8375 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8376 | "$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] | 8377 | "$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] | 8378 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8379 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8380 | -C "session hash for extended master secret"\ |
| 8381 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8382 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8383 | -S "SSL - Unknown identity received" \ |
| 8384 | -S "SSL - Verification of the message MAC failed" |
| 8385 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8386 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8387 | "$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] | 8388 | "$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] | 8389 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8390 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8391 | -c "session hash for extended master secret"\ |
| 8392 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8393 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8394 | -S "SSL - Unknown identity received" \ |
| 8395 | -S "SSL - Verification of the message MAC failed" |
| 8396 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8397 | 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] | 8398 | "$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] | 8399 | "$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] | 8400 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8401 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8402 | -c "session hash for extended master secret"\ |
| 8403 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8404 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8405 | -S "SSL - Unknown identity received" \ |
| 8406 | -S "SSL - Verification of the message MAC failed" |
| 8407 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8408 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8409 | "$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] | 8410 | "$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] | 8411 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8412 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8413 | -C "session hash for extended master secret"\ |
| 8414 | -S "session hash for extended master secret"\ |
| 8415 | -S "SSL - The handshake negotiation failed" \ |
| 8416 | -S "SSL - Unknown identity received" \ |
| 8417 | -S "SSL - Verification of the message MAC failed" |
| 8418 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8419 | 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] | 8420 | "$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] | 8421 | "$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] | 8422 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8423 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8424 | -C "session hash for extended master secret"\ |
| 8425 | -S "session hash for extended master secret"\ |
| 8426 | -S "SSL - The handshake negotiation failed" \ |
| 8427 | -S "SSL - Unknown identity received" \ |
| 8428 | -S "SSL - Verification of the message MAC failed" |
| 8429 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8430 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8431 | "$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] | 8432 | "$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] | 8433 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8434 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8435 | -c "session hash for extended master secret"\ |
| 8436 | -s "session hash for extended master secret"\ |
| 8437 | -S "SSL - The handshake negotiation failed" \ |
| 8438 | -S "SSL - Unknown identity received" \ |
| 8439 | -S "SSL - Verification of the message MAC failed" |
| 8440 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8441 | 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] | 8442 | "$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] | 8443 | "$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] | 8444 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8445 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8446 | -c "session hash for extended master secret"\ |
| 8447 | -s "session hash for extended master secret"\ |
| 8448 | -S "SSL - The handshake negotiation failed" \ |
| 8449 | -S "SSL - Unknown identity received" \ |
| 8450 | -S "SSL - Verification of the message MAC failed" |
| 8451 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8452 | 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] | 8453 | "$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] | 8454 | "$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] | 8455 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8456 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8457 | -C "session hash for extended master secret"\ |
| 8458 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8459 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8460 | -S "SSL - Unknown identity received" \ |
| 8461 | -S "SSL - Verification of the message MAC failed" |
| 8462 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8463 | 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] | 8464 | "$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] | 8465 | "$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] | 8466 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8467 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8468 | -C "session hash for extended master secret"\ |
| 8469 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8470 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8471 | -S "SSL - Unknown identity received" \ |
| 8472 | -S "SSL - Verification of the message MAC failed" |
| 8473 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8474 | 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] | 8475 | "$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] | 8476 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8477 | "$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] | 8478 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8479 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8480 | -c "session hash for extended master secret"\ |
| 8481 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8482 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8483 | -S "SSL - Unknown identity received" \ |
| 8484 | -S "SSL - Verification of the message MAC failed" |
| 8485 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8486 | 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] | 8487 | "$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] | 8488 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8489 | "$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] | 8490 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8491 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8492 | -c "session hash for extended master secret"\ |
| 8493 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8494 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8495 | -S "SSL - Unknown identity received" \ |
| 8496 | -S "SSL - Verification of the message MAC failed" |
| 8497 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8498 | 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] | 8499 | "$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] | 8500 | "$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] | 8501 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8502 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8503 | -C "session hash for extended master secret"\ |
| 8504 | -S "session hash for extended master secret"\ |
| 8505 | -S "SSL - The handshake negotiation failed" \ |
| 8506 | -S "SSL - Unknown identity received" \ |
| 8507 | -S "SSL - Verification of the message MAC failed" |
| 8508 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8509 | 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] | 8510 | "$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] | 8511 | "$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] | 8512 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8513 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8514 | -C "session hash for extended master secret"\ |
| 8515 | -S "session hash for extended master secret"\ |
| 8516 | -S "SSL - The handshake negotiation failed" \ |
| 8517 | -S "SSL - Unknown identity received" \ |
| 8518 | -S "SSL - Verification of the message MAC failed" |
| 8519 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8520 | 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] | 8521 | "$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] | 8522 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8523 | "$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] | 8524 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8525 | 0 \ |
| 8526 | -c "session hash for extended master secret"\ |
| 8527 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8528 | -S "SSL - The handshake negotiation failed" \ |
| 8529 | -S "SSL - Unknown identity received" \ |
| 8530 | -S "SSL - Verification of the message MAC failed" |
| 8531 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8532 | 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] | 8533 | "$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] | 8534 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8535 | "$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] | 8536 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8537 | 0 \ |
| 8538 | -c "session hash for extended master secret"\ |
| 8539 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8540 | -S "SSL - The handshake negotiation failed" \ |
| 8541 | -S "SSL - Unknown identity received" \ |
| 8542 | -S "SSL - Verification of the message MAC failed" |
| 8543 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8544 | 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] | 8545 | "$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" \ |
| 8546 | "$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] | 8547 | psk_identity=def psk=beef" \ |
| 8548 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8549 | -C "session hash for extended master secret"\ |
| 8550 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8551 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8552 | -S "SSL - Unknown identity received" \ |
| 8553 | -S "SSL - Verification of the message MAC failed" |
| 8554 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8555 | 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] | 8556 | "$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" \ |
| 8557 | "$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] | 8558 | psk_identity=def psk=beef" \ |
| 8559 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8560 | -C "session hash for extended master secret"\ |
| 8561 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8562 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8563 | -S "SSL - Unknown identity received" \ |
| 8564 | -S "SSL - Verification of the message MAC failed" |
| 8565 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8566 | 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] | 8567 | "$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] | 8568 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8569 | "$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] | 8570 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8571 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8572 | -c "session hash for extended master secret"\ |
| 8573 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8574 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8575 | -S "SSL - Unknown identity received" \ |
| 8576 | -S "SSL - Verification of the message MAC failed" |
| 8577 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8578 | 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] | 8579 | "$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] | 8580 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8581 | "$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] | 8582 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8583 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8584 | -c "session hash for extended master secret"\ |
| 8585 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8586 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8587 | -S "SSL - Unknown identity received" \ |
| 8588 | -S "SSL - Verification of the message MAC failed" |
| 8589 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8590 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 8591 | "$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" \ |
| 8592 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8593 | psk_identity=def psk=beef" \ |
| 8594 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8595 | -C "session hash for extended master secret"\ |
| 8596 | -S "session hash for extended master secret"\ |
| 8597 | -S "SSL - The handshake negotiation failed" \ |
| 8598 | -S "SSL - Unknown identity received" \ |
| 8599 | -S "SSL - Verification of the message MAC failed" |
| 8600 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8601 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 8602 | "$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" \ |
| 8603 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8604 | psk_identity=def psk=beef" \ |
| 8605 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8606 | -C "session hash for extended master secret"\ |
| 8607 | -S "session hash for extended master secret"\ |
| 8608 | -S "SSL - The handshake negotiation failed" \ |
| 8609 | -S "SSL - Unknown identity received" \ |
| 8610 | -S "SSL - Verification of the message MAC failed" |
| 8611 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8612 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 8613 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8614 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8615 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8616 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8617 | 0 \ |
| 8618 | -c "session hash for extended master secret"\ |
| 8619 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8620 | -S "SSL - The handshake negotiation failed" \ |
| 8621 | -S "SSL - Unknown identity received" \ |
| 8622 | -S "SSL - Verification of the message MAC failed" |
| 8623 | |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8624 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 8625 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8626 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8627 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8628 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8629 | 0 \ |
| 8630 | -c "session hash for extended master secret"\ |
| 8631 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8632 | -S "SSL - The handshake negotiation failed" \ |
| 8633 | -S "SSL - Unknown identity received" \ |
| 8634 | -S "SSL - Verification of the message MAC failed" |
| 8635 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8636 | 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] | 8637 | "$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] | 8638 | "$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] | 8639 | psk_identity=def psk=beef" \ |
| 8640 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8641 | -C "session hash for extended master secret"\ |
| 8642 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8643 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8644 | -S "SSL - Unknown identity received" \ |
| 8645 | -S "SSL - Verification of the message MAC failed" |
| 8646 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8647 | 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] | 8648 | "$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] | 8649 | "$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] | 8650 | psk_identity=def psk=beef" \ |
| 8651 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8652 | -C "session hash for extended master secret"\ |
| 8653 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8654 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8655 | -S "SSL - Unknown identity received" \ |
| 8656 | -S "SSL - Verification of the message MAC failed" |
| 8657 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8658 | 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] | 8659 | "$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] | 8660 | "$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] | 8661 | psk_identity=def psk=beef" \ |
| 8662 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8663 | -C "session hash for extended master secret"\ |
| 8664 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8665 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8666 | -S "SSL - Unknown identity received" \ |
| 8667 | -S "SSL - Verification of the message MAC failed" |
| 8668 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8669 | 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] | 8670 | "$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] | 8671 | "$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] | 8672 | psk_identity=def psk=beef" \ |
| 8673 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8674 | -C "session hash for extended master secret"\ |
| 8675 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8676 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8677 | -S "SSL - Unknown identity received" \ |
| 8678 | -S "SSL - Verification of the message MAC failed" |
| 8679 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8680 | 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] | 8681 | "$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] | 8682 | "$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] | 8683 | psk_identity=def psk=beef" \ |
| 8684 | 1 \ |
| 8685 | -s "SSL - Verification of the message MAC failed" |
| 8686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8687 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8688 | "$P_SRV" \ |
| 8689 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8690 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8691 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 8692 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8693 | -S "SSL - Unknown identity received" \ |
| 8694 | -S "SSL - Verification of the message MAC failed" |
| 8695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8696 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8697 | "$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] | 8698 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8699 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8700 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8701 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8702 | -s "SSL - Unknown identity received" \ |
| 8703 | -S "SSL - Verification of the message MAC failed" |
| 8704 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8705 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8706 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8707 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8708 | psk_identity=abc psk=dead" \ |
| 8709 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8710 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8711 | -S "SSL - Unknown identity received" \ |
| 8712 | -S "SSL - Verification of the message MAC failed" |
| 8713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8714 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8715 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8716 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8717 | psk_identity=def psk=beef" \ |
| 8718 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8719 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8720 | -S "SSL - Unknown identity received" \ |
| 8721 | -S "SSL - Verification of the message MAC failed" |
| 8722 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8723 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8724 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8725 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8726 | psk_identity=ghi psk=beef" \ |
| 8727 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8728 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8729 | -s "SSL - Unknown identity received" \ |
| 8730 | -S "SSL - Verification of the message MAC failed" |
| 8731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8732 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8733 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 8734 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 8735 | psk_identity=abc psk=beef" \ |
| 8736 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8737 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8738 | -S "SSL - Unknown identity received" \ |
| 8739 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8740 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8741 | # Tests for EC J-PAKE |
| 8742 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8743 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8745 | run_test "ECJPAKE: client not configured" \ |
| 8746 | "$P_SRV debug_level=3" \ |
| 8747 | "$P_CLI debug_level=3" \ |
| 8748 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8749 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8750 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8751 | -S "found ecjpake kkpp extension" \ |
| 8752 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8753 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8754 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8755 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8756 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8757 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8758 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8759 | run_test "ECJPAKE: server not configured" \ |
| 8760 | "$P_SRV debug_level=3" \ |
| 8761 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8762 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8763 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8764 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8765 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8766 | -s "found ecjpake kkpp extension" \ |
| 8767 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8768 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8769 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8770 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8771 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8772 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8773 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8774 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8775 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8776 | run_test "ECJPAKE: working, TLS" \ |
| 8777 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8778 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8779 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8780 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8781 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8782 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8783 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8784 | -s "found ecjpake kkpp extension" \ |
| 8785 | -S "skip ecjpake kkpp extension" \ |
| 8786 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8787 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8788 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8789 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8790 | -S "SSL - Verification of the message MAC failed" |
| 8791 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8792 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8793 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8794 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8795 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8796 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8797 | 0 \ |
| 8798 | -c "add ciphersuite: c0ff" \ |
| 8799 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8800 | -c "using opaque password" \ |
| 8801 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8802 | -C "re-using cached ecjpake parameters" \ |
| 8803 | -s "found ecjpake kkpp extension" \ |
| 8804 | -S "skip ecjpake kkpp extension" \ |
| 8805 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8806 | -s "server hello, ecjpake kkpp extension" \ |
| 8807 | -c "found ecjpake_kkpp extension" \ |
| 8808 | -S "SSL - The handshake negotiation failed" \ |
| 8809 | -S "SSL - Verification of the message MAC failed" |
| 8810 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8811 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8812 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8814 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8815 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8816 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8817 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8818 | 0 \ |
| 8819 | -c "add ciphersuite: c0ff" \ |
| 8820 | -c "adding ecjpake_kkpp extension" \ |
| 8821 | -c "using opaque password" \ |
| 8822 | -S "using opaque password" \ |
| 8823 | -C "re-using cached ecjpake parameters" \ |
| 8824 | -s "found ecjpake kkpp extension" \ |
| 8825 | -S "skip ecjpake kkpp extension" \ |
| 8826 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8827 | -s "server hello, ecjpake kkpp extension" \ |
| 8828 | -c "found ecjpake_kkpp extension" \ |
| 8829 | -S "SSL - The handshake negotiation failed" \ |
| 8830 | -S "SSL - Verification of the message MAC failed" |
| 8831 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8832 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8833 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8834 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8835 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8836 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8837 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 8838 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8839 | 0 \ |
| 8840 | -c "add ciphersuite: c0ff" \ |
| 8841 | -c "adding ecjpake_kkpp extension" \ |
| 8842 | -C "using opaque password" \ |
| 8843 | -s "using opaque password" \ |
| 8844 | -C "re-using cached ecjpake parameters" \ |
| 8845 | -s "found ecjpake kkpp extension" \ |
| 8846 | -S "skip ecjpake kkpp extension" \ |
| 8847 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8848 | -s "server hello, ecjpake kkpp extension" \ |
| 8849 | -c "found ecjpake_kkpp extension" \ |
| 8850 | -S "SSL - The handshake negotiation failed" \ |
| 8851 | -S "SSL - Verification of the message MAC failed" |
| 8852 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8853 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8854 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8855 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8856 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8857 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8858 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8859 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8860 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8861 | -s "SSL - Verification of the message MAC failed" |
| 8862 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8863 | server_needs_more_time 1 |
| 8864 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8865 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 8866 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8867 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 8868 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8869 | 1 \ |
| 8870 | -c "using opaque password" \ |
| 8871 | -s "using opaque password" \ |
| 8872 | -C "re-using cached ecjpake parameters" \ |
| 8873 | -s "SSL - Verification of the message MAC failed" |
| 8874 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8875 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8876 | run_test "ECJPAKE: working, DTLS" \ |
| 8877 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8878 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8879 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8880 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8881 | -c "re-using cached ecjpake parameters" \ |
| 8882 | -S "SSL - Verification of the message MAC failed" |
| 8883 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8884 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8885 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8886 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8887 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8888 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8889 | 0 \ |
| 8890 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8891 | -S "SSL - Verification of the message MAC failed" |
| 8892 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8893 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8895 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8896 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8897 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8898 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8899 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8900 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8901 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8902 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8903 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8904 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8905 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8906 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8907 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8908 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8909 | 0 |
| 8910 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8911 | # Test for ClientHello without extensions |
| 8912 | |
Gilles Peskine | fc73aa0 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 8913 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 8914 | requires_gnutls |
| 8915 | run_test "ClientHello without extensions: PSK" \ |
| 8916 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
Valerio Setti | 98f348a | 2025-01-30 12:10:28 +0100 | [diff] [blame] | 8917 | "$G_CLI --priority=NORMAL:+PSK:-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
Gilles Peskine | 3b81ea1 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 8918 | 0 \ |
| 8919 | -s "Ciphersuite is .*-PSK-.*" \ |
| 8920 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8921 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8922 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8923 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8924 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8925 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8927 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8928 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8929 | "$P_CLI request_size=100" \ |
| 8930 | 0 \ |
| 8931 | -s "Read from client: 100 bytes read$" |
| 8932 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8934 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8935 | "$P_SRV buffer_size=100" \ |
| 8936 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8937 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8938 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8939 | |
| 8940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8941 | requires_max_content_len 200 |
| 8942 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8943 | "$P_SRV buffer_size=100" \ |
| 8944 | "$P_CLI request_size=200" \ |
| 8945 | 0 \ |
| 8946 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8947 | |
| 8948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8949 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 8950 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8951 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8952 | 0 \ |
| 8953 | -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] | 8954 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8955 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8956 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8957 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8958 | "$P_SRV force_version=tls12" \ |
| 8959 | "$P_CLI request_size=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 8960 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8961 | 0 \ |
| 8962 | -s "Read from client: 1 bytes read" |
| 8963 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8964 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8965 | "$P_SRV force_version=tls12" \ |
| 8966 | "$P_CLI request_size=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 8967 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 8968 | 0 \ |
| 8969 | -s "Read from client: 1 bytes read" |
| 8970 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8971 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8972 | "$P_SRV force_version=tls12" \ |
| 8973 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8974 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8975 | 0 \ |
| 8976 | -s "Read from client: 1 bytes read" |
| 8977 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8978 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8979 | "$P_SRV force_version=tls12" \ |
| 8980 | "$P_CLI request_size=1 \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 8981 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8982 | 0 \ |
| 8983 | -s "Read from client: 1 bytes read" |
| 8984 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8985 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8986 | "$P_SRV force_version=tls12" \ |
| 8987 | "$P_CLI request_size=1 \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 8988 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8989 | 0 \ |
| 8990 | -s "Read from client: 1 bytes read" |
| 8991 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8992 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8993 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8994 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8995 | "$P_CLI request_size=1 \ |
| 8996 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8997 | 0 \ |
| 8998 | -s "Read from client: 1 bytes read" |
| 8999 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9000 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9001 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9002 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9003 | "$P_CLI request_size=1 \ |
| 9004 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9005 | 0 \ |
| 9006 | -s "Read from client: 1 bytes read" |
| 9007 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9008 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9009 | |
| 9010 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9011 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9012 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9013 | "$P_CLI dtls=1 request_size=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9014 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9015 | 0 \ |
| 9016 | -s "Read from client: 1 bytes read" |
| 9017 | |
| 9018 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9019 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9020 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9021 | "$P_CLI dtls=1 request_size=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9022 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9023 | 0 \ |
| 9024 | -s "Read from client: 1 bytes read" |
| 9025 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9026 | # Tests for small server packets |
| 9027 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9028 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9029 | "$P_SRV response_size=1 force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9030 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9031 | 0 \ |
| 9032 | -c "Read from server: 1 bytes read" |
| 9033 | |
| 9034 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9035 | "$P_SRV response_size=1 force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9036 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9037 | 0 \ |
| 9038 | -c "Read from server: 1 bytes read" |
| 9039 | |
| 9040 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9041 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9042 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9043 | 0 \ |
| 9044 | -c "Read from server: 1 bytes read" |
| 9045 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9046 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9047 | "$P_SRV response_size=1 force_version=tls12" \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9048 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9049 | 0 \ |
| 9050 | -c "Read from server: 1 bytes read" |
| 9051 | |
| 9052 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9053 | "$P_SRV response_size=1 force_version=tls12" \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9054 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9055 | 0 \ |
| 9056 | -c "Read from server: 1 bytes read" |
| 9057 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9058 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9059 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9060 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9061 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9062 | 0 \ |
| 9063 | -c "Read from server: 1 bytes read" |
| 9064 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9066 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9067 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9068 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9069 | 0 \ |
| 9070 | -c "Read from server: 1 bytes read" |
| 9071 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9072 | # Tests for small server packets in DTLS |
| 9073 | |
| 9074 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9075 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9076 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9077 | "$P_CLI dtls=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9078 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9079 | 0 \ |
| 9080 | -c "Read from server: 1 bytes read" |
| 9081 | |
| 9082 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9083 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9084 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9085 | "$P_CLI dtls=1 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9086 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9087 | 0 \ |
| 9088 | -c "Read from server: 1 bytes read" |
| 9089 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9090 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9091 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9092 | # How many fragments do we expect to write $1 bytes? |
| 9093 | fragments_for_write() { |
| 9094 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9095 | } |
| 9096 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9097 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9098 | "$P_SRV force_version=tls12" \ |
| 9099 | "$P_CLI request_size=16384 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9100 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9101 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9102 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9103 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9104 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9105 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9106 | "$P_SRV force_version=tls12" \ |
| 9107 | "$P_CLI request_size=16384 etm=0 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9108 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9109 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9110 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9111 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9112 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9113 | "$P_SRV force_version=tls12" \ |
| 9114 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9115 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9116 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9117 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9118 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9119 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9120 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9121 | "$P_SRV force_version=tls12" \ |
| 9122 | "$P_CLI request_size=16384 \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9123 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9124 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9125 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9126 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9127 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9128 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9129 | "$P_SRV force_version=tls12" \ |
| 9130 | "$P_CLI request_size=16384 \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9131 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9132 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9133 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9134 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9135 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9136 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9137 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9138 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9139 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9140 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9141 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9142 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9143 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9144 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9145 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9146 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9147 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9148 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9149 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9150 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9151 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9152 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9153 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9154 | # 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] | 9155 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9156 | "$P_SRV response_size=16384 force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9157 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9158 | 0 \ |
| 9159 | -c "Read from server: 16384 bytes read" |
| 9160 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9161 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9162 | "$P_SRV response_size=16384 force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9163 | "$P_CLI etm=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9164 | 0 \ |
| 9165 | -s "16384 bytes written in 1 fragments" \ |
| 9166 | -c "Read from server: 16384 bytes read" |
| 9167 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9168 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9169 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9170 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9171 | 0 \ |
| 9172 | -c "Read from server: 16384 bytes read" |
| 9173 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9174 | 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] | 9175 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9176 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9177 | 0 \ |
| 9178 | -s "16384 bytes written in 1 fragments" \ |
| 9179 | -c "Read from server: 16384 bytes read" |
| 9180 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9181 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9182 | "$P_SRV response_size=16384 force_version=tls12" \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9183 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9184 | 0 \ |
| 9185 | -c "Read from server: 16384 bytes read" |
| 9186 | |
| 9187 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9188 | "$P_SRV response_size=16384 force_version=tls12" \ |
Gabor Mezei | dd7c0f1 | 2025-02-17 13:42:46 +0100 | [diff] [blame] | 9189 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9190 | 0 \ |
| 9191 | -c "Read from server: 16384 bytes read" |
| 9192 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9193 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9194 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9195 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9196 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9197 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9198 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9199 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9200 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9201 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9202 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9203 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9204 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9205 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9206 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9207 | # Tests for restartable ECC |
| 9208 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9209 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9210 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9211 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9212 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9213 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9214 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9215 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9216 | 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] | 9217 | debug_level=1" \ |
| 9218 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9219 | -C "x509_verify_cert.*4b00" \ |
| 9220 | -C "mbedtls_pk_verify.*4b00" \ |
| 9221 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9222 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9223 | |
| 9224 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9225 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9226 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9227 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9228 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9229 | 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] | 9230 | debug_level=1 ec_max_ops=0" \ |
| 9231 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9232 | -C "x509_verify_cert.*4b00" \ |
| 9233 | -C "mbedtls_pk_verify.*4b00" \ |
| 9234 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9235 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9236 | |
| 9237 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9238 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9239 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9240 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9241 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9242 | 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] | 9243 | debug_level=1 ec_max_ops=65535" \ |
| 9244 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9245 | -C "x509_verify_cert.*4b00" \ |
| 9246 | -C "mbedtls_pk_verify.*4b00" \ |
| 9247 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9248 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9249 | |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9250 | # The following test cases for restartable ECDH come in two variants: |
| 9251 | # * The "(USE_PSA)" variant expects the current behavior, which is the behavior |
| 9252 | # from Mbed TLS 3.x when MBEDTLS_USE_PSA_CRYPTO is disabled. This tests |
| 9253 | # the partial implementation where ECDH in TLS is not actually restartable. |
| 9254 | # * The "(no USE_PSA)" variant expects the desired behavior. These test |
| 9255 | # cases cannot currently pass because the implementation of restartable ECC |
| 9256 | # in TLS is partial: ECDH is not actually restartable. This is the behavior |
| 9257 | # from Mbed TLS 3.x when MBEDTLS_USE_PSA_CRYPTO is enabled. |
| 9258 | # |
| 9259 | # As part of resolving https://github.com/Mbed-TLS/mbedtls/issues/7294, |
| 9260 | # we will remove the "(USE_PSA)" test cases and run the "(no USE_PSA)" test |
| 9261 | # cases. |
| 9262 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9263 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9264 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9265 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9266 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9267 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9268 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9269 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9270 | 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] | 9271 | debug_level=1 ec_max_ops=1000" \ |
| 9272 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9273 | -c "x509_verify_cert.*4b00" \ |
| 9274 | -c "mbedtls_pk_verify.*4b00" \ |
| 9275 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9276 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9277 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9278 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9279 | # everything except ECDH (where TLS calls PSA directly). |
| 9280 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9281 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9282 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9283 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9284 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9285 | 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] | 9286 | debug_level=1 ec_max_ops=1000" \ |
| 9287 | 0 \ |
| 9288 | -c "x509_verify_cert.*4b00" \ |
| 9289 | -c "mbedtls_pk_verify.*4b00" \ |
| 9290 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9291 | -c "mbedtls_pk_sign.*4b00" |
| 9292 | |
| 9293 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9294 | # 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] | 9295 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9296 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9297 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9298 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9299 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9300 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9301 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9302 | 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] | 9303 | debug_level=1 ec_max_ops=1000" \ |
| 9304 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9305 | -c "x509_verify_cert.*4b00" \ |
| 9306 | -C "mbedtls_pk_verify.*4b00" \ |
| 9307 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9308 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9309 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9310 | -c "! mbedtls_ssl_handshake returned" \ |
| 9311 | -c "X509 - Certificate verification failed" |
| 9312 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9313 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9314 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9315 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9316 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9317 | 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] | 9318 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9319 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9320 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9321 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9322 | 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] | 9323 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9324 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9325 | -c "x509_verify_cert.*4b00" \ |
| 9326 | -c "mbedtls_pk_verify.*4b00" \ |
| 9327 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9328 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9329 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9330 | -C "! mbedtls_ssl_handshake returned" \ |
| 9331 | -C "X509 - Certificate verification failed" |
| 9332 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9333 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9334 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9335 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9336 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9337 | 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] | 9338 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9339 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9340 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9341 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9342 | 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] | 9343 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9344 | 0 \ |
| 9345 | -c "x509_verify_cert.*4b00" \ |
| 9346 | -c "mbedtls_pk_verify.*4b00" \ |
| 9347 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9348 | -c "mbedtls_pk_sign.*4b00" \ |
| 9349 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9350 | -C "! mbedtls_ssl_handshake returned" \ |
| 9351 | -C "X509 - Certificate verification failed" |
| 9352 | |
| 9353 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9354 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9355 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9356 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9357 | 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] | 9358 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9359 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9360 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9361 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9362 | 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] | 9363 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9364 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9365 | -C "x509_verify_cert.*4b00" \ |
| 9366 | -c "mbedtls_pk_verify.*4b00" \ |
| 9367 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9368 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9369 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9370 | -C "! mbedtls_ssl_handshake returned" \ |
| 9371 | -C "X509 - Certificate verification failed" |
| 9372 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9373 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9374 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9375 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9376 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9377 | 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] | 9378 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9379 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9380 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9381 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9382 | 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] | 9383 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9384 | 0 \ |
| 9385 | -C "x509_verify_cert.*4b00" \ |
| 9386 | -c "mbedtls_pk_verify.*4b00" \ |
| 9387 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9388 | -c "mbedtls_pk_sign.*4b00" \ |
| 9389 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9390 | -C "! mbedtls_ssl_handshake returned" \ |
| 9391 | -C "X509 - Certificate verification failed" |
| 9392 | |
| 9393 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9394 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9395 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9396 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9397 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9398 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9399 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9400 | 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] | 9401 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9402 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9403 | -c "x509_verify_cert.*4b00" \ |
| 9404 | -c "mbedtls_pk_verify.*4b00" \ |
| 9405 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9406 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9407 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9408 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9409 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9410 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9411 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9412 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9413 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9414 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9415 | 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] | 9416 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9417 | 0 \ |
| 9418 | -c "x509_verify_cert.*4b00" \ |
| 9419 | -c "mbedtls_pk_verify.*4b00" \ |
| 9420 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9421 | -c "mbedtls_pk_sign.*4b00" |
| 9422 | |
| 9423 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9424 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9425 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Gilles Peskine | 005370f | 2024-10-24 20:21:46 +0200 | [diff] [blame] | 9426 | skip_next_test |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9427 | 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] | 9428 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9429 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9430 | debug_level=1 ec_max_ops=1000" \ |
| 9431 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9432 | -c "x509_verify_cert.*4b00" \ |
| 9433 | -c "mbedtls_pk_verify.*4b00" \ |
| 9434 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9435 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9436 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9437 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9438 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9439 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9440 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9441 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9442 | 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] | 9443 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9444 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9445 | debug_level=1 ec_max_ops=1000" \ |
| 9446 | 0 \ |
| 9447 | -c "x509_verify_cert.*4b00" \ |
| 9448 | -c "mbedtls_pk_verify.*4b00" \ |
| 9449 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9450 | -C "mbedtls_pk_sign.*4b00" |
| 9451 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9452 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9453 | # restartable behaviour at all (not even client auth). |
| 9454 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9455 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9456 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9457 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9458 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9459 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9460 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9461 | 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] | 9462 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9463 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9464 | -C "x509_verify_cert.*4b00" \ |
| 9465 | -C "mbedtls_pk_verify.*4b00" \ |
| 9466 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9467 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9468 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9469 | # Tests of asynchronous private key support in SSL |
| 9470 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9471 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9472 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9473 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9474 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9475 | "$P_CLI" \ |
| 9476 | 0 \ |
| 9477 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9478 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9479 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9481 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9482 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9483 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9484 | "$P_CLI" \ |
| 9485 | 0 \ |
| 9486 | -s "Async sign callback: using key slot " \ |
| 9487 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9488 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9489 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9490 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9491 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9492 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9493 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9494 | "$P_CLI" \ |
| 9495 | 0 \ |
| 9496 | -s "Async sign callback: using key slot " \ |
| 9497 | -U "Async sign callback: using key slot " \ |
| 9498 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9499 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9500 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9501 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9502 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9503 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9504 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9505 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9506 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9507 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 9508 | 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] | 9509 | "$P_CLI server_name=polarssl.example" \ |
| 9510 | 0 \ |
| 9511 | -s "Async sign callback: using key slot " \ |
| 9512 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9513 | -s "parse ServerName extension" \ |
| 9514 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9515 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9516 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9517 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9518 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9519 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9520 | "$P_SRV \ |
| 9521 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9522 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9523 | 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] | 9524 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9525 | 0 \ |
| 9526 | -s "Async sign callback: using key slot 0," \ |
| 9527 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9528 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9529 | |
| 9530 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9531 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9532 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9533 | "$P_SRV \ |
| 9534 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9535 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9536 | 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] | 9537 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9538 | 0 \ |
| 9539 | -s "Async sign callback: using key slot 0," \ |
| 9540 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9541 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9542 | |
| 9543 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9544 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 9545 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9546 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 9547 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9548 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9549 | 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] | 9550 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9551 | 0 \ |
| 9552 | -s "Async sign callback: using key slot 1," \ |
| 9553 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9554 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9555 | |
| 9556 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9557 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9558 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9559 | "$P_SRV \ |
| 9560 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9561 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9562 | 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] | 9563 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9564 | 0 \ |
| 9565 | -s "Async sign callback: no key matches this certificate." |
| 9566 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9568 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9569 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9570 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9571 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9572 | "$P_CLI" \ |
| 9573 | 1 \ |
| 9574 | -s "Async sign callback: injected error" \ |
| 9575 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9576 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9577 | -s "! mbedtls_ssl_handshake returned" |
| 9578 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9579 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9580 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9581 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9582 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9583 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9584 | "$P_CLI" \ |
| 9585 | 1 \ |
| 9586 | -s "Async sign callback: using key slot " \ |
| 9587 | -S "Async resume" \ |
| 9588 | -s "Async cancel" |
| 9589 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9590 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9591 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9592 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9593 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9594 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9595 | "$P_CLI" \ |
| 9596 | 1 \ |
| 9597 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9598 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 9599 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9600 | -s "! mbedtls_ssl_handshake returned" |
| 9601 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9602 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9603 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9604 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9605 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9606 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9607 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9608 | 0 \ |
| 9609 | -s "Async cancel" \ |
| 9610 | -s "! mbedtls_ssl_handshake returned" \ |
| 9611 | -s "Async resume" \ |
| 9612 | -s "Successful connection" |
| 9613 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9614 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9615 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9616 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9617 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 9618 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9619 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 9620 | 0 \ |
| 9621 | -s "! mbedtls_ssl_handshake returned" \ |
| 9622 | -s "Async resume" \ |
| 9623 | -s "Successful connection" |
| 9624 | |
| 9625 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9626 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9627 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9628 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9629 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9630 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9631 | 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] | 9632 | "$P_SRV \ |
| 9633 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9634 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9635 | 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] | 9636 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9637 | [ \$? -eq 1 ] && |
| 9638 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9639 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 9640 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9641 | -S "Async resume" \ |
| 9642 | -s "Async cancel" \ |
| 9643 | -s "! mbedtls_ssl_handshake returned" \ |
| 9644 | -s "Async sign callback: no key matches this certificate." \ |
| 9645 | -s "Successful connection" |
| 9646 | |
| 9647 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9648 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 9649 | # Note: the function "detect_required_features()" is not able to detect more than |
| 9650 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 9651 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 9652 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 9653 | 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] | 9654 | "$P_SRV \ |
| 9655 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9656 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9657 | 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] | 9658 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9659 | [ \$? -eq 1 ] && |
| 9660 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9661 | 0 \ |
| 9662 | -s "Async resume" \ |
| 9663 | -s "! mbedtls_ssl_handshake returned" \ |
| 9664 | -s "Async sign callback: no key matches this certificate." \ |
| 9665 | -s "Successful connection" |
| 9666 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9667 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9669 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9670 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9671 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9672 | exchanges=2 renegotiation=1" \ |
| 9673 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9674 | 0 \ |
| 9675 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9676 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9677 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9678 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9680 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9681 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9682 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9683 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9684 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 9685 | 0 \ |
| 9686 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9687 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9688 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9689 | # Tests for ECC extensions (rfc 4492) |
| 9690 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9691 | requires_hash_alg SHA_256 |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9692 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9693 | run_test "Force a non ECC ciphersuite in the client side" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9694 | "$P_SRV debug_level=3 psk=73776f726466697368" \ |
| 9695 | "$P_CLI debug_level=3 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9696 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9697 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9698 | -C "client hello, adding supported_point_formats extension" \ |
| 9699 | -S "found supported elliptic curves extension" \ |
| 9700 | -S "found supported point formats extension" |
| 9701 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9702 | requires_hash_alg SHA_256 |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9703 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9704 | run_test "Force a non ECC ciphersuite in the server side" \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 9705 | "$P_SRV debug_level=3 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA256" \ |
| 9706 | "$P_CLI debug_level=3 psk=73776f726466697368" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9707 | 0 \ |
| 9708 | -C "found supported_point_formats extension" \ |
| 9709 | -S "server hello, supported_point_formats extension" |
| 9710 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9711 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9712 | run_test "Force an ECC ciphersuite in the client side" \ |
| 9713 | "$P_SRV debug_level=3" \ |
| 9714 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9715 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9716 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9717 | -c "client hello, adding supported_point_formats extension" \ |
| 9718 | -s "found supported elliptic curves extension" \ |
| 9719 | -s "found supported point formats extension" |
| 9720 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9721 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9722 | run_test "Force an ECC ciphersuite in the server side" \ |
| 9723 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9724 | "$P_CLI debug_level=3" \ |
| 9725 | 0 \ |
| 9726 | -c "found supported_point_formats extension" \ |
| 9727 | -s "server hello, supported_point_formats extension" |
| 9728 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9729 | # Tests for DTLS HelloVerifyRequest |
| 9730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9732 | run_test "DTLS cookie: enabled" \ |
| 9733 | "$P_SRV dtls=1 debug_level=2" \ |
| 9734 | "$P_CLI dtls=1 debug_level=2" \ |
| 9735 | 0 \ |
| 9736 | -s "cookie verification failed" \ |
| 9737 | -s "cookie verification passed" \ |
| 9738 | -S "cookie verification skipped" \ |
| 9739 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9740 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9741 | -S "SSL - The requested feature is not available" |
| 9742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9744 | run_test "DTLS cookie: disabled" \ |
| 9745 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 9746 | "$P_CLI dtls=1 debug_level=2" \ |
| 9747 | 0 \ |
| 9748 | -S "cookie verification failed" \ |
| 9749 | -S "cookie verification passed" \ |
| 9750 | -s "cookie verification skipped" \ |
| 9751 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9752 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9753 | -S "SSL - The requested feature is not available" |
| 9754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9756 | run_test "DTLS cookie: default (failing)" \ |
| 9757 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 9758 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 9759 | 1 \ |
| 9760 | -s "cookie verification failed" \ |
| 9761 | -S "cookie verification passed" \ |
| 9762 | -S "cookie verification skipped" \ |
| 9763 | -C "received hello verify request" \ |
| 9764 | -S "hello verification requested" \ |
| 9765 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9766 | |
| 9767 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9769 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9770 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9771 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9772 | 0 \ |
| 9773 | -s "cookie verification failed" \ |
| 9774 | -s "cookie verification passed" \ |
| 9775 | -S "cookie verification skipped" \ |
| 9776 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9777 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9778 | -S "SSL - The requested feature is not available" |
| 9779 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9781 | run_test "DTLS cookie: enabled, nbio" \ |
| 9782 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9783 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9784 | 0 \ |
| 9785 | -s "cookie verification failed" \ |
| 9786 | -s "cookie verification passed" \ |
| 9787 | -S "cookie verification skipped" \ |
| 9788 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9789 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9790 | -S "SSL - The requested feature is not available" |
| 9791 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9792 | # Tests for client reconnecting from the same port with DTLS |
| 9793 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9794 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9796 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9797 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9798 | "$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] | 9799 | 0 \ |
| 9800 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9801 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9802 | -S "Client initiated reconnection from same port" |
| 9803 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9804 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9806 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9807 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9808 | "$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] | 9809 | 0 \ |
| 9810 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9811 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9812 | -s "Client initiated reconnection from same port" |
| 9813 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9814 | 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] | 9815 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9816 | 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] | 9817 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9818 | "$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] | 9819 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9820 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9821 | -s "Client initiated reconnection from same port" |
| 9822 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9823 | 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] | 9824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9825 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9826 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9827 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9828 | 0 \ |
| 9829 | -S "The operation timed out" \ |
| 9830 | -s "Client initiated reconnection from same port" |
| 9831 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9833 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9834 | "$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] | 9835 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9836 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9837 | -s "The operation timed out" \ |
| 9838 | -S "Client initiated reconnection from same port" |
| 9839 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9841 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9842 | -p "$P_PXY inject_clihlo=1" \ |
| 9843 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9844 | "$P_CLI dtls=1 exchanges=2" \ |
| 9845 | 0 \ |
| 9846 | -s "possible client reconnect from the same port" \ |
| 9847 | -S "Client initiated reconnection from same port" |
| 9848 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9849 | # Tests for various cases of client authentication with DTLS |
| 9850 | # (focused on handshake flows and message parsing) |
| 9851 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9853 | run_test "DTLS client auth: required" \ |
| 9854 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9855 | "$P_CLI dtls=1" \ |
| 9856 | 0 \ |
| 9857 | -s "Verifying peer X.509 certificate... ok" |
| 9858 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9860 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9861 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9862 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9863 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9864 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9867 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9868 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9869 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9870 | 0 \ |
| 9871 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9872 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9873 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9874 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9875 | "$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] | 9876 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9877 | 1 \ |
| 9878 | -s "SSL - Verification of the message MAC failed" \ |
| 9879 | -c "SSL - A fatal alert message was received from our peer" |
| 9880 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9881 | # Tests for receiving fragmented handshake messages with DTLS |
| 9882 | |
| 9883 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9885 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9886 | "$G_SRV -u --mtu 2048 -a" \ |
| 9887 | "$P_CLI dtls=1 debug_level=2" \ |
| 9888 | 0 \ |
| 9889 | -C "found fragmented DTLS handshake message" \ |
| 9890 | -C "error" |
| 9891 | |
| 9892 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9894 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9895 | "$G_SRV -u --mtu 512" \ |
| 9896 | "$P_CLI dtls=1 debug_level=2" \ |
| 9897 | 0 \ |
| 9898 | -c "found fragmented DTLS handshake message" \ |
| 9899 | -C "error" |
| 9900 | |
| 9901 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9903 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9904 | "$G_SRV -u --mtu 128" \ |
| 9905 | "$P_CLI dtls=1 debug_level=2" \ |
| 9906 | 0 \ |
| 9907 | -c "found fragmented DTLS handshake message" \ |
| 9908 | -C "error" |
| 9909 | |
| 9910 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9912 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9913 | "$G_SRV -u --mtu 128" \ |
| 9914 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9915 | 0 \ |
| 9916 | -c "found fragmented DTLS handshake message" \ |
| 9917 | -C "error" |
| 9918 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9919 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9920 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9922 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9923 | "$G_SRV -u --mtu 256" \ |
| 9924 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9925 | 0 \ |
| 9926 | -c "found fragmented DTLS handshake message" \ |
| 9927 | -c "client hello, adding renegotiation extension" \ |
| 9928 | -c "found renegotiation extension" \ |
| 9929 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9930 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9931 | -C "error" \ |
| 9932 | -s "Extra-header:" |
| 9933 | |
| 9934 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9935 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9937 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9938 | "$G_SRV -u --mtu 256" \ |
| 9939 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9940 | 0 \ |
| 9941 | -c "found fragmented DTLS handshake message" \ |
| 9942 | -c "client hello, adding renegotiation extension" \ |
| 9943 | -c "found renegotiation extension" \ |
| 9944 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9945 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9946 | -C "error" \ |
| 9947 | -s "Extra-header:" |
| 9948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9950 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9951 | "$O_SRV -dtls -mtu 2048" \ |
| 9952 | "$P_CLI dtls=1 debug_level=2" \ |
| 9953 | 0 \ |
| 9954 | -C "found fragmented DTLS handshake message" \ |
| 9955 | -C "error" |
| 9956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9958 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 9959 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9960 | "$P_CLI dtls=1 debug_level=2" \ |
| 9961 | 0 \ |
| 9962 | -c "found fragmented DTLS handshake message" \ |
| 9963 | -C "error" |
| 9964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9966 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9967 | "$O_SRV -dtls -mtu 256" \ |
| 9968 | "$P_CLI dtls=1 debug_level=2" \ |
| 9969 | 0 \ |
| 9970 | -c "found fragmented DTLS handshake message" \ |
| 9971 | -C "error" |
| 9972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9974 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9975 | "$O_SRV -dtls -mtu 256" \ |
| 9976 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9977 | 0 \ |
| 9978 | -c "found fragmented DTLS handshake message" \ |
| 9979 | -C "error" |
| 9980 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9981 | # Tests for sending fragmented handshake messages with DTLS |
| 9982 | # |
| 9983 | # Use client auth when we need the client to send large messages, |
| 9984 | # and use large cert chains on both sides too (the long chains we have all use |
| 9985 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9986 | # Sizes reached (UDP payload): |
| 9987 | # - 2037B for server certificate |
| 9988 | # - 1542B for client certificate |
| 9989 | # - 1013B for newsessionticket |
| 9990 | # - all others below 512B |
| 9991 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9992 | |
| 9993 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9994 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9995 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9996 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9998 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9999 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10000 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10001 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10002 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10003 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10004 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10005 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10006 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10007 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10008 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10009 | 0 \ |
| 10010 | -S "found fragmented DTLS handshake message" \ |
| 10011 | -C "found fragmented DTLS handshake message" \ |
| 10012 | -C "error" |
| 10013 | |
| 10014 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10015 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10016 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10017 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10019 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10020 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10021 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10022 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10023 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10024 | max_frag_len=1024" \ |
| 10025 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10026 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10027 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10028 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10029 | max_frag_len=2048" \ |
| 10030 | 0 \ |
| 10031 | -S "found fragmented DTLS handshake message" \ |
| 10032 | -c "found fragmented DTLS handshake message" \ |
| 10033 | -C "error" |
| 10034 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10035 | # With the MFL extension, the server has no way of forcing |
| 10036 | # the client to not exceed a certain MTU; hence, the following |
| 10037 | # test can't be replicated with an MTU proxy such as the one |
| 10038 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10039 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10040 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10041 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10042 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10044 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10045 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10046 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10047 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10048 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10049 | max_frag_len=512" \ |
| 10050 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10051 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10052 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10053 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10054 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10055 | 0 \ |
| 10056 | -S "found fragmented DTLS handshake message" \ |
| 10057 | -c "found fragmented DTLS handshake message" \ |
| 10058 | -C "error" |
| 10059 | |
| 10060 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10061 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10063 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10065 | 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] | 10066 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10067 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10068 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10069 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10070 | max_frag_len=2048" \ |
| 10071 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10072 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10073 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10074 | hs_timeout=2500-60000 \ |
| 10075 | max_frag_len=1024" \ |
| 10076 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10077 | -S "found fragmented DTLS handshake message" \ |
| 10078 | -c "found fragmented DTLS handshake message" \ |
| 10079 | -C "error" |
| 10080 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10081 | # While not required by the standard defining the MFL extension |
| 10082 | # (according to which it only applies to records, not to datagrams), |
| 10083 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10084 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10085 | # to the peer. |
| 10086 | # The next test checks that no datagrams significantly larger than the |
| 10087 | # negotiated MFL are sent. |
| 10088 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10089 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10090 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10091 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10093 | 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] | 10094 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10095 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10096 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10097 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10098 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10099 | max_frag_len=2048" \ |
| 10100 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10101 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10102 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10103 | hs_timeout=2500-60000 \ |
| 10104 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10105 | 0 \ |
| 10106 | -S "found fragmented DTLS handshake message" \ |
| 10107 | -c "found fragmented DTLS handshake message" \ |
| 10108 | -C "error" |
| 10109 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10110 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10111 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10112 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10113 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10115 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10116 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10117 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10118 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10119 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10120 | max_frag_len=2048" \ |
| 10121 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10122 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10123 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10124 | hs_timeout=2500-60000 \ |
| 10125 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10126 | 0 \ |
| 10127 | -s "found fragmented DTLS handshake message" \ |
| 10128 | -c "found fragmented DTLS handshake message" \ |
| 10129 | -C "error" |
| 10130 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10131 | # While not required by the standard defining the MFL extension |
| 10132 | # (according to which it only applies to records, not to datagrams), |
| 10133 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10134 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10135 | # to the peer. |
| 10136 | # The next test checks that no datagrams significantly larger than the |
| 10137 | # negotiated MFL are sent. |
| 10138 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10139 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10140 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10141 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10143 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10144 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10145 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10146 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10147 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10148 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10149 | max_frag_len=2048" \ |
| 10150 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10151 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10152 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10153 | hs_timeout=2500-60000 \ |
| 10154 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10155 | 0 \ |
| 10156 | -s "found fragmented DTLS handshake message" \ |
| 10157 | -c "found fragmented DTLS handshake message" \ |
| 10158 | -C "error" |
| 10159 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10160 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10161 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10162 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10164 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10165 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10166 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10167 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10168 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10169 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10170 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10171 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10172 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10173 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10174 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10175 | 0 \ |
| 10176 | -S "found fragmented DTLS handshake message" \ |
| 10177 | -C "found fragmented DTLS handshake message" \ |
| 10178 | -C "error" |
| 10179 | |
| 10180 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10181 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10182 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10184 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10185 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10186 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10187 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10188 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10189 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10190 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10191 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10192 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10193 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10194 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10195 | 0 \ |
| 10196 | -s "found fragmented DTLS handshake message" \ |
| 10197 | -C "found fragmented DTLS handshake message" \ |
| 10198 | -C "error" |
| 10199 | |
| 10200 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10201 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10202 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10204 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10205 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10206 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10207 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10208 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10209 | mtu=512" \ |
| 10210 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10211 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10212 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10213 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10214 | mtu=2048" \ |
| 10215 | 0 \ |
| 10216 | -S "found fragmented DTLS handshake message" \ |
| 10217 | -c "found fragmented DTLS handshake message" \ |
| 10218 | -C "error" |
| 10219 | |
| 10220 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10221 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10222 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10224 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10225 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10226 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10227 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10228 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10229 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10230 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10231 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10232 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10233 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10234 | hs_timeout=2500-60000 \ |
| 10235 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10236 | 0 \ |
| 10237 | -s "found fragmented DTLS handshake message" \ |
| 10238 | -c "found fragmented DTLS handshake message" \ |
| 10239 | -C "error" |
| 10240 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10241 | # 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] | 10242 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10243 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10244 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10245 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10246 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10247 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10248 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10249 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10250 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10251 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10252 | mtu=512" \ |
| 10253 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10254 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10255 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10256 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10257 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10258 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10259 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10260 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10261 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10262 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10263 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10264 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10265 | # 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] | 10266 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10267 | # retransmissions, but in some cases (like both the server and client using |
| 10268 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10269 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10270 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10272 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10273 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10274 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10275 | -p "$P_PXY mtu=508" \ |
| 10276 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10277 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10278 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10279 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10280 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10281 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10282 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10283 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10284 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10285 | 0 \ |
| 10286 | -s "found fragmented DTLS handshake message" \ |
| 10287 | -c "found fragmented DTLS handshake message" \ |
| 10288 | -C "error" |
| 10289 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10290 | # 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] | 10291 | only_with_valgrind |
| 10292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10293 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10294 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10295 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10296 | -p "$P_PXY mtu=508" \ |
| 10297 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10298 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10299 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10300 | hs_timeout=250-10000" \ |
| 10301 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10302 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10303 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10304 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10305 | hs_timeout=250-10000" \ |
| 10306 | 0 \ |
| 10307 | -s "found fragmented DTLS handshake message" \ |
| 10308 | -c "found fragmented DTLS handshake message" \ |
| 10309 | -C "error" |
| 10310 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10311 | # 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] | 10312 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10313 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10314 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10315 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10316 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10317 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10319 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10320 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10321 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10322 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10323 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10324 | hs_timeout=10000-60000 \ |
| 10325 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10326 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10327 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10328 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10329 | hs_timeout=10000-60000 \ |
| 10330 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10331 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10332 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10333 | -s "found fragmented DTLS handshake message" \ |
| 10334 | -c "found fragmented DTLS handshake message" \ |
| 10335 | -C "error" |
| 10336 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10337 | # 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] | 10338 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10339 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10340 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10341 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10342 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10343 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10344 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10345 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10346 | -p "$P_PXY mtu=512" \ |
| 10347 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10348 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10349 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10350 | hs_timeout=10000-60000 \ |
| 10351 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10352 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10353 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10354 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10355 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10356 | hs_timeout=10000-60000 \ |
| 10357 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10358 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10359 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10360 | -s "found fragmented DTLS handshake message" \ |
| 10361 | -c "found fragmented DTLS handshake message" \ |
| 10362 | -C "error" |
| 10363 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10364 | not_with_valgrind # spurious autoreduction due to timeout |
| 10365 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10366 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10367 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10369 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10370 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10371 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10372 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10373 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10374 | hs_timeout=10000-60000 \ |
| 10375 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10376 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10377 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10378 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10379 | hs_timeout=10000-60000 \ |
| 10380 | mtu=1024 nbio=2" \ |
| 10381 | 0 \ |
| 10382 | -S "autoreduction" \ |
| 10383 | -s "found fragmented DTLS handshake message" \ |
| 10384 | -c "found fragmented DTLS handshake message" \ |
| 10385 | -C "error" |
| 10386 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10387 | # 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] | 10388 | not_with_valgrind # spurious autoreduction due to timeout |
| 10389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10390 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10391 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10392 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10393 | -p "$P_PXY mtu=512" \ |
| 10394 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10395 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10396 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10397 | hs_timeout=10000-60000 \ |
| 10398 | mtu=512 nbio=2" \ |
| 10399 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10400 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10401 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10402 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10403 | hs_timeout=10000-60000 \ |
| 10404 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10405 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10406 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10407 | -s "found fragmented DTLS handshake message" \ |
| 10408 | -c "found fragmented DTLS handshake message" \ |
| 10409 | -C "error" |
| 10410 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10411 | # 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] | 10412 | # This ensures things still work after session_reset(). |
| 10413 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10414 | # Since we don't support reading fragmented ClientHello yet, |
| 10415 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 10416 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10417 | # An autoreduction on the client-side might happen if the server is |
| 10418 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 10419 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10420 | # resumed listening, which would result in a spurious autoreduction. |
| 10421 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10422 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10423 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10424 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10425 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 10426 | -p "$P_PXY mtu=1450" \ |
| 10427 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10428 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10429 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10430 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10431 | mtu=1450" \ |
| 10432 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10433 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10434 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10435 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10436 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 10437 | 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] | 10438 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10439 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10440 | -s "found fragmented DTLS handshake message" \ |
| 10441 | -c "found fragmented DTLS handshake message" \ |
| 10442 | -C "error" |
| 10443 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10444 | # An autoreduction on the client-side might happen if the server is |
| 10445 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10446 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10447 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10448 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10449 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10451 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10452 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 10453 | -p "$P_PXY mtu=512" \ |
| 10454 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10455 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10456 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10457 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10458 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10459 | mtu=512" \ |
| 10460 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10461 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10462 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10463 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 10464 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10465 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10466 | mtu=512" \ |
| 10467 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10468 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10469 | -s "found fragmented DTLS handshake message" \ |
| 10470 | -c "found fragmented DTLS handshake message" \ |
| 10471 | -C "error" |
| 10472 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10473 | # An autoreduction on the client-side might happen if the server is |
| 10474 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10475 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10477 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10478 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10480 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10481 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 10482 | -p "$P_PXY mtu=512" \ |
| 10483 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10484 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10485 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10486 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10487 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10488 | mtu=512" \ |
| 10489 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10490 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10491 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10492 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10493 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10494 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10495 | mtu=512" \ |
| 10496 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10497 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10498 | -s "found fragmented DTLS handshake message" \ |
| 10499 | -c "found fragmented DTLS handshake message" \ |
| 10500 | -C "error" |
| 10501 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10502 | # An autoreduction on the client-side might happen if the server is |
| 10503 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10504 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10505 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10506 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10507 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10508 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10509 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10510 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10511 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10512 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10513 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10514 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10515 | exchanges=2 renegotiation=1 \ |
| 10516 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10517 | hs_timeout=10000-60000 \ |
| 10518 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10519 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10520 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10521 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10522 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10523 | hs_timeout=10000-60000 \ |
| 10524 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10525 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10526 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10527 | -s "found fragmented DTLS handshake message" \ |
| 10528 | -c "found fragmented DTLS handshake message" \ |
| 10529 | -C "error" |
| 10530 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10531 | # An autoreduction on the client-side might happen if the server is |
| 10532 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10533 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10534 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10535 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10536 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10537 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10538 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10539 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10540 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10541 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10542 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10543 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10544 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10545 | exchanges=2 renegotiation=1 \ |
| 10546 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10547 | hs_timeout=10000-60000 \ |
| 10548 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10549 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10550 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10551 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10552 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10553 | hs_timeout=10000-60000 \ |
| 10554 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10555 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10556 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10557 | -s "found fragmented DTLS handshake message" \ |
| 10558 | -c "found fragmented DTLS handshake message" \ |
| 10559 | -C "error" |
| 10560 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10561 | # An autoreduction on the client-side might happen if the server is |
| 10562 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10563 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10565 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10566 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10568 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10569 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10570 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10571 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10572 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10573 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10574 | exchanges=2 renegotiation=1 \ |
| 10575 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10576 | hs_timeout=10000-60000 \ |
| 10577 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10578 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10579 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10580 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10581 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10582 | hs_timeout=10000-60000 \ |
| 10583 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10584 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10585 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10586 | -s "found fragmented DTLS handshake message" \ |
| 10587 | -c "found fragmented DTLS handshake message" \ |
| 10588 | -C "error" |
| 10589 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10590 | # 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] | 10591 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10592 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10593 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10594 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10595 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 10596 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10597 | "$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] | 10598 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10599 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10600 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10601 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10602 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10603 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10604 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10605 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10606 | 0 \ |
| 10607 | -s "found fragmented DTLS handshake message" \ |
| 10608 | -c "found fragmented DTLS handshake message" \ |
| 10609 | -C "error" |
| 10610 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10611 | # 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] | 10612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10613 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10614 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10615 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10616 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10617 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10618 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10619 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10620 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10621 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10622 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10623 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10624 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10625 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10626 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10627 | 0 \ |
| 10628 | -s "found fragmented DTLS handshake message" \ |
| 10629 | -c "found fragmented DTLS handshake message" \ |
| 10630 | -C "error" |
| 10631 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10632 | # interop tests for DTLS fragmentating with reliable connection |
| 10633 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10634 | # here and below we just want to test that the we fragment in a way that |
| 10635 | # pleases other implementations, so we don't need the peer to fragment |
| 10636 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10637 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10638 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10639 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10640 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10641 | "$G_SRV -u" \ |
| 10642 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10643 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10644 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10645 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10646 | 0 \ |
| 10647 | -c "fragmenting handshake message" \ |
| 10648 | -C "error" |
| 10649 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10650 | # We use --insecure for the GnuTLS client because it expects |
| 10651 | # the hostname / IP it connects to to be the name used in the |
| 10652 | # certificate obtained from the server. Here, however, it |
| 10653 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10654 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10655 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10656 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10657 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10658 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10659 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10660 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10661 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10662 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 10663 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10664 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10665 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10666 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10667 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10668 | 0 \ |
| 10669 | -s "fragmenting handshake message" |
| 10670 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10671 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10672 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10673 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10674 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10675 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10676 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10677 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10678 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10679 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10680 | 0 \ |
| 10681 | -c "fragmenting handshake message" \ |
| 10682 | -C "error" |
| 10683 | |
| 10684 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10685 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10686 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10687 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10688 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10689 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10690 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10691 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10692 | "$O_CLI -dtls1_2" \ |
| 10693 | 0 \ |
| 10694 | -s "fragmenting handshake message" |
| 10695 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10696 | # interop tests for DTLS fragmentating with unreliable connection |
| 10697 | # |
| 10698 | # again we just want to test that the we fragment in a way that |
| 10699 | # pleases other implementations, so we don't need the peer to fragment |
| 10700 | requires_gnutls_next |
| 10701 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10702 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10703 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10704 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10705 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10706 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10707 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10708 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10709 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10710 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10711 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10712 | 0 \ |
| 10713 | -c "fragmenting handshake message" \ |
| 10714 | -C "error" |
| 10715 | |
| 10716 | requires_gnutls_next |
| 10717 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10718 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10719 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10720 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10721 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10722 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10723 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10724 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10725 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10726 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10727 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10728 | 0 \ |
| 10729 | -s "fragmenting handshake message" |
| 10730 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10731 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10732 | ## 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] | 10733 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10734 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10735 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10736 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10737 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10738 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10739 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10740 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10741 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10742 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10743 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10744 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10745 | 0 \ |
| 10746 | -c "fragmenting handshake message" \ |
| 10747 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10748 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10749 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10750 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10751 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10753 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10754 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10755 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10756 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10757 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10758 | "$P_SRV dtls=1 debug_level=2 \ |
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 \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10761 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10762 | "$O_CLI -dtls1_2" \ |
| 10763 | 0 \ |
| 10764 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10765 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10766 | # Tests for DTLS-SRTP (RFC 5764) |
| 10767 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10769 | run_test "DTLS-SRTP all profiles supported" \ |
| 10770 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10771 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10772 | 0 \ |
| 10773 | -s "found use_srtp extension" \ |
| 10774 | -s "found srtp profile" \ |
| 10775 | -s "selected srtp profile" \ |
| 10776 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10777 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10778 | -c "client hello, adding use_srtp extension" \ |
| 10779 | -c "found use_srtp extension" \ |
| 10780 | -c "found srtp profile" \ |
| 10781 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10782 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10783 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10784 | -C "error" |
| 10785 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10786 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10787 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10789 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10790 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10791 | "$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] | 10792 | 0 \ |
| 10793 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10794 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10795 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10796 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10797 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10798 | -c "client hello, adding use_srtp extension" \ |
| 10799 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10800 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10801 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10802 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10803 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10804 | -C "error" |
| 10805 | |
| 10806 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10808 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10809 | "$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] | 10810 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10811 | 0 \ |
| 10812 | -s "found use_srtp extension" \ |
| 10813 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10814 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10815 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10816 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10817 | -c "client hello, adding use_srtp extension" \ |
| 10818 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10819 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10820 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10821 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10822 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10823 | -C "error" |
| 10824 | |
| 10825 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10827 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10828 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10829 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10830 | 0 \ |
| 10831 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10832 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10833 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10834 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10835 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10836 | -c "client hello, adding use_srtp extension" \ |
| 10837 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10838 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10839 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10840 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10841 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10842 | -C "error" |
| 10843 | |
| 10844 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10846 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10847 | "$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] | 10848 | "$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] | 10849 | 0 \ |
| 10850 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10851 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10852 | -S "selected srtp profile" \ |
| 10853 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10854 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10855 | -c "client hello, adding use_srtp extension" \ |
| 10856 | -C "found use_srtp extension" \ |
| 10857 | -C "found srtp profile" \ |
| 10858 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10859 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10860 | -C "error" |
| 10861 | |
| 10862 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10864 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10865 | "$P_SRV dtls=1 debug_level=3" \ |
| 10866 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10867 | 0 \ |
| 10868 | -s "found use_srtp extension" \ |
| 10869 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10870 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10871 | -c "client hello, adding use_srtp extension" \ |
| 10872 | -C "found use_srtp extension" \ |
| 10873 | -C "found srtp profile" \ |
| 10874 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10875 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10876 | -C "error" |
| 10877 | |
| 10878 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10880 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10881 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10882 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10883 | 0 \ |
| 10884 | -s "found use_srtp extension" \ |
| 10885 | -s "found srtp profile" \ |
| 10886 | -s "selected srtp profile" \ |
| 10887 | -s "server hello, adding use_srtp extension" \ |
| 10888 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10889 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10890 | -c "client hello, adding use_srtp extension" \ |
| 10891 | -c "found use_srtp extension" \ |
| 10892 | -c "found srtp profile" \ |
| 10893 | -c "selected srtp profile" \ |
| 10894 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10895 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10896 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10897 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10898 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10899 | -C "error" |
| 10900 | |
| 10901 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10903 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10904 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10905 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10906 | 0 \ |
| 10907 | -s "found use_srtp extension" \ |
| 10908 | -s "found srtp profile" \ |
| 10909 | -s "selected srtp profile" \ |
| 10910 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10911 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10912 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10913 | -S "dumping 'using mki' (8 bytes)" \ |
| 10914 | -c "client hello, adding use_srtp extension" \ |
| 10915 | -c "found use_srtp extension" \ |
| 10916 | -c "found srtp profile" \ |
| 10917 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10918 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10919 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10920 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10921 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10922 | -C "dumping 'received mki' (8 bytes)" \ |
| 10923 | -C "error" |
| 10924 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10925 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10927 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10928 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10929 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10930 | 0 \ |
| 10931 | -s "found use_srtp extension" \ |
| 10932 | -s "found srtp profile" \ |
| 10933 | -s "selected srtp profile" \ |
| 10934 | -s "server hello, adding use_srtp extension" \ |
| 10935 | -s "DTLS-SRTP key material is"\ |
| 10936 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10937 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10938 | |
| 10939 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10941 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10942 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10943 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10944 | 0 \ |
| 10945 | -s "found use_srtp extension" \ |
| 10946 | -s "found srtp profile" \ |
| 10947 | -s "selected srtp profile" \ |
| 10948 | -s "server hello, adding use_srtp extension" \ |
| 10949 | -s "DTLS-SRTP key material is"\ |
| 10950 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10951 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10952 | |
| 10953 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10955 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10956 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10957 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10958 | 0 \ |
| 10959 | -s "found use_srtp extension" \ |
| 10960 | -s "found srtp profile" \ |
| 10961 | -s "selected srtp profile" \ |
| 10962 | -s "server hello, adding use_srtp extension" \ |
| 10963 | -s "DTLS-SRTP key material is"\ |
| 10964 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10965 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10966 | |
| 10967 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10969 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10970 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10971 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10972 | 0 \ |
| 10973 | -s "found use_srtp extension" \ |
| 10974 | -s "found srtp profile" \ |
| 10975 | -s "selected srtp profile" \ |
| 10976 | -s "server hello, adding use_srtp extension" \ |
| 10977 | -s "DTLS-SRTP key material is"\ |
| 10978 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10979 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10980 | |
| 10981 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10983 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10984 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10985 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10986 | 0 \ |
| 10987 | -s "found use_srtp extension" \ |
| 10988 | -s "found srtp profile" \ |
| 10989 | -s "selected srtp profile" \ |
| 10990 | -s "server hello, adding use_srtp extension" \ |
| 10991 | -s "DTLS-SRTP key material is"\ |
| 10992 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10993 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10994 | |
| 10995 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10997 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10998 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10999 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11000 | 0 \ |
| 11001 | -s "found use_srtp extension" \ |
| 11002 | -s "found srtp profile" \ |
| 11003 | -S "selected srtp profile" \ |
| 11004 | -S "server hello, adding use_srtp extension" \ |
| 11005 | -S "DTLS-SRTP key material is"\ |
| 11006 | -C "SRTP Extension negotiated, profile" |
| 11007 | |
| 11008 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11010 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11011 | "$P_SRV dtls=1 debug_level=3" \ |
| 11012 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11013 | 0 \ |
| 11014 | -s "found use_srtp extension" \ |
| 11015 | -S "server hello, adding use_srtp extension" \ |
| 11016 | -S "DTLS-SRTP key material is"\ |
| 11017 | -C "SRTP Extension negotiated, profile" |
| 11018 | |
| 11019 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11021 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11022 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11023 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11024 | 0 \ |
| 11025 | -c "client hello, adding use_srtp extension" \ |
| 11026 | -c "found use_srtp extension" \ |
| 11027 | -c "found srtp profile" \ |
| 11028 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11029 | -c "DTLS-SRTP key material is"\ |
| 11030 | -C "error" |
| 11031 | |
| 11032 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11034 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11035 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11036 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11037 | 0 \ |
| 11038 | -c "client hello, adding use_srtp extension" \ |
| 11039 | -c "found use_srtp extension" \ |
| 11040 | -c "found srtp profile" \ |
| 11041 | -c "selected srtp profile" \ |
| 11042 | -c "DTLS-SRTP key material is"\ |
| 11043 | -C "error" |
| 11044 | |
| 11045 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11047 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11048 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11049 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11050 | 0 \ |
| 11051 | -c "client hello, adding use_srtp extension" \ |
| 11052 | -c "found use_srtp extension" \ |
| 11053 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11054 | -c "selected srtp profile" \ |
| 11055 | -c "DTLS-SRTP key material is"\ |
| 11056 | -C "error" |
| 11057 | |
| 11058 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11060 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11061 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11062 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11063 | 0 \ |
| 11064 | -c "client hello, adding use_srtp extension" \ |
| 11065 | -c "found use_srtp extension" \ |
| 11066 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11067 | -c "selected srtp profile" \ |
| 11068 | -c "DTLS-SRTP key material is"\ |
| 11069 | -C "error" |
| 11070 | |
| 11071 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11073 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11074 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11075 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11076 | 0 \ |
| 11077 | -c "client hello, adding use_srtp extension" \ |
| 11078 | -c "found use_srtp extension" \ |
| 11079 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11080 | -c "selected srtp profile" \ |
| 11081 | -c "DTLS-SRTP key material is"\ |
| 11082 | -C "error" |
| 11083 | |
| 11084 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11086 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11087 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11088 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11089 | 0 \ |
| 11090 | -c "client hello, adding use_srtp extension" \ |
| 11091 | -C "found use_srtp extension" \ |
| 11092 | -C "found srtp profile" \ |
| 11093 | -C "selected srtp profile" \ |
| 11094 | -C "DTLS-SRTP key material is"\ |
| 11095 | -C "error" |
| 11096 | |
| 11097 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11099 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11100 | "$O_SRV -dtls" \ |
| 11101 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11102 | 0 \ |
| 11103 | -c "client hello, adding use_srtp extension" \ |
| 11104 | -C "found use_srtp extension" \ |
| 11105 | -C "found srtp profile" \ |
| 11106 | -C "selected srtp profile" \ |
| 11107 | -C "DTLS-SRTP key material is"\ |
| 11108 | -C "error" |
| 11109 | |
| 11110 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11112 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11113 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11114 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11115 | 0 \ |
| 11116 | -c "client hello, adding use_srtp extension" \ |
| 11117 | -c "found use_srtp extension" \ |
| 11118 | -c "found srtp profile" \ |
| 11119 | -c "selected srtp profile" \ |
| 11120 | -c "DTLS-SRTP key material is"\ |
| 11121 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11122 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11123 | -C "dumping 'received mki' (8 bytes)" \ |
| 11124 | -C "error" |
| 11125 | |
| 11126 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11127 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11129 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11130 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11131 | "$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] | 11132 | 0 \ |
| 11133 | -s "found use_srtp extension" \ |
| 11134 | -s "found srtp profile" \ |
| 11135 | -s "selected srtp profile" \ |
| 11136 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11137 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11138 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11139 | |
| 11140 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11141 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11143 | 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] | 11144 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11145 | "$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] | 11146 | 0 \ |
| 11147 | -s "found use_srtp extension" \ |
| 11148 | -s "found srtp profile" \ |
| 11149 | -s "selected srtp profile" \ |
| 11150 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11151 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11152 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11153 | |
| 11154 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11155 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11157 | 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] | 11158 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11159 | "$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] | 11160 | 0 \ |
| 11161 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11162 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11163 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11164 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11165 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11166 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11167 | |
| 11168 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11169 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11171 | 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] | 11172 | "$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] | 11173 | "$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] | 11174 | 0 \ |
| 11175 | -s "found use_srtp extension" \ |
| 11176 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11177 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11178 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11179 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11180 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11181 | |
| 11182 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11183 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11185 | 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] | 11186 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11187 | "$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] | 11188 | 0 \ |
| 11189 | -s "found use_srtp extension" \ |
| 11190 | -s "found srtp profile" \ |
| 11191 | -s "selected srtp profile" \ |
| 11192 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11193 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11194 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11195 | |
| 11196 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11197 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11199 | 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] | 11200 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11201 | "$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] | 11202 | 0 \ |
| 11203 | -s "found use_srtp extension" \ |
| 11204 | -s "found srtp profile" \ |
| 11205 | -S "selected srtp profile" \ |
| 11206 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11207 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11208 | -C "SRTP profile:" |
| 11209 | |
| 11210 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11211 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11213 | 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] | 11214 | "$P_SRV dtls=1 debug_level=3" \ |
| 11215 | "$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] | 11216 | 0 \ |
| 11217 | -s "found use_srtp extension" \ |
| 11218 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11219 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11220 | -C "SRTP profile:" |
| 11221 | |
| 11222 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11223 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11225 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11226 | "$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" \ |
| 11227 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11228 | 0 \ |
| 11229 | -c "client hello, adding use_srtp extension" \ |
| 11230 | -c "found use_srtp extension" \ |
| 11231 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11232 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11233 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11234 | -C "error" |
| 11235 | |
| 11236 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11237 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11239 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11240 | "$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" \ |
| 11241 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11242 | 0 \ |
| 11243 | -c "client hello, adding use_srtp extension" \ |
| 11244 | -c "found use_srtp extension" \ |
| 11245 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11246 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11247 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11248 | -C "error" |
| 11249 | |
| 11250 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11251 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11253 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11254 | "$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" \ |
| 11255 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11256 | 0 \ |
| 11257 | -c "client hello, adding use_srtp extension" \ |
| 11258 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11259 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11260 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11261 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11262 | -C "error" |
| 11263 | |
| 11264 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11265 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11267 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11268 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11269 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11270 | 0 \ |
| 11271 | -c "client hello, adding use_srtp extension" \ |
| 11272 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11273 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11274 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11275 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11276 | -C "error" |
| 11277 | |
| 11278 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11279 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11281 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11282 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11283 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11284 | 0 \ |
| 11285 | -c "client hello, adding use_srtp extension" \ |
| 11286 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11287 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11288 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11289 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11290 | -C "error" |
| 11291 | |
| 11292 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11293 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11295 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11296 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11297 | "$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] | 11298 | 0 \ |
| 11299 | -c "client hello, adding use_srtp extension" \ |
| 11300 | -C "found use_srtp extension" \ |
| 11301 | -C "found srtp profile" \ |
| 11302 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11303 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11304 | -C "error" |
| 11305 | |
| 11306 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11307 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11309 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11310 | "$G_SRV -u" \ |
| 11311 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11312 | 0 \ |
| 11313 | -c "client hello, adding use_srtp extension" \ |
| 11314 | -C "found use_srtp extension" \ |
| 11315 | -C "found srtp profile" \ |
| 11316 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11317 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11318 | -C "error" |
| 11319 | |
| 11320 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11321 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11323 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11324 | "$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" \ |
| 11325 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11326 | 0 \ |
| 11327 | -c "client hello, adding use_srtp extension" \ |
| 11328 | -c "found use_srtp extension" \ |
| 11329 | -c "found srtp profile" \ |
| 11330 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11331 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11332 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11333 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11334 | -c "dumping 'received mki' (8 bytes)" \ |
| 11335 | -C "error" |
| 11336 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11337 | # Tests for specific things with "unreliable" UDP connection |
| 11338 | |
| 11339 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11341 | run_test "DTLS proxy: reference" \ |
| 11342 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11343 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11344 | "$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] | 11345 | 0 \ |
| 11346 | -C "replayed record" \ |
| 11347 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11348 | -C "Buffer record from epoch" \ |
| 11349 | -S "Buffer record from epoch" \ |
| 11350 | -C "ssl_buffer_message" \ |
| 11351 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11352 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11353 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11354 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11355 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11356 | -c "HTTP/1.0 200 OK" |
| 11357 | |
| 11358 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11360 | run_test "DTLS proxy: duplicate every packet" \ |
| 11361 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11362 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11363 | "$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] | 11364 | 0 \ |
| 11365 | -c "replayed record" \ |
| 11366 | -s "replayed record" \ |
| 11367 | -c "record from another epoch" \ |
| 11368 | -s "record from another epoch" \ |
| 11369 | -S "resend" \ |
| 11370 | -s "Extra-header:" \ |
| 11371 | -c "HTTP/1.0 200 OK" |
| 11372 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11374 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11375 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11376 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11377 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11378 | 0 \ |
| 11379 | -c "replayed record" \ |
| 11380 | -S "replayed record" \ |
| 11381 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11382 | -s "record from another epoch" \ |
| 11383 | -c "resend" \ |
| 11384 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11385 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11386 | -c "HTTP/1.0 200 OK" |
| 11387 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11389 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11390 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11391 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11392 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11393 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11394 | -c "next record in same datagram" \ |
| 11395 | -s "next record in same datagram" |
| 11396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11398 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 11399 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11400 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11401 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11402 | 0 \ |
| 11403 | -c "next record in same datagram" \ |
| 11404 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11407 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 11408 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11409 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 11410 | "$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] | 11411 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11412 | -c "discarding invalid record (mac)" \ |
| 11413 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11414 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11415 | -c "HTTP/1.0 200 OK" \ |
| 11416 | -S "too many records with bad MAC" \ |
| 11417 | -S "Verification of the message MAC failed" |
| 11418 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11420 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 11421 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11422 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 11423 | "$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] | 11424 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11425 | -C "discarding invalid record (mac)" \ |
| 11426 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11427 | -S "Extra-header:" \ |
| 11428 | -C "HTTP/1.0 200 OK" \ |
| 11429 | -s "too many records with bad MAC" \ |
| 11430 | -s "Verification of the message MAC failed" |
| 11431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11433 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 11434 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11435 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 11436 | "$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] | 11437 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11438 | -c "discarding invalid record (mac)" \ |
| 11439 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11440 | -s "Extra-header:" \ |
| 11441 | -c "HTTP/1.0 200 OK" \ |
| 11442 | -S "too many records with bad MAC" \ |
| 11443 | -S "Verification of the message MAC failed" |
| 11444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11446 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 11447 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11448 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 11449 | "$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] | 11450 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11451 | -c "discarding invalid record (mac)" \ |
| 11452 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11453 | -s "Extra-header:" \ |
| 11454 | -c "HTTP/1.0 200 OK" \ |
| 11455 | -s "too many records with bad MAC" \ |
| 11456 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11459 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11460 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11461 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11462 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11463 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11464 | -c "record from another epoch" \ |
| 11465 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11466 | -s "Extra-header:" \ |
| 11467 | -c "HTTP/1.0 200 OK" |
| 11468 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11469 | # Tests for reordering support with DTLS |
| 11470 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11471 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11473 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11474 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11475 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11476 | hs_timeout=2500-60000" \ |
| 11477 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11478 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11479 | 0 \ |
| 11480 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11481 | -c "Next handshake message has been buffered - load"\ |
| 11482 | -S "Buffering HS message" \ |
| 11483 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11484 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11485 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11486 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11487 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11488 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11489 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11491 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 11492 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11493 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11494 | hs_timeout=2500-60000" \ |
| 11495 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11496 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11497 | 0 \ |
| 11498 | -c "Buffering HS message" \ |
| 11499 | -c "found fragmented DTLS handshake message"\ |
| 11500 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 11501 | -c "Next handshake message has been buffered - load"\ |
| 11502 | -S "Buffering HS message" \ |
| 11503 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11504 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 11505 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11506 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11507 | -S "Remember CCS message" |
| 11508 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11509 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 11510 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 11511 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 11512 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11513 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11514 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11516 | 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] | 11517 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11518 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11519 | hs_timeout=2500-60000" \ |
| 11520 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11521 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11522 | 0 \ |
| 11523 | -c "Buffering HS message" \ |
| 11524 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11525 | -C "attempt to make space by freeing buffered messages" \ |
| 11526 | -S "Buffering HS message" \ |
| 11527 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11528 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11529 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11530 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11531 | -S "Remember CCS message" |
| 11532 | |
| 11533 | # The size constraints ensure that the delayed certificate message can't |
| 11534 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 11535 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11536 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11537 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 11538 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11540 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 11541 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11542 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11543 | hs_timeout=2500-60000" \ |
| 11544 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11545 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11546 | 0 \ |
| 11547 | -c "Buffering HS message" \ |
| 11548 | -c "attempt to make space by freeing buffered future messages" \ |
| 11549 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11550 | -S "Buffering HS message" \ |
| 11551 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11552 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11553 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11554 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 11555 | -S "Remember CCS message" |
| 11556 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11557 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11559 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 11560 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11561 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 11562 | hs_timeout=2500-60000" \ |
| 11563 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11564 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11565 | 0 \ |
| 11566 | -C "Buffering HS message" \ |
| 11567 | -C "Next handshake message has been buffered - load"\ |
| 11568 | -s "Buffering HS message" \ |
| 11569 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11570 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11571 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11572 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11573 | -S "Remember CCS message" |
| 11574 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11575 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11577 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11578 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 11579 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11580 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11581 | hs_timeout=2500-60000" \ |
| 11582 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11583 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11584 | 0 \ |
| 11585 | -C "Buffering HS message" \ |
| 11586 | -C "Next handshake message has been buffered - load"\ |
| 11587 | -S "Buffering HS message" \ |
| 11588 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11589 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11590 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11591 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11592 | -S "Remember CCS message" |
| 11593 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11594 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11596 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 11597 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11598 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11599 | hs_timeout=2500-60000" \ |
| 11600 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11601 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11602 | 0 \ |
| 11603 | -C "Buffering HS message" \ |
| 11604 | -C "Next handshake message has been buffered - load"\ |
| 11605 | -S "Buffering HS message" \ |
| 11606 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11607 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11608 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11609 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11610 | -s "Remember CCS message" |
| 11611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11613 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11614 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11615 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11616 | hs_timeout=2500-60000" \ |
| 11617 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11618 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11619 | 0 \ |
| 11620 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11621 | -s "Found buffered record from current epoch - load" \ |
| 11622 | -c "Buffer record from epoch 1" \ |
| 11623 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11624 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11625 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11626 | # from the server are delayed, so that the encrypted Finished message |
| 11627 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11628 | # in afterwards, the encrypted Finished message must be freed in order |
| 11629 | # to make space for the NewSessionTicket to be reassembled. |
| 11630 | # This works only in very particular circumstances: |
| 11631 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11632 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11633 | # the encrypted Finished message. |
| 11634 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11635 | # needs to be fragmented. |
| 11636 | # - All messages sent by the server must be small enough to be either sent |
| 11637 | # without fragmentation or be reassembled within the bounds of |
| 11638 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11639 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11640 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11641 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11642 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11643 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11644 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 11645 | "$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] | 11646 | 0 \ |
| 11647 | -s "Buffer record from epoch 1" \ |
| 11648 | -s "Found buffered record from current epoch - load" \ |
| 11649 | -c "Buffer record from epoch 1" \ |
| 11650 | -C "Found buffered record from current epoch - load" \ |
| 11651 | -c "Enough space available after freeing future epoch record" |
| 11652 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11653 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11654 | |
| 11655 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11656 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11657 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 78df617 | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 11658 | "$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] | 11659 | psk=73776f726466697368" \ |
| 11660 | "$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] | 11661 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11662 | 0 \ |
| 11663 | -s "Extra-header:" \ |
| 11664 | -c "HTTP/1.0 200 OK" |
| 11665 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11666 | client_needs_more_time 2 |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 11667 | run_test "DTLS proxy: 3d, \"short\" ECDHE-RSA handshake" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11668 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11669 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11670 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Gabor Mezei | fc42c22 | 2025-02-05 17:28:03 +0100 | [diff] [blame] | 11671 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11672 | 0 \ |
| 11673 | -s "Extra-header:" \ |
| 11674 | -c "HTTP/1.0 200 OK" |
| 11675 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11676 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11678 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11679 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11680 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11681 | "$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] | 11682 | 0 \ |
| 11683 | -s "Extra-header:" \ |
| 11684 | -c "HTTP/1.0 200 OK" |
| 11685 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11686 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11688 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11689 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11690 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11691 | "$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] | 11692 | 0 \ |
| 11693 | -s "Extra-header:" \ |
| 11694 | -c "HTTP/1.0 200 OK" |
| 11695 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11696 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11698 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11699 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11700 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11701 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11702 | "$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] | 11703 | 0 \ |
| 11704 | -s "Extra-header:" \ |
| 11705 | -c "HTTP/1.0 200 OK" |
| 11706 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11707 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11709 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11710 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11711 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11712 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11713 | "$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] | 11714 | 0 \ |
| 11715 | -s "Extra-header:" \ |
| 11716 | -c "HTTP/1.0 200 OK" |
| 11717 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11718 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | 4f1c927 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 11720 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11721 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11722 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11723 | "$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] | 11724 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11725 | "$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] | 11726 | 0 \ |
| 11727 | -s "Extra-header:" \ |
| 11728 | -c "HTTP/1.0 200 OK" |
| 11729 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11730 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11731 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11732 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11733 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11734 | "$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] | 11735 | psk=73776f726466697368 debug_level=3" \ |
| 11736 | "$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] | 11737 | 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] | 11738 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11739 | 0 \ |
| 11740 | -s "a session has been resumed" \ |
| 11741 | -c "a session has been resumed" \ |
| 11742 | -s "Extra-header:" \ |
| 11743 | -c "HTTP/1.0 200 OK" |
| 11744 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11745 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11746 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11747 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11748 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11749 | "$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] | 11750 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 11751 | "$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] | 11752 | 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] | 11753 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11754 | 0 \ |
| 11755 | -s "a session has been resumed" \ |
| 11756 | -c "a session has been resumed" \ |
| 11757 | -s "Extra-header:" \ |
| 11758 | -c "HTTP/1.0 200 OK" |
| 11759 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11760 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11762 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11763 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11764 | "$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] | 11765 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 11766 | "$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] | 11767 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11768 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11769 | 0 \ |
| 11770 | -c "=> renegotiate" \ |
| 11771 | -s "=> renegotiate" \ |
| 11772 | -s "Extra-header:" \ |
| 11773 | -c "HTTP/1.0 200 OK" |
| 11774 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11775 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11777 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11778 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11779 | "$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] | 11780 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 11781 | "$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] | 11782 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11783 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11784 | 0 \ |
| 11785 | -c "=> renegotiate" \ |
| 11786 | -s "=> renegotiate" \ |
| 11787 | -s "Extra-header:" \ |
| 11788 | -c "HTTP/1.0 200 OK" |
| 11789 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11790 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11791 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11792 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11793 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11794 | "$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] | 11795 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11796 | debug_level=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11797 | "$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] | 11798 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11799 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11800 | 0 \ |
| 11801 | -c "=> renegotiate" \ |
| 11802 | -s "=> renegotiate" \ |
| 11803 | -s "Extra-header:" \ |
| 11804 | -c "HTTP/1.0 200 OK" |
| 11805 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11806 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11807 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11808 | 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] | 11809 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11810 | "$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] | 11811 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11812 | debug_level=2 nbio=2" \ |
Gilles Peskine | 77c13e6 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 11813 | "$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] | 11814 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11815 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11816 | 0 \ |
| 11817 | -c "=> renegotiate" \ |
| 11818 | -s "=> renegotiate" \ |
| 11819 | -s "Extra-header:" \ |
| 11820 | -c "HTTP/1.0 200 OK" |
| 11821 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11822 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11823 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11824 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11825 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11826 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11827 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11829 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11830 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 11831 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 11832 | "$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] | 11833 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11834 | -c "HTTP/1.0 200 OK" |
| 11835 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11836 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11837 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11838 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11840 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11841 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11842 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11843 | "$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] | 11844 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11845 | -c "HTTP/1.0 200 OK" |
| 11846 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11847 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11848 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11849 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11851 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11852 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11853 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11854 | "$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] | 11855 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11856 | -c "HTTP/1.0 200 OK" |
| 11857 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11858 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11859 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11860 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11862 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11863 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11864 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11865 | "$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] | 11866 | 0 \ |
| 11867 | -s "Extra-header:" \ |
| 11868 | -c "Extra-header:" |
| 11869 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11870 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11871 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11872 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11874 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11875 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11876 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11877 | "$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] | 11878 | 0 \ |
| 11879 | -s "Extra-header:" \ |
| 11880 | -c "Extra-header:" |
| 11881 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11882 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11883 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11884 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11886 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11887 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11888 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11889 | "$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] | 11890 | 0 \ |
| 11891 | -s "Extra-header:" \ |
| 11892 | -c "Extra-header:" |
| 11893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11895 | run_test "export keys functionality" \ |
| 11896 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 11897 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11898 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11899 | -c "EAP-TLS key material is:"\ |
| 11900 | -s "EAP-TLS key material is:"\ |
| 11901 | -c "EAP-TLS IV is:" \ |
| 11902 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11903 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11904 | # openssl feature tests: check if tls1.3 exists. |
| 11905 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11906 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11907 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11908 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11909 | 0 \ |
| 11910 | -c "TLS 1.3" \ |
| 11911 | -s "TLS 1.3" |
| 11912 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11913 | # 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] | 11914 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11915 | requires_gnutls_next_no_ticket |
| 11916 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11917 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11918 | "$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] | 11919 | "$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] | 11920 | 0 \ |
| 11921 | -s "Version: TLS1.3" \ |
| 11922 | -c "Version: TLS1.3" |
| 11923 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11924 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11926 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11927 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 11928 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 11929 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11930 | run_test "TLS 1.3: Default" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11931 | "$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] | 11932 | "$P_CLI allow_sha1=0" \ |
| 11933 | 0 \ |
| 11934 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11935 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11936 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11937 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 11938 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 11939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 11940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11941 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 11942 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 11943 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 11944 | "$P_SRV" \ |
| 11945 | "( $P_CLI force_version=tls12; \ |
| 11946 | $P_CLI force_version=tls13 )" \ |
| 11947 | 0 \ |
| 11948 | -s "Protocol is TLSv1.2" \ |
| 11949 | -s "Protocol is TLSv1.3" \ |
| 11950 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 11951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 11952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11953 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 11954 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 11955 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 11956 | "$P_SRV" \ |
| 11957 | "( $P_CLI force_version=tls13; \ |
| 11958 | $P_CLI force_version=tls12 )" \ |
| 11959 | 0 \ |
| 11960 | -s "Protocol is TLSv1.3" \ |
| 11961 | -s "Protocol is TLSv1.2" \ |
| 11962 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11963 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11964 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11965 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 11966 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11967 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11968 | "$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] | 11969 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11970 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11971 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11972 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11973 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11974 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11975 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11976 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11977 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11978 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11979 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11980 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11981 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11982 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11983 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11984 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11985 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11986 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11987 | -c "=> parse certificate verify" \ |
| 11988 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11989 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11990 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11991 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11992 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11993 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11994 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11995 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11996 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11997 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 11998 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11999 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12000 | "$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] | 12001 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12002 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12003 | -s "SERVER HELLO was queued" \ |
| 12004 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12005 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12006 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12007 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12008 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12009 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12010 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12011 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12012 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12013 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12014 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12015 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12016 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12017 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12018 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12019 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12020 | -c "=> parse certificate verify" \ |
| 12021 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12022 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12023 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12024 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12025 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12026 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12027 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12028 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12029 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12030 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12031 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12032 | run_test "TLS 1.3: alpn - openssl" \ |
| 12033 | "$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] | 12034 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12035 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12036 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12037 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12038 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12039 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12040 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12041 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12042 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12043 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12044 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12045 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12046 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12047 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12048 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12049 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12050 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12051 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12052 | -c "=> parse certificate verify" \ |
| 12053 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12054 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12055 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12056 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12057 | -c "HTTP/1.0 200 ok" \ |
| 12058 | -c "Application Layer Protocol is h2" |
| 12059 | |
| 12060 | requires_gnutls_tls1_3 |
| 12061 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12062 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12063 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12064 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12065 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12066 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12067 | "$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] | 12068 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12069 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12070 | -s "SERVER HELLO was queued" \ |
| 12071 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12072 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12073 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12074 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12075 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12076 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12077 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12078 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12079 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12080 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12081 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12082 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12083 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12084 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12085 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12086 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12087 | -c "=> parse certificate verify" \ |
| 12088 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12089 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12090 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12091 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12092 | -c "HTTP/1.0 200 OK" \ |
| 12093 | -c "Application Layer Protocol is h2" |
| 12094 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12095 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12096 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12097 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12098 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12099 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12100 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12101 | "$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] | 12102 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12103 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12104 | -s "found alpn extension" \ |
| 12105 | -s "server side, adding alpn extension" \ |
| 12106 | -s "Protocol is TLSv1.3" \ |
| 12107 | -s "HTTP/1.0 200 OK" \ |
| 12108 | -s "Application Layer Protocol is h2" |
| 12109 | |
| 12110 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12111 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12112 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12113 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12114 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12115 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12116 | "$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] | 12117 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12118 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12119 | -s "found alpn extension" \ |
| 12120 | -s "server side, adding alpn extension" \ |
| 12121 | -s "Protocol is TLSv1.3" \ |
| 12122 | -s "HTTP/1.0 200 OK" \ |
| 12123 | -s "Application Layer Protocol is h2" |
| 12124 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12125 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12127 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12128 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12129 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12130 | "$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] | 12131 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12132 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12133 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12134 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12135 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12136 | -c "HTTP/1.0 200 ok" \ |
| 12137 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12138 | |
| 12139 | requires_gnutls_tls1_3 |
| 12140 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12141 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12142 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12143 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12144 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12145 | "$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] | 12146 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12147 | 0 \ |
| 12148 | -c "got a certificate request" \ |
| 12149 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12150 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12151 | -c "HTTP/1.0 200 OK" \ |
| 12152 | -c "Protocol is TLSv1.3" |
| 12153 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12154 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12155 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12156 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12158 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12159 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12160 | "$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] | 12161 | "$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] | 12162 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12163 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12164 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12165 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12166 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12167 | |
| 12168 | requires_gnutls_tls1_3 |
| 12169 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12170 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12171 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12172 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12173 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12174 | "$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] | 12175 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12176 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12177 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12178 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12179 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12180 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12181 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12182 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12183 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12184 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12185 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12186 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12187 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12188 | "$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] | 12189 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12190 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12191 | 0 \ |
| 12192 | -c "got a certificate request" \ |
| 12193 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12194 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12195 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12196 | |
| 12197 | requires_gnutls_tls1_3 |
| 12198 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12199 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12200 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12202 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12203 | "$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] | 12204 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12205 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12206 | 0 \ |
| 12207 | -c "got a certificate request" \ |
| 12208 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12209 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12210 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12211 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12212 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12214 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12215 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12216 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12217 | "$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] | 12218 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12219 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12220 | 0 \ |
| 12221 | -c "got a certificate request" \ |
| 12222 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12223 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12224 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12225 | |
| 12226 | requires_gnutls_tls1_3 |
| 12227 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12228 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12229 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12230 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12231 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12232 | "$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] | 12233 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12234 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12235 | 0 \ |
| 12236 | -c "got a certificate request" \ |
| 12237 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12238 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12239 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12240 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12241 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12242 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12243 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12245 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12246 | "$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] | 12247 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12248 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12249 | 0 \ |
| 12250 | -c "got a certificate request" \ |
| 12251 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12252 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12253 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12254 | |
| 12255 | requires_gnutls_tls1_3 |
| 12256 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12257 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12258 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12259 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12260 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12261 | "$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] | 12262 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12263 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12264 | 0 \ |
| 12265 | -c "got a certificate request" \ |
| 12266 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12267 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12268 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12269 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12270 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12271 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12272 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12273 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12274 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12275 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12276 | "$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] | 12277 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12278 | 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] | 12279 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12280 | -c "got a certificate request" \ |
| 12281 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12282 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12283 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12284 | |
| 12285 | requires_gnutls_tls1_3 |
| 12286 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12287 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12288 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12289 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12290 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12291 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12292 | "$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] | 12293 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12294 | 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] | 12295 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12296 | -c "got a certificate request" \ |
| 12297 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12298 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12299 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12300 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12301 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12302 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12303 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12304 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12306 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12307 | "$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] | 12308 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12309 | 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] | 12310 | 0 \ |
| 12311 | -c "got a certificate request" \ |
| 12312 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12313 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12314 | -c "Protocol is TLSv1.3" |
| 12315 | |
| 12316 | requires_gnutls_tls1_3 |
| 12317 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12320 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12321 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12322 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12323 | "$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] | 12324 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12325 | 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] | 12326 | 0 \ |
| 12327 | -c "got a certificate request" \ |
| 12328 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12329 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12330 | -c "Protocol is TLSv1.3" |
| 12331 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12332 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12333 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12334 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12335 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12336 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12337 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12338 | "$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] | 12339 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12340 | 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] | 12341 | 0 \ |
| 12342 | -c "got a certificate request" \ |
| 12343 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12344 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12345 | -c "Protocol is TLSv1.3" |
| 12346 | |
| 12347 | requires_gnutls_tls1_3 |
| 12348 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12349 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12350 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12351 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12352 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12353 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12354 | "$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] | 12355 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12356 | 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] | 12357 | 0 \ |
| 12358 | -c "got a certificate request" \ |
| 12359 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12360 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12361 | -c "Protocol is TLSv1.3" |
| 12362 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12363 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12364 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12365 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12366 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12367 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12368 | 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] | 12369 | "$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] | 12370 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12371 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12372 | 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] | 12373 | 1 \ |
| 12374 | -c "got a certificate request" \ |
| 12375 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12376 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12377 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12378 | |
| 12379 | requires_gnutls_tls1_3 |
| 12380 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12381 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12382 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12383 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12384 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12385 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12386 | "$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] | 12387 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12388 | 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] | 12389 | 1 \ |
| 12390 | -c "got a certificate request" \ |
| 12391 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12392 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12393 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12394 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12395 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12396 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12397 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12398 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12399 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12400 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 12401 | "$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] | 12402 | "$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] | 12403 | 0 \ |
| 12404 | -c "got a certificate request" \ |
| 12405 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12406 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12407 | -c "Protocol is TLSv1.3" |
| 12408 | |
| 12409 | requires_gnutls_tls1_3 |
| 12410 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12411 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12412 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12413 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12414 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12415 | "$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] | 12416 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12417 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12418 | 0 \ |
| 12419 | -c "got a certificate request" \ |
| 12420 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12421 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12422 | -c "Protocol is TLSv1.3" |
| 12423 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12424 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12425 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12426 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12427 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12428 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12429 | "$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] | 12430 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12431 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12432 | 0 \ |
| 12433 | -c "got a certificate request" \ |
| 12434 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12435 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12436 | -c "Protocol is TLSv1.3" |
| 12437 | |
| 12438 | requires_gnutls_tls1_3 |
| 12439 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12440 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12441 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12442 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12443 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12444 | "$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] | 12445 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12446 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12447 | 0 \ |
| 12448 | -c "got a certificate request" \ |
| 12449 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12450 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12451 | -c "Protocol is TLSv1.3" |
| 12452 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12453 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12454 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12455 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12456 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12457 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12458 | "$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] | 12459 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12460 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12461 | 0 \ |
| 12462 | -c "got a certificate request" \ |
| 12463 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12464 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12465 | -c "Protocol is TLSv1.3" |
| 12466 | |
| 12467 | requires_gnutls_tls1_3 |
| 12468 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12469 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12470 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12471 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12472 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 12473 | "$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] | 12474 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12475 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12476 | 0 \ |
| 12477 | -c "got a certificate request" \ |
| 12478 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12479 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12480 | -c "Protocol is TLSv1.3" |
| 12481 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12482 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12483 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12484 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12485 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12486 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 12487 | "$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] | 12488 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12489 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12490 | 0 \ |
| 12491 | -c "got a certificate request" \ |
| 12492 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12493 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12494 | -c "Protocol is TLSv1.3" |
| 12495 | |
| 12496 | requires_gnutls_tls1_3 |
| 12497 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12498 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12499 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12500 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12501 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 12502 | "$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] | 12503 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12504 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12505 | 0 \ |
| 12506 | -c "got a certificate request" \ |
| 12507 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12508 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12509 | -c "Protocol is TLSv1.3" |
| 12510 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12511 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12512 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12513 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12514 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12515 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12516 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12517 | "$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] | 12518 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12519 | 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] | 12520 | 0 \ |
| 12521 | -c "got a certificate request" \ |
| 12522 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12523 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12524 | -c "Protocol is TLSv1.3" |
| 12525 | |
| 12526 | requires_gnutls_tls1_3 |
| 12527 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12528 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12529 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12530 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12531 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12532 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12533 | "$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] | 12534 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12535 | 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] | 12536 | 0 \ |
| 12537 | -c "got a certificate request" \ |
| 12538 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12539 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12540 | -c "Protocol is TLSv1.3" |
| 12541 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12542 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12543 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12544 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12545 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12546 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12547 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12548 | "$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] | 12549 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12550 | 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] | 12551 | 0 \ |
| 12552 | -c "got a certificate request" \ |
| 12553 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12554 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12555 | -c "Protocol is TLSv1.3" |
| 12556 | |
| 12557 | requires_gnutls_tls1_3 |
| 12558 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12559 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12560 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12561 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12562 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12563 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12564 | "$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] | 12565 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12566 | 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] | 12567 | 0 \ |
| 12568 | -c "got a certificate request" \ |
| 12569 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12570 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12571 | -c "Protocol is TLSv1.3" |
| 12572 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12573 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12574 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12575 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12576 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12577 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12578 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12579 | "$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] | 12580 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12581 | 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] | 12582 | 0 \ |
| 12583 | -c "got a certificate request" \ |
| 12584 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12585 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12586 | -c "Protocol is TLSv1.3" |
| 12587 | |
| 12588 | requires_gnutls_tls1_3 |
| 12589 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12590 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12591 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12592 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12593 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12594 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12595 | "$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] | 12596 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12597 | 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] | 12598 | 0 \ |
| 12599 | -c "got a certificate request" \ |
| 12600 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12601 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12602 | -c "Protocol is TLSv1.3" |
| 12603 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12604 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12605 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12606 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12607 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12608 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12609 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12610 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12611 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12612 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12613 | 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] | 12614 | 1 \ |
| 12615 | -c "got a certificate request" \ |
| 12616 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12617 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12618 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12619 | |
| 12620 | requires_gnutls_tls1_3 |
| 12621 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12622 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12623 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12624 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12625 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12626 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12627 | "$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] | 12628 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12629 | 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] | 12630 | 1 \ |
| 12631 | -c "got a certificate request" \ |
| 12632 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12633 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12634 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12635 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12636 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12637 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12638 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12639 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12640 | 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] | 12641 | "$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] | 12642 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12643 | 0 \ |
| 12644 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12645 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12646 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12647 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12648 | -c "HTTP/1.0 200 ok" |
| 12649 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12650 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12651 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12652 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12653 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12654 | 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] | 12655 | "$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] | 12656 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12657 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12658 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12659 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12660 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12661 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12662 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12663 | |
| 12664 | requires_gnutls_tls1_3 |
| 12665 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12666 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12667 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12668 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12669 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12670 | 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] | 12671 | "$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] | 12672 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12673 | 0 \ |
| 12674 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12675 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12676 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12677 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12678 | -c "HTTP/1.0 200 OK" |
| 12679 | |
| 12680 | requires_gnutls_tls1_3 |
| 12681 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12682 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12683 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12684 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12685 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12686 | 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] | 12687 | "$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] | 12688 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12689 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12690 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12691 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12692 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12693 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12694 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12695 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12696 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12697 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12698 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12699 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12700 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12701 | "$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] | 12702 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12703 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12704 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12705 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12706 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12707 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12708 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12709 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12710 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12711 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12712 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12713 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12714 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12715 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12716 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12717 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12718 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 12719 | "$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] | 12720 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12721 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12722 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12723 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12724 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12725 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12726 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12727 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12728 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12729 | -s "=> parse client hello" \ |
| 12730 | -s "<= parse client hello" |
| 12731 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12732 | requires_gnutls_tls1_3 |
| 12733 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12734 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12735 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12736 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12737 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12738 | "$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] | 12739 | "$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] | 12740 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12741 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12742 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12743 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12744 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12745 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12746 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12747 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12748 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12749 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12750 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12751 | requires_gnutls_tls1_3 |
| 12752 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12753 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12754 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12755 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12756 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12757 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 12758 | "$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] | 12759 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12760 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12761 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12762 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12763 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12764 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12765 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12766 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12767 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12768 | -s "=> parse client hello" \ |
| 12769 | -s "<= parse client hello" |
| 12770 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12771 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12773 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12774 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12775 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12776 | "$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] | 12777 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12778 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12779 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12780 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12781 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12782 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12783 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12784 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12785 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12786 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12787 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12788 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12789 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12790 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12791 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12792 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12793 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12794 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12795 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 12796 | "$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] | 12797 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12798 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12799 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12800 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12801 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12802 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12803 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12804 | -s "=> parse client hello" \ |
| 12805 | -s "<= parse client hello" |
| 12806 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12807 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12808 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12809 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12810 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12811 | 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] | 12812 | "$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] | 12813 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12814 | 1 \ |
| 12815 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12816 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12817 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12818 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12819 | -s "=> write certificate request" \ |
| 12820 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12821 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12822 | -s "=> parse client hello" \ |
| 12823 | -s "<= parse client hello" |
| 12824 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12825 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12826 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12828 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12829 | 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] | 12830 | "$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] | 12831 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12832 | 0 \ |
| 12833 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12834 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12835 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12836 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12837 | -s "=> write certificate request" \ |
| 12838 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12839 | -s "=> parse client hello" \ |
| 12840 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12841 | |
| 12842 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12843 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12844 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12845 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12846 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12847 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12848 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 12849 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12850 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12851 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12852 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12853 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12854 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12855 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12856 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12857 | -s "=> write hello retry request" \ |
| 12858 | -s "<= write hello retry request" |
| 12859 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12860 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12861 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12862 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12863 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12864 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12865 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12866 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12867 | 1 \ |
| 12868 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12869 | -s "No certificate available." |
| 12870 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12871 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12872 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12873 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12874 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12875 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12876 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 12877 | 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,-,-,-" \ |
| 12878 | "$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] | 12879 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12880 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12881 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12882 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12883 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12884 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12885 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12886 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12887 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12888 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 12889 | 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,-,-,-" \ |
| 12890 | "$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] | 12891 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12892 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12893 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12894 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12895 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12896 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12897 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12898 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12899 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12900 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 12901 | 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,-,-,-" \ |
| 12902 | "$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] | 12903 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12904 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12905 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12906 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12907 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12908 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12909 | TEST_SUITE_NAME=${i##*/} |
| 12910 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12911 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12912 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12913 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12914 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12915 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12916 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12917 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12918 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12919 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12921 | 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] | 12922 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12923 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12924 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12925 | -s "Protocol is TLSv1.3" \ |
| 12926 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12927 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12928 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12929 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12930 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12931 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12932 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12934 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12935 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12936 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12937 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12938 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12939 | -s "Protocol is TLSv1.3" \ |
| 12940 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12941 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12942 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12943 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12944 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12945 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12946 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12947 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12948 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12949 | 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] | 12950 | "$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] | 12951 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12952 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12953 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12954 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12955 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12956 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12957 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12958 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12959 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12960 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12961 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12962 | 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] | 12963 | "$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] | 12964 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 12965 | 0 \ |
| 12966 | -c "Protocol is TLSv1.3" \ |
| 12967 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12968 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12969 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12970 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12971 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12972 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12973 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12974 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12975 | "$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] | 12976 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12977 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12978 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12979 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12980 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12981 | requires_gnutls_tls1_3 |
| 12982 | requires_gnutls_next_no_ticket |
| 12983 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12984 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12985 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12986 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12987 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12988 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12989 | "$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] | 12990 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12991 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12992 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12993 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12994 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12995 | |
| 12996 | requires_gnutls_tls1_3 |
| 12997 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12998 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12999 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13000 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13001 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13002 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13003 | "$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] | 13004 | "$P_CLI debug_level=4" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13005 | 0 \ |
| 13006 | -c "Protocol is TLSv1.3" \ |
| 13007 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13008 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13009 | requires_gnutls_tls1_3 |
| 13010 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13011 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13012 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13013 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13015 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13016 | "$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] | 13017 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13018 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13019 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13020 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13021 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13022 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13023 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13024 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13025 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13026 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13027 | 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] | 13028 | "$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] | 13029 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13030 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13031 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13032 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13033 | -C "14 03 03 00 01" |
| 13034 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13035 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13036 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13037 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13038 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13039 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13040 | 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] | 13041 | "$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] | 13042 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13043 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13044 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13045 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13046 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13047 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13049 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13050 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13051 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13052 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13053 | "$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] | 13054 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13055 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13056 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13057 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13058 | -c "14 03 03 00 01" |
| 13059 | |
| 13060 | requires_gnutls_tls1_3 |
| 13061 | requires_gnutls_next_no_ticket |
| 13062 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13063 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13065 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13067 | 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] | 13068 | "$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] | 13069 | "$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] | 13070 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13071 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13072 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13073 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13074 | |
| 13075 | requires_gnutls_tls1_3 |
| 13076 | requires_gnutls_next_no_ticket |
| 13077 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13078 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13079 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13080 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13081 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13082 | 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] | 13083 | "$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] | 13084 | "$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] | 13085 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13086 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13087 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13088 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13089 | -c "discarding change cipher spec in TLS1.3" |
| 13090 | |
| 13091 | requires_gnutls_tls1_3 |
| 13092 | requires_gnutls_next_no_ticket |
| 13093 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13094 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13095 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13096 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13097 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13098 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13099 | "$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] | 13100 | "$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] | 13101 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13102 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13103 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13104 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13105 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13106 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13107 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13108 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13109 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13110 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13111 | 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] | 13112 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13113 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13114 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13115 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13116 | -c "Protocol is TLSv1.3" \ |
| 13117 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13118 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13119 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13120 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13121 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13122 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13123 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13124 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13125 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13126 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13127 | 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] | 13128 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13129 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13130 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13131 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13132 | -c "Protocol is TLSv1.3" \ |
| 13133 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13134 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13135 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13136 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13137 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13138 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13139 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13140 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13141 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13142 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13143 | "$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] | 13144 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13145 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13146 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13147 | -c "received HelloRetryRequest message" \ |
| 13148 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13149 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13150 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13151 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13152 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13153 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13154 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13156 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13157 | "$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] | 13158 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13159 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13160 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13161 | -c "Protocol is TLSv1.3" \ |
| 13162 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13163 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13164 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13165 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13167 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13169 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13170 | "$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] | 13171 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13172 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13173 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13174 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13175 | |
| 13176 | requires_gnutls_tls1_3 |
| 13177 | requires_gnutls_next_no_ticket |
| 13178 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13179 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13180 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13181 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13182 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13183 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13184 | "$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] | 13185 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13186 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13187 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13188 | -c "received HelloRetryRequest message" \ |
| 13189 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13190 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13191 | |
| 13192 | requires_gnutls_tls1_3 |
| 13193 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13194 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13195 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13196 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13198 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13199 | "$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] | 13200 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13201 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13202 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | 671a439 | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13203 | -c "Protocol is TLSv1.3" \ |
| 13204 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13205 | |
| 13206 | requires_gnutls_tls1_3 |
| 13207 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13208 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13209 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13210 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13211 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13213 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13214 | "$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] | 13215 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13216 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13217 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13218 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13219 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13220 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13221 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13222 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13223 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13224 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13225 | 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] | 13226 | "$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] | 13227 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13228 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13229 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13230 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13231 | -C "14 03 03 00 01" |
| 13232 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13233 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13234 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13235 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13236 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13238 | 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] | 13239 | "$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] | 13240 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13241 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13242 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13243 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13244 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13245 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13246 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13247 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13248 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13249 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13250 | 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] | 13251 | "$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] | 13252 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13253 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13254 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13255 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13256 | -c "14 03 03 00 01" |
| 13257 | |
| 13258 | requires_gnutls_tls1_3 |
| 13259 | requires_gnutls_next_no_ticket |
| 13260 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13261 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13262 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13263 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13264 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13265 | 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] | 13266 | "$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] | 13267 | "$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] | 13268 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13269 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13270 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13271 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13272 | |
| 13273 | requires_gnutls_tls1_3 |
| 13274 | requires_gnutls_next_no_ticket |
| 13275 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13276 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13277 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13278 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13279 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13280 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13281 | 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] | 13282 | "$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] | 13283 | "$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] | 13284 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13285 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13286 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13287 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13288 | -c "discarding change cipher spec in TLS1.3" |
| 13289 | |
| 13290 | requires_gnutls_tls1_3 |
| 13291 | requires_gnutls_next_no_ticket |
| 13292 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13293 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13294 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13295 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13296 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13297 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13298 | 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] | 13299 | "$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] | 13300 | "$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] | 13301 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13302 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13303 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13304 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13305 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13306 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13307 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13308 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13309 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13310 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13311 | "$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] | 13312 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13313 | -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] | 13314 | "$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] | 13315 | 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] | 13316 | 0 \ |
| 13317 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13318 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13319 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13320 | |
| 13321 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13322 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13323 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13324 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13325 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13326 | "$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] | 13327 | -d 4 |
| 13328 | --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] | 13329 | "$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] | 13330 | 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] | 13331 | 0 \ |
| 13332 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13333 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13334 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13335 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13336 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13337 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13338 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13339 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13340 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13341 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13342 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13343 | 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] | 13344 | 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] | 13345 | "$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] | 13346 | 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] | 13347 | 0 \ |
| 13348 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13349 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 13350 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13351 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 13352 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13353 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13354 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13355 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13356 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13357 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13358 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13359 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13360 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13361 | 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] | 13362 | 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] | 13363 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13364 | -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] | 13365 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13366 | 0 \ |
| 13367 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13368 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13369 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13370 | |
| 13371 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13372 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13373 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13374 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13375 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13376 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13377 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13378 | 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] | 13379 | 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] | 13380 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13381 | --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] | 13382 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13383 | 0 \ |
| 13384 | -c "Negotiated version: 3.4" \ |
| 13385 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13386 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13387 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13388 | |
| 13389 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13390 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13392 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13393 | 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] | 13394 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13395 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13396 | 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] | 13397 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13398 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13399 | --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] | 13400 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13401 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13402 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13403 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13404 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13405 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13406 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13407 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13408 | 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] | 13409 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13410 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13411 | 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] | 13412 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13413 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13414 | -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] | 13415 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13416 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13417 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13418 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13419 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13420 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13421 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13422 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13423 | 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] | 13424 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13425 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13426 | 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] | 13427 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13428 | "$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] | 13429 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13430 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13431 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13432 | |
| 13433 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13434 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13435 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13436 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13437 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13438 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13439 | 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] | 13440 | 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] | 13441 | "$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] | 13442 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 13443 | 1 \ |
| 13444 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13445 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13446 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13447 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13448 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13449 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13450 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13451 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13452 | 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] | 13453 | 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] | 13454 | "$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] | 13455 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 13456 | 1 \ |
| 13457 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13458 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13459 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13460 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13461 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13462 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13463 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13464 | "$P_SRV debug_level=4 |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13465 | 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] | 13466 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 13467 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13468 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13469 | 1 \ |
| 13470 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 13471 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13472 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13473 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13474 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13475 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13476 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13477 | "$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] | 13478 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13479 | -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] | 13480 | "$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] | 13481 | 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] | 13482 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13483 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13484 | |
| 13485 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13486 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13487 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13488 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13489 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13490 | "$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] | 13491 | -d 4 |
| 13492 | --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] | 13493 | "$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] | 13494 | 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] | 13495 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13496 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13497 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13498 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13499 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13500 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 7b02c1f | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13501 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13502 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13503 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13504 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13505 | 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] | 13506 | 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] | 13507 | "$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] | 13508 | 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] | 13509 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13510 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13511 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13512 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13514 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13515 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13516 | 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] | 13517 | "$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] | 13518 | -msg -tls1_2 |
| 13519 | -Verify 10 " \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13520 | "$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] | 13521 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13522 | min_version=tls12 max_version=tls13 " \ |
| 13523 | 0 \ |
| 13524 | -c "Protocol is TLSv1.2" \ |
| 13525 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13526 | |
| 13527 | |
| 13528 | requires_gnutls_tls1_3 |
| 13529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13530 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13531 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13532 | 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] | 13533 | "$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] | 13534 | -d 4 |
| 13535 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 184c4f0 | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13536 | "$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] | 13537 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13538 | min_version=tls12 max_version=tls13 " \ |
| 13539 | 0 \ |
| 13540 | -c "Protocol is TLSv1.2" \ |
| 13541 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13542 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13543 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13544 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13545 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13546 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13547 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13548 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13549 | requires_gnutls_tls1_3 |
| 13550 | requires_gnutls_next_no_ticket |
| 13551 | requires_gnutls_next_disable_tls13_compat |
| 13552 | 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] | 13553 | "$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" \ |
| 13554 | "$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] | 13555 | 0 \ |
| 13556 | -s "Protocol is TLSv1.3" \ |
| 13557 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13558 | -s "received signature algorithm: 0x804" \ |
| 13559 | -s "got named group: ffdhe3072(0101)" \ |
| 13560 | -s "Certificate verification was skipped" \ |
| 13561 | -C "received HelloRetryRequest message" |
| 13562 | |
| 13563 | |
| 13564 | requires_gnutls_tls1_3 |
| 13565 | requires_gnutls_next_no_ticket |
| 13566 | requires_gnutls_next_disable_tls13_compat |
| 13567 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13568 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13569 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13570 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13571 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13572 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13573 | 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] | 13574 | "$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" \ |
| 13575 | "$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] | 13576 | 0 \ |
| 13577 | -c "HTTP/1.0 200 OK" \ |
| 13578 | -c "Protocol is TLSv1.3" \ |
| 13579 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13580 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13581 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 13582 | -c "Verifying peer X.509 certificate... ok" \ |
| 13583 | -C "received HelloRetryRequest message" |
| 13584 | |
| 13585 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13586 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13587 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13588 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13589 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13590 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13591 | requires_gnutls_tls1_3 |
| 13592 | requires_gnutls_next_no_ticket |
| 13593 | requires_gnutls_next_disable_tls13_compat |
| 13594 | 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] | 13595 | "$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" \ |
| 13596 | "$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] | 13597 | 0 \ |
| 13598 | -s "Protocol is TLSv1.3" \ |
| 13599 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13600 | -s "received signature algorithm: 0x804" \ |
| 13601 | -s "got named group: ffdhe4096(0102)" \ |
| 13602 | -s "Certificate verification was skipped" \ |
| 13603 | -C "received HelloRetryRequest message" |
| 13604 | |
| 13605 | |
| 13606 | requires_gnutls_tls1_3 |
| 13607 | requires_gnutls_next_no_ticket |
| 13608 | requires_gnutls_next_disable_tls13_compat |
| 13609 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13610 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13611 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13612 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13613 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13614 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13615 | 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] | 13616 | "$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" \ |
| 13617 | "$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] | 13618 | 0 \ |
| 13619 | -c "HTTP/1.0 200 OK" \ |
| 13620 | -c "Protocol is TLSv1.3" \ |
| 13621 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13622 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13623 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 13624 | -c "Verifying peer X.509 certificate... ok" \ |
| 13625 | -C "received HelloRetryRequest message" |
| 13626 | |
| 13627 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13628 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13629 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13630 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13631 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13632 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13633 | requires_gnutls_tls1_3 |
| 13634 | requires_gnutls_next_no_ticket |
| 13635 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13636 | # Tests using FFDH with a large prime take a long time to run with a memory |
| 13637 | # sanitizer. GnuTLS <=3.8.1 has a hard-coded timeout and gives up after |
| 13638 | # 30s (since 3.8.1, it can be configured with --timeout). We've observed |
| 13639 | # 8192-bit FFDH test cases failing intermittently on heavily loaded CI |
| 13640 | # executors (https://github.com/Mbed-TLS/mbedtls/issues/9742), |
| 13641 | # when using MSan. As a workaround, skip them. |
| 13642 | # Also skip 6144-bit FFDH to have a bit of safety margin. |
| 13643 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13644 | 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] | 13645 | "$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" \ |
| 13646 | "$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] | 13647 | 0 \ |
| 13648 | -s "Protocol is TLSv1.3" \ |
| 13649 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13650 | -s "received signature algorithm: 0x804" \ |
| 13651 | -s "got named group: ffdhe6144(0103)" \ |
| 13652 | -s "Certificate verification was skipped" \ |
| 13653 | -C "received HelloRetryRequest message" |
| 13654 | |
| 13655 | requires_gnutls_tls1_3 |
| 13656 | requires_gnutls_next_no_ticket |
| 13657 | requires_gnutls_next_disable_tls13_compat |
| 13658 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13659 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13660 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13661 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13662 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13663 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13664 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13665 | 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] | 13666 | "$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" \ |
| 13667 | "$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] | 13668 | 0 \ |
| 13669 | -c "HTTP/1.0 200 OK" \ |
| 13670 | -c "Protocol is TLSv1.3" \ |
| 13671 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13672 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13673 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 13674 | -c "Verifying peer X.509 certificate... ok" \ |
| 13675 | -C "received HelloRetryRequest message" |
| 13676 | |
| 13677 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13678 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13679 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13680 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13681 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13682 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13683 | requires_gnutls_tls1_3 |
| 13684 | requires_gnutls_next_no_ticket |
| 13685 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13686 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13687 | client_needs_more_time 4 |
| 13688 | 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] | 13689 | "$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" \ |
| 13690 | "$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] | 13691 | 0 \ |
| 13692 | -s "Protocol is TLSv1.3" \ |
| 13693 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13694 | -s "received signature algorithm: 0x804" \ |
| 13695 | -s "got named group: ffdhe8192(0104)" \ |
| 13696 | -s "Certificate verification was skipped" \ |
| 13697 | -C "received HelloRetryRequest message" |
| 13698 | |
| 13699 | requires_gnutls_tls1_3 |
| 13700 | requires_gnutls_next_no_ticket |
| 13701 | requires_gnutls_next_disable_tls13_compat |
| 13702 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13703 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13704 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13705 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13706 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 13707 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Gilles Peskine | 05030d4 | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 13708 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13709 | client_needs_more_time 4 |
| 13710 | 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] | 13711 | "$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" \ |
| 13712 | "$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] | 13713 | 0 \ |
| 13714 | -c "HTTP/1.0 200 OK" \ |
| 13715 | -c "Protocol is TLSv1.3" \ |
| 13716 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13717 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13718 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 13719 | -c "Verifying peer X.509 certificate... ok" \ |
| 13720 | -C "received HelloRetryRequest message" |
| 13721 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 13722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 13723 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13724 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13725 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 13726 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13727 | 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] | 13728 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 13729 | "$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] | 13730 | 0 \ |
| 13731 | -C "received HelloRetryRequest message" \ |
| 13732 | -c "Selected key exchange mode: psk$" \ |
| 13733 | -c "HTTP/1.0 200 OK" |
| 13734 | |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 13735 | # Legacy_compression_methods testing |
| 13736 | |
| 13737 | requires_gnutls |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 13738 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 13739 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | dc99c89 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 13740 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 13741 | "$P_SRV debug_level=3" \ |
| 13742 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 13743 | 0 \ |
| 13744 | -c "Handshake was completed" \ |
| 13745 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 0b190f1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 13746 | |
Waleed Elmelegy | 79a8ded | 2025-01-24 17:39:58 +0000 | [diff] [blame] | 13747 | # Handshake defragmentation testing |
Minos Galanakis | d708a63 | 2025-02-18 17:28:27 +0000 | [diff] [blame] | 13748 | |
Gilles Peskine | b40d33b | 2025-03-01 14:26:51 +0100 | [diff] [blame] | 13749 | # Most test cases are in opt-testcases/handshake-generated.sh |
Minos Galanakis | 74ce749 | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 13750 | |
Minos Galanakis | 74ce749 | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 13751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 74ce749 | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 13752 | requires_certificate_authentication |
Minos Galanakis | daa14a4 | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 13753 | run_test "Handshake defragmentation on server: len=32, TLS 1.2 ClientHello (unsupported)" \ |
Minos Galanakis | 74ce749 | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 13754 | "$P_SRV debug_level=4 force_version=tls12 auth_mode=required" \ |
| 13755 | "$O_NEXT_CLI -tls1_2 -split_send_frag 32 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 13756 | 1 \ |
| 13757 | -s "The SSL configuration is tls12 only" \ |
| 13758 | -s "bad client hello message" \ |
| 13759 | -s "SSL - A message could not be parsed due to a syntactic error" |
| 13760 | |
Minos Galanakis | 990a109 | 2025-03-11 14:06:38 +0000 | [diff] [blame] | 13761 | # Test server-side buffer resizing with fragmented handshake on TLS1.2 |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | daa14a4 | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 13763 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 13764 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 13765 | requires_max_content_len 1025 |
Minos Galanakis | af0e60b | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 13766 | run_test "Handshake defragmentation on server: len=256, buffer resizing with MFL=1024" \ |
Minos Galanakis | daa14a4 | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 13767 | "$P_SRV debug_level=4 auth_mode=required" \ |
| 13768 | "$O_NEXT_CLI -tls1_2 -split_send_frag 256 -maxfraglen 1024 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 13769 | 0 \ |
| 13770 | -s "Reallocating in_buf" \ |
| 13771 | -s "Reallocating out_buf" \ |
| 13772 | -s "reassembled record" \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13773 | -s "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 13774 | -s "Prepare: waiting for more handshake fragments 256/" \ |
| 13775 | -s "Consume: waiting for more handshake fragments 256/" |
Minos Galanakis | daa14a4 | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 13776 | |
Minos Galanakis | 990a109 | 2025-03-11 14:06:38 +0000 | [diff] [blame] | 13777 | # Test client-initiated renegotiation with fragmented handshake on TLS1.2 |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 5aaa6e0 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 13779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13780 | run_test "Handshake defragmentation on server: len=512, client-initiated renegotiation" \ |
Minos Galanakis | 5aaa6e0 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 13781 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
Minos Galanakis | a8f1438 | 2025-03-11 17:29:33 +0000 | [diff] [blame] | 13782 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 512 -connect 127.0.0.1:+$SRV_PORT" \ |
Minos Galanakis | 5aaa6e0 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 13783 | 0 \ |
| 13784 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 13785 | -s "found renegotiation extension" \ |
| 13786 | -s "server hello, secure renegotiation extension" \ |
| 13787 | -s "=> renegotiate" \ |
| 13788 | -S "write hello request" \ |
| 13789 | -s "reassembled record" \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13790 | -s "initial handshake fragment: 512, 0\\.\\.512 of [0-9]\\+" \ |
| 13791 | -s "Prepare: waiting for more handshake fragments 512/" \ |
| 13792 | -s "Consume: waiting for more handshake fragments 512/" \ |
Minos Galanakis | 5aaa6e0 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 13793 | |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13795 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13796 | run_test "Handshake defragmentation on server: len=256, client-initiated renegotiation" \ |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13797 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
Minos Galanakis | a8f1438 | 2025-03-11 17:29:33 +0000 | [diff] [blame] | 13798 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 256 -connect 127.0.0.1:+$SRV_PORT" \ |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13799 | 0 \ |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13800 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 13801 | -s "found renegotiation extension" \ |
| 13802 | -s "server hello, secure renegotiation extension" \ |
| 13803 | -s "=> renegotiate" \ |
| 13804 | -S "write hello request" \ |
| 13805 | -s "reassembled record" \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13806 | -s "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 13807 | -s "Prepare: waiting for more handshake fragments 256/" \ |
| 13808 | -s "Consume: waiting for more handshake fragments 256/" \ |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13809 | |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13812 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13813 | run_test "Handshake defragmentation on server: len=128, client-initiated renegotiation" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13814 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
Minos Galanakis | a8f1438 | 2025-03-11 17:29:33 +0000 | [diff] [blame] | 13815 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 128 -connect 127.0.0.1:+$SRV_PORT" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13816 | 0 \ |
| 13817 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 13818 | -s "found renegotiation extension" \ |
| 13819 | -s "server hello, secure renegotiation extension" \ |
| 13820 | -s "=> renegotiate" \ |
| 13821 | -S "write hello request" \ |
| 13822 | -s "reassembled record" \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13823 | -s "initial handshake fragment: 128, 0\\.\\.128 of [0-9]\\+" \ |
| 13824 | -s "Prepare: waiting for more handshake fragments 128/" \ |
| 13825 | -s "Consume: waiting for more handshake fragments 128/" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13826 | |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 13829 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13830 | run_test "Handshake defragmentation on server: len=4, client-initiated renegotiation" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13831 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
Minos Galanakis | a8f1438 | 2025-03-11 17:29:33 +0000 | [diff] [blame] | 13832 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 4 -connect 127.0.0.1:+$SRV_PORT" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13833 | 0 \ |
| 13834 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 13835 | -s "found renegotiation extension" \ |
| 13836 | -s "server hello, secure renegotiation extension" \ |
| 13837 | -s "=> renegotiate" \ |
| 13838 | -S "write hello request" \ |
| 13839 | -s "reassembled record" \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13840 | -s "initial handshake fragment: 4, 0\\.\\.4 of [0-9]\\+" \ |
| 13841 | -s "Prepare: waiting for more handshake fragments 4/" \ |
| 13842 | -s "Consume: waiting for more handshake fragments 4/" \ |
Minos Galanakis | ae54c74 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 13843 | |
Minos Galanakis | 1d78c7d | 2025-03-12 01:07:58 +0000 | [diff] [blame] | 13844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 13846 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13847 | run_test "Handshake defragmentation on server: len=4, client-initiated server-rejected renegotiation" \ |
Minos Galanakis | 1d78c7d | 2025-03-12 01:07:58 +0000 | [diff] [blame] | 13848 | "$P_SRV debug_level=4 exchanges=2 renegotiation=0 auth_mode=required" \ |
| 13849 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 4 -connect 127.0.0.1:+$SRV_PORT" \ |
| 13850 | 1 \ |
| 13851 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 13852 | -s "refusing renegotiation, sending alert" \ |
| 13853 | -s "server hello, secure renegotiation extension" \ |
| 13854 | -s "initial handshake fragment: 4, 0\\.\\.4 of [0-9]\\+" \ |
| 13855 | -s "Prepare: waiting for more handshake fragments 4/" \ |
| 13856 | -s "Consume: waiting for more handshake fragments 4/" \ |
| 13857 | |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13858 | # Test server-initiated renegotiation with fragmented handshake on TLS1.2 |
Minos Galanakis | 625c8fd | 2025-03-18 10:31:37 +0000 | [diff] [blame] | 13859 | |
| 13860 | # Note: The /reneg endpoint serves as a directive for OpenSSL's s_server |
| 13861 | # to initiate a handshake renegotiation. |
| 13862 | # Note: Adjusting the renegotiation delay beyond the library's default |
| 13863 | # value of 16 is necessary. This parameter defines the maximum |
| 13864 | # number of records received before renegotiation is completed. |
| 13865 | # By fragmenting records and thereby increasing their quantity, |
| 13866 | # the default threshold can be reached more quickly. |
| 13867 | # Setting it to -1 disables that policy's enforment. |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13869 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13870 | run_test "Handshake defragmentation on client: len=512, server-initiated renegotiation" \ |
Minos Galanakis | df4ddfd | 2025-03-11 17:24:04 +0000 | [diff] [blame] | 13871 | "$O_NEXT_SRV -tls1_2 -split_send_frag 512 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13872 | "$P_CLI debug_level=3 renegotiation=1 request_page=/reneg" \ |
| 13873 | 0 \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13874 | -c "initial handshake fragment: 512, 0\\.\\.512 of [0-9]\\+" \ |
| 13875 | -c "Prepare: waiting for more handshake fragments 512/" \ |
| 13876 | -c "Consume: waiting for more handshake fragments 512/" \ |
Minos Galanakis | 529188f | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 13877 | -c "client hello, adding renegotiation extension" \ |
| 13878 | -c "found renegotiation extension" \ |
| 13879 | -c "=> renegotiate" |
| 13880 | |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13882 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | dfc082e | 2025-03-18 10:25:24 +0000 | [diff] [blame] | 13883 | run_test "Handshake defragmentation on client: len=256, server-initiated renegotiation" \ |
Minos Galanakis | df4ddfd | 2025-03-11 17:24:04 +0000 | [diff] [blame] | 13884 | "$O_NEXT_SRV -tls1_2 -split_send_frag 256 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
Minos Galanakis | f475a15 | 2025-03-13 11:43:53 +0000 | [diff] [blame] | 13885 | "$P_CLI debug_level=3 renegotiation=1 renego_delay=-1 request_page=/reneg" \ |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13886 | 0 \ |
Minos Galanakis | 70be67b | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 13887 | -c "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 13888 | -c "Prepare: waiting for more handshake fragments 256/" \ |
| 13889 | -c "Consume: waiting for more handshake fragments 256/" \ |
Minos Galanakis | a7b19aa | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 13890 | -c "client hello, adding renegotiation extension" \ |
| 13891 | -c "found renegotiation extension" \ |
| 13892 | -c "=> renegotiate" |
| 13893 | |
Minos Galanakis | 625c8fd | 2025-03-18 10:31:37 +0000 | [diff] [blame] | 13894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13895 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 13896 | run_test "Handshake defragmentation on client: len=128, server-initiated renegotiation" \ |
| 13897 | "$O_NEXT_SRV -tls1_2 -split_send_frag 128 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 13898 | "$P_CLI debug_level=3 renegotiation=1 renego_delay=-1 request_page=/reneg" \ |
| 13899 | 0 \ |
| 13900 | -c "initial handshake fragment: 128, 0\\.\\.128 of [0-9]\\+" \ |
| 13901 | -c "Prepare: waiting for more handshake fragments 128/" \ |
| 13902 | -c "Consume: waiting for more handshake fragments 128/" \ |
| 13903 | -c "client hello, adding renegotiation extension" \ |
| 13904 | -c "found renegotiation extension" \ |
| 13905 | -c "=> renegotiate" |
| 13906 | |
| 13907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13908 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 13909 | run_test "Handshake defragmentation on client: len=4, server-initiated renegotiation" \ |
| 13910 | "$O_NEXT_SRV -tls1_2 -split_send_frag 4 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 13911 | "$P_CLI debug_level=3 renegotiation=1 renego_delay=-1 request_page=/reneg" \ |
| 13912 | 0 \ |
| 13913 | -c "initial handshake fragment: 4, 0\\.\\.4 of [0-9]\\+" \ |
| 13914 | -c "Prepare: waiting for more handshake fragments 4/" \ |
| 13915 | -c "Consume: waiting for more handshake fragments 4/" \ |
| 13916 | -c "client hello, adding renegotiation extension" \ |
| 13917 | -c "found renegotiation extension" \ |
| 13918 | -c "=> renegotiate" |
| 13919 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13920 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13922 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13923 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13924 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13925 | requires_max_content_len 16384 |
Wenxing Hou | b4d03cc | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 13926 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13927 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13928 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 13929 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13930 | # Final report |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 13931 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13932 | echo "------------------------------------------------------------------------" |
| 13933 | |
| 13934 | if [ $FAILS = 0 ]; then |
| 13935 | printf "PASSED" |
| 13936 | else |
| 13937 | printf "FAILED" |
| 13938 | fi |
| 13939 | PASSES=$(( $TESTS - $FAILS )) |
| 13940 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 13941 | |
Gilles Peskine | 39c5207 | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 13942 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 13943 | cat <<EOF |
| 13944 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 13945 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 13946 | EOF |
| 13947 | if [ $FAILS -eq 0 ]; then |
| 13948 | FAILS=1 |
| 13949 | fi |
| 13950 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 13951 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 13952 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13953 | if [ $FAILS -gt 255 ]; then |
| 13954 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13955 | # (so 256 would be 0, or success, etc) |
| 13956 | FAILS=255 |
| 13957 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 13958 | exit $FAILS |