Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 16 | # The tests assume a build with default options, with exceptions expressed |
| 17 | # with a dependency. The tests focus on functionality and do not consider |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 32 | DATA_FILES_PATH=../framework/data_files |
| 33 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 34 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 35 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 36 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 37 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 38 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 39 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | : ${GNUTLS_CLI:=gnutls-cli} |
| 41 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 44 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 45 | # To help the migration, error out if the old variable is set, |
| 46 | # but only if it has a different value than the new one. |
| 47 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 48 | # the variable is set, we can now check its value |
| 49 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 50 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 51 | exit 125 |
| 52 | fi |
| 53 | fi |
| 54 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 56 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 57 | echo "default" |
| 58 | else |
| 59 | echo "unknown" |
| 60 | fi |
| 61 | } |
| 62 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 63 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 64 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 65 | : ${EARLY_DATA_INPUT:="$DATA_FILES_PATH/tls13_early_data.txt"} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 66 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 67 | O_SRV="$OPENSSL s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 68 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 69 | G_SRV="$GNUTLS_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
| 70 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
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 | f9c798c | 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 | 5ab92be | 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 | 5ab92be | 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 | c4595a4 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 106 | O_NEXT_CLI_RENEGOTIATE="echo 'R' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 107 | else |
| 108 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 109 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 110 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 111 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 112 | O_NEXT_CLI=false |
Minos Galanakis | c4595a4 | 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 | 5ab92be | 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 | 5ab92be | 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 | c75048c | 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 | c75048c | 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 | c75048c | 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 |
| 237 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 238 | if [ "$LIST_TESTS" -eq 0 ];then |
| 239 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 240 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 241 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 242 | CONFIGS_ENABLED="" |
| 243 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 244 | # Skip next test; use this macro to skip tests which are legitimate |
| 245 | # in theory and expected to be re-introduced at some point, but |
| 246 | # aren't expected to succeed at the moment due to problems outside |
| 247 | # our control (such as bugs in other TLS implementations). |
| 248 | skip_next_test() { |
| 249 | SKIP_NEXT="YES" |
| 250 | } |
| 251 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 252 | # Check if the required configuration ($1) is enabled |
| 253 | is_config_enabled() |
| 254 | { |
| 255 | case $CONFIGS_ENABLED in |
| 256 | *" $1"[\ =]*) return 0;; |
| 257 | *) return 1;; |
| 258 | esac |
| 259 | } |
| 260 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 261 | # 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] | 262 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 263 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 264 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 265 | *) SKIP_NEXT="YES";; |
| 266 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 267 | } |
| 268 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 269 | # 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] | 270 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 271 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 272 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 273 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 274 | } |
| 275 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 276 | requires_all_configs_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 277 | for x in "$@"; do |
| 278 | if ! is_config_enabled "$x"; then |
| 279 | SKIP_NEXT="YES" |
| 280 | return |
| 281 | fi |
| 282 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | requires_all_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 286 | for x in "$@"; do |
| 287 | if is_config_enabled "$x"; then |
| 288 | SKIP_NEXT="YES" |
| 289 | return |
| 290 | fi |
| 291 | done |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | requires_any_configs_enabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 295 | for x in "$@"; do |
| 296 | if is_config_enabled "$x"; then |
| 297 | return |
| 298 | fi |
| 299 | done |
| 300 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | requires_any_configs_disabled() { |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 304 | for x in "$@"; do |
| 305 | if ! is_config_enabled "$x"; then |
| 306 | return |
| 307 | fi |
| 308 | done |
| 309 | SKIP_NEXT="YES" |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 310 | } |
| 311 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 312 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 313 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 314 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 317 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 318 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 319 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 320 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 321 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 322 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 323 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 324 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 325 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 326 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 327 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 328 | |
Gilles Peskine | 0a9f9d6 | 2024-09-06 15:38:47 +0200 | [diff] [blame] | 329 | requires_certificate_authentication () { |
Gilles Peskine | cfbaffd | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 330 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 331 | then |
Gilles Peskine | cfbaffd | 2024-09-10 12:24:23 +0200 | [diff] [blame] | 332 | # TLS 1.3 is negotiated by default, so check whether it supports |
| 333 | # certificate-based authentication. |
| 334 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 335 | else # Only TLS 1.2 is enabled. |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 336 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 337 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 338 | } |
| 339 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 340 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 341 | # This function uses the query_config command line option to query the |
| 342 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 343 | # program. The command will always return a success value if the |
| 344 | # configuration is defined and the value will be printed to stdout. |
| 345 | # |
| 346 | # Note that if the configuration is not defined or is defined to nothing, |
| 347 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 348 | if [ "$LIST_TESTS" -eq 0 ];then |
| 349 | ${P_SRV} "query_config=${1}" |
| 350 | else |
| 351 | echo "1" |
| 352 | fi |
| 353 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 357 | VAL="$( get_config_value_or_default "$1" )" |
| 358 | if [ -z "$VAL" ]; then |
| 359 | # Should never happen |
| 360 | echo "Mbed TLS configuration $1 is not defined" |
| 361 | exit 1 |
| 362 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 363 | SKIP_NEXT="YES" |
| 364 | fi |
| 365 | } |
| 366 | |
| 367 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 368 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 369 | if [ -z "$VAL" ]; then |
| 370 | # Should never happen |
| 371 | echo "Mbed TLS configuration $1 is not defined" |
| 372 | exit 1 |
| 373 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 374 | SKIP_NEXT="YES" |
| 375 | fi |
| 376 | } |
| 377 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 378 | requires_config_value_equals() { |
| 379 | VAL=$( get_config_value_or_default "$1" ) |
| 380 | if [ -z "$VAL" ]; then |
| 381 | # Should never happen |
| 382 | echo "Mbed TLS configuration $1 is not defined" |
| 383 | exit 1 |
| 384 | elif [ "$VAL" -ne "$2" ]; then |
| 385 | SKIP_NEXT="YES" |
| 386 | fi |
| 387 | } |
| 388 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 389 | # Require Mbed TLS to support the given protocol version. |
| 390 | # |
| 391 | # Inputs: |
| 392 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 393 | requires_protocol_version() { |
| 394 | # Support for DTLS is detected separately in detect_dtls(). |
| 395 | case "$1" in |
| 396 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 397 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 398 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 399 | esac |
| 400 | } |
| 401 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 402 | # Space-separated list of ciphersuites supported by this build of |
| 403 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 404 | P_CIPHERSUITES="" |
| 405 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 406 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 407 | grep 'TLS-\|TLS1-3' | |
| 408 | tr -s ' \n' ' ')" |
| 409 | |
| 410 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 411 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 412 | exit 125 |
| 413 | fi |
| 414 | fi |
| 415 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 416 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 417 | case $P_CIPHERSUITES in |
| 418 | *" $1 "*) :;; |
| 419 | *) SKIP_NEXT="YES";; |
| 420 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 421 | } |
| 422 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 423 | requires_cipher_enabled() { |
| 424 | KEY_TYPE=$1 |
| 425 | MODE=${2:-} |
| 426 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 427 | case "$KEY_TYPE" in |
| 428 | CHACHA20) |
| 429 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 430 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 431 | ;; |
| 432 | *) |
| 433 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 434 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 435 | ;; |
| 436 | esac |
| 437 | else |
| 438 | case "$KEY_TYPE" in |
| 439 | CHACHA20) |
| 440 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 441 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 442 | ;; |
| 443 | *) |
| 444 | requires_config_enabled MBEDTLS_${MODE}_C |
| 445 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 446 | ;; |
| 447 | esac |
| 448 | fi |
| 449 | } |
| 450 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 451 | # Automatically detect required features based on command line parameters. |
| 452 | # Parameters are: |
| 453 | # - $1 = command line (call to a TLS client or server program) |
| 454 | # - $2 = client/server |
| 455 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 456 | # - $4 = Use an external tool without ECDH support |
| 457 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 458 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 459 | CMD_LINE=$1 |
| 460 | ROLE=$2 |
| 461 | TLS_VERSION=$3 |
| 462 | EXT_WO_ECDH=$4 |
| 463 | TEST_OPTIONS=${5:-} |
| 464 | |
| 465 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 466 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 467 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 468 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 469 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 470 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 471 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 472 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 473 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 474 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 475 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 476 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 477 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 478 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 479 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 480 | *[-_\ =]tickets=[^0]*) |
| 481 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 482 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 483 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 484 | *[-_\ =]alpn=*) |
| 485 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 486 | esac |
| 487 | |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 488 | case " $CMD_LINE " in |
| 489 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
Gilles Peskine | d57212e | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 490 | # The test case involves certificates (crt), or a relevant |
| 491 | # aspect of it is the (certificate-based) authentication mode. |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 492 | requires_certificate_authentication;; |
| 493 | esac |
| 494 | |
Gilles Peskine | e6b8250 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 495 | case " $CMD_LINE " in |
Gilles Peskine | f8b373e | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 496 | *"programs/ssl/dtls_client "*|\ |
Gilles Peskine | e6b8250 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 497 | *"programs/ssl/ssl_client1 "*) |
| 498 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 499 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 500 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 501 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 502 | requires_certificate_authentication |
| 503 | ;; |
Gilles Peskine | 9d104e9 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 504 | *"programs/ssl/dtls_server "*|\ |
Gilles Peskine | 2a0af35 | 2024-09-04 17:47:14 +0200 | [diff] [blame] | 505 | *"programs/ssl/ssl_fork_server "*|\ |
Gilles Peskine | fab6099 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 506 | *"programs/ssl/ssl_pthread_server "*|\ |
Gilles Peskine | 37c3749 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 507 | *"programs/ssl/ssl_server "*) |
| 508 | requires_config_enabled MBEDTLS_CTR_DRBG_C |
| 509 | requires_config_enabled MBEDTLS_ENTROPY_C |
| 510 | requires_config_enabled MBEDTLS_PEM_PARSE_C |
| 511 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 512 | requires_certificate_authentication |
Gilles Peskine | 5bf54ca | 2024-09-13 23:08:48 +0200 | [diff] [blame] | 513 | # The actual minimum depends on the configuration since it's |
| 514 | # mostly about the certificate size. |
| 515 | # In config-suite-b.h, for the test certificates (server5.crt), |
| 516 | # 1024 is not enough. |
| 517 | requires_config_value_at_least MBEDTLS_SSL_OUT_CONTENT_LEN 2000 |
Gilles Peskine | 37c3749 | 2024-09-04 16:30:32 +0200 | [diff] [blame] | 518 | ;; |
Gilles Peskine | e6b8250 | 2024-09-04 16:06:10 +0200 | [diff] [blame] | 519 | esac |
| 520 | |
Gilles Peskine | fab6099 | 2024-09-04 16:31:06 +0200 | [diff] [blame] | 521 | case " $CMD_LINE " in |
| 522 | *"programs/ssl/ssl_pthread_server "*) |
| 523 | requires_config_enabled MBEDTLS_THREADING_PTHREAD;; |
| 524 | esac |
| 525 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 526 | case "$CMD_LINE" in |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 527 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 528 | */server5*|\ |
| 529 | */server7*|\ |
| 530 | */dir-maxpath*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 531 | requires_certificate_authentication |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 532 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 533 | # In case of TLS13 the support for ECDSA is enough |
| 534 | requires_pk_alg "ECDSA" |
| 535 | else |
| 536 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 537 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 538 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 539 | # key exchange is required. However gnutls also does not |
| 540 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 541 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 542 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 543 | else |
| 544 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 545 | fi |
| 546 | elif [ "$ROLE" = "client" ]; then |
| 547 | # On the client side it is enough to have any certificate |
| 548 | # based authentication together with support for ECDSA. |
| 549 | # Of course the GnuTLS limitation mentioned above applies |
| 550 | # also here. |
| 551 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 552 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 553 | else |
| 554 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 555 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 556 | requires_pk_alg "ECDSA" |
| 557 | fi |
| 558 | fi |
| 559 | ;; |
| 560 | esac |
| 561 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 562 | case "$CMD_LINE" in |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 563 | *[-_\ =]psk*|*[-_\ =]PSK*) :;; # No certificate requirement with PSK |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 564 | */server1*|\ |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 565 | */server2*|\ |
| 566 | */server7*) |
Gilles Peskine | 6eff90f | 2024-09-06 15:34:59 +0200 | [diff] [blame] | 567 | requires_certificate_authentication |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 568 | # Certificates with an RSA key. The algorithm requirement is |
| 569 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 570 | # PSS signature}. We can't easily tell which subset works, and |
| 571 | # we aren't currently running ssl-opt.sh in configurations |
| 572 | # where partial RSA support is a problem, so generically, we |
| 573 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 574 | requires_config_enabled "MBEDTLS_RSA_C" |
| 575 | esac |
| 576 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 577 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 578 | } |
| 579 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 580 | adapt_cmd_for_psk () { |
| 581 | case "$2" in |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 582 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 583 | *openssl*) s='-psk 73776f726466697368';; |
Gilles Peskine | 9cd5848 | 2024-09-06 15:27:57 +0200 | [diff] [blame] | 584 | *gnutls-cli*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 585 | *gnutls-serv*) s='--pskpasswd=../framework/data_files/simplepass.psk';; |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 586 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 587 | esac |
| 588 | eval $1='"$2 $s"' |
| 589 | unset s |
| 590 | } |
| 591 | |
| 592 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 593 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 594 | # |
| 595 | # If not running in a PSK-only build, do nothing. |
| 596 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 597 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 598 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 599 | # a pre-shared key, do nothing. |
| 600 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 601 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 602 | # |
| 603 | # Inputs: |
| 604 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 605 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 606 | # * "$@": options passed to run_test. |
| 607 | # |
| 608 | # Outputs: |
| 609 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 610 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 611 | maybe_adapt_for_psk() { |
| 612 | if [ "$PSK_ONLY" != "YES" ]; then |
| 613 | return |
| 614 | fi |
| 615 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 616 | return |
| 617 | fi |
| 618 | case "$CLI_CMD $SRV_CMD" in |
| 619 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 620 | return;; |
| 621 | *force_ciphersuite*) |
| 622 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 623 | # PSK cipher suite could be substituted, but we're not ready for |
| 624 | # that yet. |
| 625 | SKIP_NEXT="YES" |
| 626 | return;; |
| 627 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 628 | # The test case involves certificates. PSK won't do. |
| 629 | SKIP_NEXT="YES" |
| 630 | return;; |
| 631 | esac |
| 632 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 633 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 634 | } |
| 635 | |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 636 | # PSK_PRESENT="YES" if at least one protocol versions supports at least |
| 637 | # one PSK key exchange mode. |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 638 | PSK_PRESENT="NO" |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 639 | # PSK_ONLY="YES" if all the available key exchange modes are PSK-based |
| 640 | # (pure-PSK or PSK-ephemeral, possibly both). |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 641 | PSK_ONLY="" |
| 642 | for c in $CONFIGS_ENABLED; do |
| 643 | case $c in |
| 644 | MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | 19c60d2 | 2024-09-09 11:24:17 +0200 | [diff] [blame] | 645 | MBEDTLS_KEY_EXCHANGE_*_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 646 | MBEDTLS_KEY_EXCHANGE_*_ENABLED) PSK_ONLY="NO";; |
| 647 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | d98b363 | 2024-09-06 19:08:41 +0200 | [diff] [blame] | 648 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_*_ENABLED) PSK_PRESENT="YES";; |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 649 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_*_ENABLED) PSK_ONLY="NO";; |
| 650 | esac |
| 651 | done |
Gilles Peskine | 5838a64 | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 652 | # At this stage, $PSK_ONLY is empty if we haven't detected a non-PSK |
| 653 | # key exchange, i.e. if we're in a PSK-only build or a build with no |
| 654 | # key exchanges at all. We avoid triggering PSK-only adaptation code in |
Gilles Peskine | d57212e | 2024-09-10 12:06:33 +0200 | [diff] [blame] | 655 | # the edge case of no key exchanges. |
Gilles Peskine | bbdc1a3 | 2024-09-06 15:38:20 +0200 | [diff] [blame] | 656 | : ${PSK_ONLY:=$PSK_PRESENT} |
| 657 | unset c |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 658 | |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 659 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 660 | HAS_ALG_SHA_1="NO" |
| 661 | HAS_ALG_SHA_224="NO" |
| 662 | HAS_ALG_SHA_256="NO" |
| 663 | HAS_ALG_SHA_384="NO" |
| 664 | HAS_ALG_SHA_512="NO" |
| 665 | |
| 666 | check_for_hash_alg() |
| 667 | { |
| 668 | CURR_ALG="INVALID"; |
| 669 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 670 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 671 | USE_PSA="YES"; |
| 672 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 673 | if [ $USE_PSA = "YES" ]; then |
| 674 | CURR_ALG=PSA_WANT_ALG_${1} |
| 675 | else |
| 676 | CURR_ALG=MBEDTLS_${1}_C |
| 677 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 678 | # MD5 is an exception to this convention |
| 679 | if [ "${1}" != "MD5" ]; then |
| 680 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 681 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 682 | fi |
| 683 | |
| 684 | case $CONFIGS_ENABLED in |
| 685 | *" $CURR_ALG"[\ =]*) |
| 686 | return 0 |
| 687 | ;; |
| 688 | *) :;; |
| 689 | esac |
| 690 | return 1 |
| 691 | } |
| 692 | |
| 693 | populate_enabled_hash_algs() |
| 694 | { |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 695 | 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] | 696 | if check_for_hash_alg "$hash_alg"; then |
| 697 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 698 | eval ${hash_alg_variable}=YES |
| 699 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 700 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 701 | } |
| 702 | |
| 703 | # skip next test if the given hash alg is not supported |
| 704 | requires_hash_alg() { |
| 705 | HASH_DEFINE="Invalid" |
| 706 | HAS_HASH_ALG="NO" |
| 707 | case $1 in |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 708 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 709 | SHA_1):;; |
| 710 | SHA_224):;; |
| 711 | SHA_256):;; |
| 712 | SHA_384):;; |
| 713 | SHA_512):;; |
| 714 | *) |
| 715 | echo "Unsupported hash alg - $1" |
| 716 | exit 1 |
| 717 | ;; |
| 718 | esac |
| 719 | |
| 720 | HASH_DEFINE=HAS_ALG_${1} |
| 721 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 722 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 723 | then |
| 724 | SKIP_NEXT="YES" |
| 725 | fi |
| 726 | } |
| 727 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 728 | # Skip next test if the given pk alg is not enabled |
| 729 | requires_pk_alg() { |
| 730 | case $1 in |
| 731 | ECDSA) |
| 732 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 733 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 734 | else |
| 735 | requires_config_enabled MBEDTLS_ECDSA_C |
| 736 | fi |
| 737 | ;; |
| 738 | *) |
| 739 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 740 | exit 1 |
| 741 | ;; |
| 742 | esac |
| 743 | } |
| 744 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 745 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 746 | requires_openssl_with_fallback_scsv() { |
| 747 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 748 | 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] | 749 | then |
| 750 | OPENSSL_HAS_FBSCSV="YES" |
| 751 | else |
| 752 | OPENSSL_HAS_FBSCSV="NO" |
| 753 | fi |
| 754 | fi |
| 755 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 756 | SKIP_NEXT="YES" |
| 757 | fi |
| 758 | } |
| 759 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 760 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 761 | requires_max_content_len() { |
| 762 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 763 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 764 | } |
| 765 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 766 | # skip next test if GnuTLS isn't available |
| 767 | requires_gnutls() { |
| 768 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 769 | 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] | 770 | GNUTLS_AVAILABLE="YES" |
| 771 | else |
| 772 | GNUTLS_AVAILABLE="NO" |
| 773 | fi |
| 774 | fi |
| 775 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 776 | SKIP_NEXT="YES" |
| 777 | fi |
| 778 | } |
| 779 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 780 | # skip next test if GnuTLS-next isn't available |
| 781 | requires_gnutls_next() { |
| 782 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 783 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 784 | GNUTLS_NEXT_AVAILABLE="YES" |
| 785 | else |
| 786 | GNUTLS_NEXT_AVAILABLE="NO" |
| 787 | fi |
| 788 | fi |
| 789 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 790 | SKIP_NEXT="YES" |
| 791 | fi |
| 792 | } |
| 793 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 794 | requires_openssl_next() { |
| 795 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 796 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 797 | OPENSSL_NEXT_AVAILABLE="YES" |
| 798 | else |
| 799 | OPENSSL_NEXT_AVAILABLE="NO" |
| 800 | fi |
| 801 | fi |
| 802 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 803 | SKIP_NEXT="YES" |
| 804 | fi |
| 805 | } |
| 806 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 807 | # skip next test if openssl version is lower than 3.0 |
| 808 | requires_openssl_3_x() { |
| 809 | requires_openssl_next |
| 810 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 811 | OPENSSL_3_X_AVAILABLE="NO" |
| 812 | fi |
| 813 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 814 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 815 | then |
| 816 | OPENSSL_3_X_AVAILABLE="YES" |
| 817 | else |
| 818 | OPENSSL_3_X_AVAILABLE="NO" |
| 819 | fi |
| 820 | fi |
| 821 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 822 | SKIP_NEXT="YES" |
| 823 | fi |
| 824 | } |
| 825 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 826 | # skip next test if openssl does not support ffdh keys |
| 827 | requires_openssl_tls1_3_with_ffdh() { |
| 828 | requires_openssl_3_x |
| 829 | } |
| 830 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 831 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 832 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 833 | requires_openssl_next |
| 834 | |
| 835 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 836 | requires_openssl_tls1_3_with_ffdh |
| 837 | fi |
| 838 | } |
| 839 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 840 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 841 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 842 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 843 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 844 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 845 | fi |
| 846 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 847 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 848 | then |
| 849 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 850 | else |
| 851 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 852 | fi |
| 853 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 854 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 855 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 856 | fi |
| 857 | } |
| 858 | |
Gilles Peskine | 5838a64 | 2024-09-09 10:57:01 +0200 | [diff] [blame] | 859 | # OpenSSL servers forbid client renegotiation by default since OpenSSL 3.0. |
| 860 | # Older versions always allow it and have no command-line option. |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 861 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION= |
| 862 | case $($OPENSSL s_server -help 2>&1) in |
| 863 | *-client_renegotiation*) |
| 864 | OPENSSL_S_SERVER_CLIENT_RENEGOTIATION=-client_renegotiation;; |
| 865 | esac |
| 866 | |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 867 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 868 | requires_gnutls_tls1_3() { |
| 869 | requires_gnutls_next |
| 870 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 871 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 872 | fi |
| 873 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 874 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 875 | then |
| 876 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 877 | else |
| 878 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 879 | fi |
| 880 | fi |
| 881 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 882 | SKIP_NEXT="YES" |
| 883 | fi |
| 884 | } |
| 885 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 886 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 887 | requires_gnutls_next_no_ticket() { |
| 888 | requires_gnutls_next |
| 889 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 890 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 891 | fi |
| 892 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 893 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 894 | then |
| 895 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 896 | else |
| 897 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 898 | fi |
| 899 | fi |
| 900 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 901 | SKIP_NEXT="YES" |
| 902 | fi |
| 903 | } |
| 904 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 905 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 906 | requires_gnutls_next_disable_tls13_compat() { |
| 907 | requires_gnutls_next |
| 908 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 909 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 910 | fi |
| 911 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 912 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 913 | then |
| 914 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 915 | else |
| 916 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 917 | fi |
| 918 | fi |
| 919 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 920 | SKIP_NEXT="YES" |
| 921 | fi |
| 922 | } |
| 923 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 924 | # skip next test if GnuTLS does not support the record size limit extension |
| 925 | requires_gnutls_record_size_limit() { |
| 926 | requires_gnutls_next |
| 927 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 928 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 929 | else |
| 930 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 931 | fi |
| 932 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 933 | SKIP_NEXT="YES" |
| 934 | fi |
| 935 | } |
| 936 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 937 | # skip next test if IPv6 isn't available on this host |
| 938 | requires_ipv6() { |
| 939 | if [ -z "${HAS_IPV6:-}" ]; then |
| 940 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 941 | SRV_PID=$! |
| 942 | sleep 1 |
| 943 | kill $SRV_PID >/dev/null 2>&1 |
| 944 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 945 | HAS_IPV6="NO" |
| 946 | else |
| 947 | HAS_IPV6="YES" |
| 948 | fi |
| 949 | rm -r $SRV_OUT |
| 950 | fi |
| 951 | |
| 952 | if [ "$HAS_IPV6" = "NO" ]; then |
| 953 | SKIP_NEXT="YES" |
| 954 | fi |
| 955 | } |
| 956 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 957 | # skip next test if it's i686 or uname is not available |
| 958 | requires_not_i686() { |
| 959 | if [ -z "${IS_I686:-}" ]; then |
| 960 | IS_I686="YES" |
| 961 | if which "uname" >/dev/null 2>&1; then |
| 962 | if [ -z "$(uname -a | grep i686)" ]; then |
| 963 | IS_I686="NO" |
| 964 | fi |
| 965 | fi |
| 966 | fi |
| 967 | if [ "$IS_I686" = "YES" ]; then |
| 968 | SKIP_NEXT="YES" |
| 969 | fi |
| 970 | } |
| 971 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 972 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 973 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 974 | 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] | 975 | if [ "$LIST_TESTS" -eq 0 ];then |
| 976 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 977 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 978 | # Calculate the maximum content length that fits both |
| 979 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 980 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 981 | fi |
| 982 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 983 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 984 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 985 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 986 | # skip the next test if the SSL output buffer is less than 16KB |
| 987 | requires_full_size_output_buffer() { |
| 988 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 989 | SKIP_NEXT="YES" |
| 990 | fi |
| 991 | } |
| 992 | |
Gilles Peskine | 6bdebfe | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 993 | # Skip the next test if called by all.sh in a component with MSan |
| 994 | # (which we also call MemSan) or Valgrind. |
| 995 | not_with_msan_or_valgrind() { |
| 996 | case "_${MBEDTLS_TEST_CONFIGURATION:-}_" in |
| 997 | *_msan_*|*_memsan_*|*_valgrind_*) SKIP_NEXT="YES";; |
| 998 | esac |
| 999 | } |
| 1000 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 1001 | # skip the next test if valgrind is in use |
| 1002 | not_with_valgrind() { |
| 1003 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1004 | SKIP_NEXT="YES" |
| 1005 | fi |
| 1006 | } |
| 1007 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 1008 | # skip the next test if valgrind is NOT in use |
| 1009 | only_with_valgrind() { |
| 1010 | if [ "$MEMCHECK" -eq 0 ]; then |
| 1011 | SKIP_NEXT="YES" |
| 1012 | fi |
| 1013 | } |
| 1014 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1015 | # 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] | 1016 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1017 | CLI_DELAY_FACTOR=$1 |
| 1018 | } |
| 1019 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1020 | # wait for the given seconds after the client finished in the next test |
| 1021 | server_needs_more_time() { |
| 1022 | SRV_DELAY_SECONDS=$1 |
| 1023 | } |
| 1024 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1025 | # print_name <name> |
| 1026 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 1027 | TESTS=$(( $TESTS + 1 )) |
| 1028 | LINE="" |
| 1029 | |
| 1030 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 1031 | LINE="$TESTS " |
| 1032 | fi |
| 1033 | |
| 1034 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1035 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 1036 | printf "%s " "$LINE" |
| 1037 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 1038 | for i in `seq 1 $LEN`; do printf '.'; done |
| 1039 | printf ' ' |
| 1040 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1041 | } |
| 1042 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1043 | # record_outcome <outcome> [<failure-reason>] |
| 1044 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1045 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1046 | record_outcome() { |
| 1047 | echo "$1" |
| 1048 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 1049 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 1050 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 1051 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1052 | "$1" "${2-}" \ |
| 1053 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 1054 | fi |
| 1055 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 1056 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1057 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1058 | # True if the presence of the given pattern in a log definitely indicates |
| 1059 | # that the test has failed. False if the presence is inconclusive. |
| 1060 | # |
| 1061 | # Inputs: |
| 1062 | # * $1: pattern found in the logs |
| 1063 | # * $TIMES_LEFT: >0 if retrying is an option |
| 1064 | # |
| 1065 | # Outputs: |
| 1066 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 1067 | # unchanged otherwise. |
| 1068 | # * Return value: 1 if the pattern is inconclusive, |
| 1069 | # 0 if the failure is definitive. |
| 1070 | log_pattern_presence_is_conclusive() { |
| 1071 | # If we've run out of attempts, then don't retry no matter what. |
| 1072 | if [ $TIMES_LEFT -eq 0 ]; then |
| 1073 | return 0 |
| 1074 | fi |
| 1075 | case $1 in |
| 1076 | "resend") |
| 1077 | # An undesired resend may have been caused by the OS dropping or |
| 1078 | # delaying a packet at an inopportune time. |
| 1079 | outcome="RETRY(resend)" |
| 1080 | return 1;; |
| 1081 | esac |
| 1082 | } |
| 1083 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1084 | # fail <message> |
| 1085 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1086 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1087 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1088 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1089 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1090 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1091 | if [ -n "$PXY_CMD" ]; then |
| 1092 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1093 | fi |
| 1094 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1095 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1096 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1097 | echo " ! server output:" |
| 1098 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1099 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1100 | echo " ! client output:" |
| 1101 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1102 | if [ -n "$PXY_CMD" ]; then |
| 1103 | echo " ! ========================================================" |
| 1104 | echo " ! proxy output:" |
| 1105 | cat o-pxy-${TESTS}.log |
| 1106 | fi |
| 1107 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1108 | fi |
| 1109 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1110 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1111 | } |
| 1112 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1113 | # is_polar <cmd_line> |
| 1114 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1115 | case "$1" in |
| 1116 | *ssl_client2*) true;; |
| 1117 | *ssl_server2*) true;; |
| 1118 | *) false;; |
| 1119 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1120 | } |
| 1121 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1122 | # openssl s_server doesn't have -www with DTLS |
| 1123 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1124 | case "$SRV_CMD" in |
| 1125 | *s_server*-dtls*) |
| 1126 | NEEDS_INPUT=1 |
| 1127 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1128 | *) NEEDS_INPUT=0;; |
| 1129 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1130 | } |
| 1131 | |
| 1132 | # provide input to commands that need it |
| 1133 | provide_input() { |
| 1134 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1135 | return |
| 1136 | fi |
| 1137 | |
| 1138 | while true; do |
| 1139 | echo "HTTP/1.0 200 OK" |
| 1140 | sleep 1 |
| 1141 | done |
| 1142 | } |
| 1143 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1144 | # has_mem_err <log_file_name> |
| 1145 | has_mem_err() { |
| 1146 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1147 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1148 | then |
| 1149 | return 1 # false: does not have errors |
| 1150 | else |
| 1151 | return 0 # true: has errors |
| 1152 | fi |
| 1153 | } |
| 1154 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1155 | # 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] | 1156 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1157 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1158 | newline=' |
| 1159 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1160 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1161 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1162 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1163 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1164 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1165 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1166 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1167 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1168 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1169 | # When we use a proxy, it will be listening on the same port we |
| 1170 | # 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] | 1171 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1172 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1173 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1174 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1175 | echo "$3 START TIMEOUT" |
| 1176 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1177 | break |
| 1178 | fi |
| 1179 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1180 | # OSes this may be a tight loop. |
| 1181 | sleep 0.1 2>/dev/null || true |
| 1182 | done |
| 1183 | } |
| 1184 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1185 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1186 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1187 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1188 | } |
| 1189 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1190 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1191 | # Wait for server process $2 to be listening on port $1. |
| 1192 | wait_server_start() { |
| 1193 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1194 | } |
| 1195 | |
| 1196 | # Wait for proxy process $2 to be listening on port $1. |
| 1197 | wait_proxy_start() { |
| 1198 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1199 | } |
| 1200 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1201 | # 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] | 1202 | # 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] | 1203 | # acceptable bounds |
| 1204 | check_server_hello_time() { |
| 1205 | # 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] | 1206 | 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] | 1207 | # Get the Unix timestamp for now |
| 1208 | CUR_TIME=$(date +'%s') |
| 1209 | THRESHOLD_IN_SECS=300 |
| 1210 | |
| 1211 | # Check if the ServerHello time was printed |
| 1212 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1213 | return 1 |
| 1214 | fi |
| 1215 | |
| 1216 | # Check the time in ServerHello is within acceptable bounds |
| 1217 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1218 | # The time in ServerHello is at least 5 minutes before now |
| 1219 | return 1 |
| 1220 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1221 | # 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] | 1222 | return 1 |
| 1223 | else |
| 1224 | return 0 |
| 1225 | fi |
| 1226 | } |
| 1227 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1228 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1229 | handshake_memory_get() { |
| 1230 | OUTPUT_VARIABLE="$1" |
| 1231 | OUTPUT_FILE="$2" |
| 1232 | |
| 1233 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1234 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1235 | |
| 1236 | # Check if memory usage was read |
| 1237 | if [ -z "$MEM_USAGE" ]; then |
| 1238 | echo "Error: Can not read the value of handshake memory usage" |
| 1239 | return 1 |
| 1240 | else |
| 1241 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1242 | return 0 |
| 1243 | fi |
| 1244 | } |
| 1245 | |
| 1246 | # Get handshake memory usage from server or client output and check if this value |
| 1247 | # is not higher than the maximum given by the first argument |
| 1248 | handshake_memory_check() { |
| 1249 | MAX_MEMORY="$1" |
| 1250 | OUTPUT_FILE="$2" |
| 1251 | |
| 1252 | # Get memory usage |
| 1253 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1254 | return 1 |
| 1255 | fi |
| 1256 | |
| 1257 | # Check if memory usage is below max value |
| 1258 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1259 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1260 | "but should be below $MAX_MEMORY bytes" |
| 1261 | return 1 |
| 1262 | else |
| 1263 | return 0 |
| 1264 | fi |
| 1265 | } |
| 1266 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1267 | # wait for client to terminate and set CLI_EXIT |
| 1268 | # must be called right after starting the client |
| 1269 | wait_client_done() { |
| 1270 | CLI_PID=$! |
| 1271 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1272 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1273 | CLI_DELAY_FACTOR=1 |
| 1274 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1275 | ( 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] | 1276 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1277 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1278 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1279 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1280 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1281 | CLI_EXIT=$? |
| 1282 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1283 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1284 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1285 | |
| 1286 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1287 | |
| 1288 | sleep $SRV_DELAY_SECONDS |
| 1289 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1290 | } |
| 1291 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1292 | # check if the given command uses dtls and sets global variable DTLS |
| 1293 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1294 | case "$1" in |
Gilles Peskine | 9d104e9 | 2024-09-04 16:51:50 +0200 | [diff] [blame] | 1295 | *dtls=1*|*-dtls*|*-u*|*/dtls_*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1296 | *) DTLS=0;; |
| 1297 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1298 | } |
| 1299 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1300 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1301 | is_gnutls() { |
| 1302 | case "$1" in |
| 1303 | *gnutls-cli*) |
| 1304 | CMD_IS_GNUTLS=1 |
| 1305 | ;; |
| 1306 | *gnutls-serv*) |
| 1307 | CMD_IS_GNUTLS=1 |
| 1308 | ;; |
| 1309 | *) |
| 1310 | CMD_IS_GNUTLS=0 |
| 1311 | ;; |
| 1312 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1313 | } |
| 1314 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1315 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1316 | # 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] | 1317 | # and client command lines, given as input, to verify if the current test |
| 1318 | # is using one of these tools. |
| 1319 | use_ext_tool_without_ecdh_support() { |
| 1320 | case "$1" in |
| 1321 | *$GNUTLS_SERV*|\ |
| 1322 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1323 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1324 | echo "yes" |
| 1325 | return;; |
| 1326 | esac |
| 1327 | case "$2" in |
| 1328 | *$GNUTLS_CLI*|\ |
| 1329 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1330 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1331 | echo "yes" |
| 1332 | return;; |
| 1333 | esac |
| 1334 | echo "no" |
| 1335 | } |
| 1336 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1337 | # Generate random psk_list argument for ssl_server2 |
| 1338 | get_srv_psk_list () |
| 1339 | { |
| 1340 | case $(( TESTS % 3 )) in |
| 1341 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1342 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1343 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1344 | esac |
| 1345 | } |
| 1346 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1347 | # Determine what calc_verify trace is to be expected, if any. |
| 1348 | # |
| 1349 | # calc_verify is only called for two things: to calculate the |
| 1350 | # extended master secret, and to process client authentication. |
| 1351 | # |
| 1352 | # Warning: the current implementation assumes that extended_ms is not |
| 1353 | # disabled on the client or on the server. |
| 1354 | # |
| 1355 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1356 | # * $1: the value of the server auth_mode parameter. |
| 1357 | # 'required' if client authentication is expected, |
| 1358 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1359 | # * $CONFIGS_ENABLED |
| 1360 | # |
| 1361 | # Outputs: |
| 1362 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1363 | set_maybe_calc_verify() { |
| 1364 | maybe_calc_verify= |
| 1365 | case $CONFIGS_ENABLED in |
| 1366 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1367 | *) |
| 1368 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1369 | ''|none) return;; |
| 1370 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1371 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1372 | esac |
| 1373 | esac |
| 1374 | case $CONFIGS_ENABLED in |
| 1375 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1376 | *) maybe_calc_verify="<= calc verify";; |
| 1377 | esac |
| 1378 | } |
| 1379 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1380 | # Compare file content |
| 1381 | # Usage: find_in_both pattern file1 file2 |
| 1382 | # extract from file1 the first line matching the pattern |
| 1383 | # check in file2 that the same line can be found |
| 1384 | find_in_both() { |
| 1385 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1386 | if [ -z "$srv_pattern" ]; then |
| 1387 | return 1; |
| 1388 | fi |
| 1389 | |
| 1390 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1391 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1392 | else |
| 1393 | return 1; |
| 1394 | fi |
| 1395 | } |
| 1396 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1397 | SKIP_HANDSHAKE_CHECK="NO" |
| 1398 | skip_handshake_stage_check() { |
| 1399 | SKIP_HANDSHAKE_CHECK="YES" |
| 1400 | } |
| 1401 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1402 | # Analyze the commands that will be used in a test. |
| 1403 | # |
| 1404 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1405 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1406 | # |
| 1407 | # Inputs: |
| 1408 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1409 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1410 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1411 | # |
| 1412 | # Outputs: |
| 1413 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1414 | analyze_test_commands() { |
Gilles Peskine | f8b373e | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1415 | # If the test uses DTLS, does not force a specific port, and does not |
| 1416 | # specify a custom proxy, add a simple proxy. |
| 1417 | # It provides timing info that's useful to debug failures. |
| 1418 | if [ "$DTLS" -eq 1 ] && |
| 1419 | [ "$THIS_SRV_PORT" = "$SRV_PORT" ] && |
| 1420 | [ -z "$PXY_CMD" ] |
| 1421 | then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1422 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1423 | case " $SRV_CMD " in |
| 1424 | *' server_addr=::1 '*) |
| 1425 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1426 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1427 | fi |
| 1428 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1429 | # update CMD_IS_GNUTLS variable |
| 1430 | is_gnutls "$SRV_CMD" |
| 1431 | |
| 1432 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1433 | # set the default priority |
| 1434 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1435 | case "$SRV_CMD" in |
| 1436 | *--priority*) :;; |
| 1437 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1438 | esac |
| 1439 | fi |
| 1440 | |
| 1441 | # update CMD_IS_GNUTLS variable |
| 1442 | is_gnutls "$CLI_CMD" |
| 1443 | |
| 1444 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1445 | # set the default priority |
| 1446 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1447 | case "$CLI_CMD" in |
| 1448 | *--priority*) :;; |
| 1449 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1450 | esac |
| 1451 | fi |
| 1452 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1453 | # fix client port |
| 1454 | if [ -n "$PXY_CMD" ]; then |
| 1455 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1456 | else |
Gilles Peskine | 6c798ef | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1457 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$THIS_SRV_PORT/g ) |
| 1458 | fi |
| 1459 | |
| 1460 | # If the test forces a specific port and the server is OpenSSL or |
| 1461 | # GnuTLS, override its port specification. |
| 1462 | if [ "$THIS_SRV_PORT" != "$SRV_PORT" ]; then |
| 1463 | case "$SRV_CMD" in |
Gilles Peskine | 8d64fe1 | 2024-09-04 23:33:36 +0200 | [diff] [blame] | 1464 | "$G_SRV"*|"$G_NEXT_SRV"*) |
| 1465 | SRV_CMD=$( |
| 1466 | printf %s "$SRV_CMD " | |
| 1467 | sed -e "s/ -p $SRV_PORT / -p $THIS_SRV_PORT /" |
| 1468 | );; |
Gilles Peskine | 6c798ef | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1469 | "$O_SRV"*|"$O_NEXT_SRV"*) SRV_CMD="$SRV_CMD -accept $THIS_SRV_PORT";; |
| 1470 | esac |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1471 | fi |
| 1472 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1473 | # prepend valgrind to our commands if active |
| 1474 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1475 | if is_polar "$SRV_CMD"; then |
| 1476 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1477 | fi |
| 1478 | if is_polar "$CLI_CMD"; then |
| 1479 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1480 | fi |
| 1481 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1482 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1483 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1484 | # Check for failure conditions after a test case. |
| 1485 | # |
| 1486 | # Inputs from run_test: |
| 1487 | # * positional parameters: test options (see run_test documentation) |
| 1488 | # * $CLI_EXIT: client return code |
| 1489 | # * $CLI_EXPECT: expected client return code |
| 1490 | # * $SRV_RET: server return code |
| 1491 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1492 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1493 | # |
| 1494 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1495 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1496 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1497 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1498 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1499 | if [ $TIMES_LEFT -gt 0 ] && |
| 1500 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1501 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1502 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1503 | return |
| 1504 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1505 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1506 | # 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] | 1507 | # (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] | 1508 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1509 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1510 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1511 | then |
| 1512 | if is_polar "$SRV_CMD"; then |
| 1513 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1514 | else |
| 1515 | fail "server or client failed to reach handshake stage" |
| 1516 | return |
| 1517 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1518 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1519 | if is_polar "$CLI_CMD"; then |
| 1520 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1521 | else |
| 1522 | fail "server or client failed to reach handshake stage" |
| 1523 | return |
| 1524 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1525 | fi |
| 1526 | fi |
| 1527 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1528 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1529 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1530 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1531 | # care anyway), in case e.g. the server reports a memory leak. |
| 1532 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1533 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1534 | return |
| 1535 | fi |
| 1536 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1537 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1538 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1539 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1540 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1541 | 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] | 1542 | return |
| 1543 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1544 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1545 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1546 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1547 | # 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] | 1548 | while [ $# -gt 0 ] |
| 1549 | do |
| 1550 | case $1 in |
| 1551 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1552 | 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] | 1553 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1554 | return |
| 1555 | fi |
| 1556 | ;; |
| 1557 | |
| 1558 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1559 | 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] | 1560 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1561 | return |
| 1562 | fi |
| 1563 | ;; |
| 1564 | |
| 1565 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1566 | 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] | 1567 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1568 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1569 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1570 | return |
| 1571 | fi |
| 1572 | ;; |
| 1573 | |
| 1574 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1575 | 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] | 1576 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1577 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1578 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1579 | return |
| 1580 | fi |
| 1581 | ;; |
| 1582 | |
| 1583 | # The filtering in the following two options (-u and -U) do the following |
| 1584 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1585 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1586 | # - keep one of each non-unique line |
| 1587 | # - count how many lines remain |
| 1588 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1589 | # if there were no duplicates. |
| 1590 | "-U") |
| 1591 | 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 |
| 1592 | fail "lines following pattern '$2' must be unique in Server output" |
| 1593 | return |
| 1594 | fi |
| 1595 | ;; |
| 1596 | |
| 1597 | "-u") |
| 1598 | 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 |
| 1599 | 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] | 1600 | return |
| 1601 | fi |
| 1602 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1603 | "-F") |
| 1604 | if ! $2 "$SRV_OUT"; then |
| 1605 | fail "function call to '$2' failed on Server output" |
| 1606 | return |
| 1607 | fi |
| 1608 | ;; |
| 1609 | "-f") |
| 1610 | if ! $2 "$CLI_OUT"; then |
| 1611 | fail "function call to '$2' failed on Client output" |
| 1612 | return |
| 1613 | fi |
| 1614 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1615 | "-g") |
| 1616 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1617 | fail "function call to '$2' failed on Server and Client output" |
| 1618 | return |
| 1619 | fi |
| 1620 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1621 | |
| 1622 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1623 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1624 | exit 1 |
| 1625 | esac |
| 1626 | shift 2 |
| 1627 | done |
| 1628 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1629 | # check valgrind's results |
| 1630 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1631 | 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] | 1632 | fail "Server has memory errors" |
| 1633 | return |
| 1634 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1635 | 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] | 1636 | fail "Client has memory errors" |
| 1637 | return |
| 1638 | fi |
| 1639 | fi |
| 1640 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1641 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1642 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1643 | } |
| 1644 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1645 | # Run the current test case: start the server and if applicable the proxy, run |
| 1646 | # the client, wait for all processes to finish or time out. |
| 1647 | # |
| 1648 | # Inputs: |
| 1649 | # * $NAME: test case name |
| 1650 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1651 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1652 | # |
| 1653 | # Outputs: |
| 1654 | # * $CLI_EXIT: client return code |
| 1655 | # * $SRV_RET: server return code |
| 1656 | do_run_test_once() { |
| 1657 | # run the commands |
| 1658 | if [ -n "$PXY_CMD" ]; then |
| 1659 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1660 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1661 | PXY_PID=$! |
| 1662 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1663 | fi |
| 1664 | |
| 1665 | check_osrv_dtls |
| 1666 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1667 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1668 | SRV_PID=$! |
Gilles Peskine | 6c798ef | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1669 | wait_server_start "$THIS_SRV_PORT" "$SRV_PID" |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1670 | |
| 1671 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1672 | # The client must be a subprocess of the script in order for killing it to |
| 1673 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1674 | # not at the end of the line: the latter approach will spawn eval as a |
| 1675 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1676 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1677 | wait_client_done |
| 1678 | |
| 1679 | sleep 0.05 |
| 1680 | |
| 1681 | # terminate the server (and the proxy) |
| 1682 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1683 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1684 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1685 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1686 | SRV_RET=$? |
| 1687 | |
| 1688 | if [ -n "$PXY_CMD" ]; then |
| 1689 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1690 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1691 | fi |
| 1692 | } |
| 1693 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1694 | # 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] | 1695 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1696 | # |
| 1697 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1698 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1699 | # for the sake of tests' filtering (especially in conjunction with the |
| 1700 | # detect_required_features() function), it does NOT guarantee that the |
| 1701 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1702 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1703 | # that we are going to use TLS 1.2 |
| 1704 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1705 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1706 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1707 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1708 | *tls12*) |
| 1709 | echo "TLS12" |
| 1710 | return;; |
| 1711 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1712 | echo "TLS13" |
| 1713 | return;; |
| 1714 | esac |
| 1715 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1716 | *tls12*) |
| 1717 | echo "TLS12" |
| 1718 | return;; |
| 1719 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1720 | echo "TLS13" |
| 1721 | return;; |
| 1722 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1723 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1724 | case $1 in |
| 1725 | tls1_2*) |
| 1726 | echo "TLS12" |
| 1727 | return;; |
| 1728 | *tls1_3) |
| 1729 | echo "TLS13" |
| 1730 | return;; |
| 1731 | esac |
| 1732 | case $2 in |
| 1733 | *tls1_2) |
| 1734 | echo "TLS12" |
| 1735 | return;; |
| 1736 | *tls1_3) |
| 1737 | echo "TLS13" |
| 1738 | return;; |
| 1739 | esac |
| 1740 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1741 | # is aimed to run a TLS 1.3 handshake. |
Gilles Peskine | 0bc5729 | 2024-09-06 14:43:17 +0200 | [diff] [blame] | 1742 | if is_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1743 | then |
| 1744 | echo "TLS13" |
| 1745 | else |
| 1746 | echo "TLS12" |
| 1747 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1748 | } |
| 1749 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1750 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1751 | # Options: -s pattern pattern that must be present in server output |
| 1752 | # -c pattern pattern that must be present in client output |
| 1753 | # -u pattern lines after pattern must be unique in client output |
| 1754 | # -f call shell function on client output |
| 1755 | # -S pattern pattern that must be absent in server output |
| 1756 | # -C pattern pattern that must be absent in client output |
| 1757 | # -U pattern lines after pattern must be unique in server output |
| 1758 | # -F call shell function on server output |
| 1759 | # -g call shell function on server and client output |
| 1760 | run_test() { |
| 1761 | NAME="$1" |
| 1762 | shift 1 |
| 1763 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1764 | if is_excluded "$NAME"; then |
| 1765 | SKIP_NEXT="NO" |
| 1766 | # There was no request to run the test, so don't record its outcome. |
| 1767 | return |
| 1768 | fi |
| 1769 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1770 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1771 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1772 | return |
| 1773 | fi |
| 1774 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1775 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1776 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1777 | # Do not skip next test and skip current test. |
| 1778 | SKIP_NEXT="NO" |
| 1779 | return |
| 1780 | fi |
| 1781 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1782 | print_name "$NAME" |
| 1783 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1784 | # Do we only run numbered tests? |
| 1785 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1786 | case ",$RUN_TEST_NUMBER," in |
| 1787 | *",$TESTS,"*) :;; |
| 1788 | *) SKIP_NEXT="YES";; |
| 1789 | esac |
| 1790 | fi |
| 1791 | |
Gilles Peskine | f8b373e | 2024-09-04 16:07:56 +0200 | [diff] [blame] | 1792 | # Does this test specify a proxy? |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1793 | if [ "X$1" = "X-p" ]; then |
| 1794 | PXY_CMD="$2" |
| 1795 | shift 2 |
| 1796 | else |
| 1797 | PXY_CMD="" |
| 1798 | fi |
| 1799 | |
Gilles Peskine | 6c798ef | 2024-09-04 16:05:11 +0200 | [diff] [blame] | 1800 | # Does this test force a specific port? |
| 1801 | if [ "$1" = "-P" ]; then |
| 1802 | THIS_SRV_PORT="$2" |
| 1803 | shift 2 |
| 1804 | else |
| 1805 | THIS_SRV_PORT="$SRV_PORT" |
| 1806 | fi |
| 1807 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1808 | # get commands and client output |
| 1809 | SRV_CMD="$1" |
| 1810 | CLI_CMD="$2" |
| 1811 | CLI_EXPECT="$3" |
| 1812 | shift 3 |
| 1813 | |
| 1814 | # Check if test uses files |
| 1815 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1816 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1817 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1818 | esac |
| 1819 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1820 | # Check if the test uses DTLS. |
| 1821 | detect_dtls "$SRV_CMD" |
| 1822 | if [ "$DTLS" -eq 1 ]; then |
| 1823 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1824 | fi |
| 1825 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1826 | # 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] | 1827 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1828 | |
Gilles Peskine | 927f2f1 | 2024-09-11 21:03:05 +0200 | [diff] [blame] | 1829 | # Guess the TLS version which is going to be used. |
| 1830 | # Note that this detection is wrong in some cases, which causes unduly |
| 1831 | # skipped test cases in builds with TLS 1.3 but not TLS 1.2. |
| 1832 | # https://github.com/Mbed-TLS/mbedtls/issues/9560 |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1833 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1834 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1835 | else |
| 1836 | TLS_VERSION="TLS12" |
| 1837 | fi |
| 1838 | |
Gilles Peskine | 5c766dc | 2024-09-06 15:35:58 +0200 | [diff] [blame] | 1839 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1840 | maybe_adapt_for_psk "$@" |
| 1841 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1842 | # 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] | 1843 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1844 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1845 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1846 | |
| 1847 | # should we skip? |
| 1848 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1849 | SKIP_NEXT="NO" |
| 1850 | record_outcome "SKIP" |
| 1851 | SKIPS=$(( $SKIPS + 1 )) |
| 1852 | return |
| 1853 | fi |
| 1854 | |
| 1855 | analyze_test_commands "$@" |
| 1856 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1857 | # One regular run and two retries |
| 1858 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1859 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1860 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1861 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1862 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1863 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1864 | check_test_failure "$@" |
| 1865 | case $outcome in |
| 1866 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1867 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1868 | FAIL) return;; |
| 1869 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1870 | done |
| 1871 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1872 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1873 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1874 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1875 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1876 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1877 | if [ -n "$PXY_CMD" ]; then |
| 1878 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1879 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1880 | fi |
| 1881 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1882 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1883 | } |
| 1884 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1885 | run_test_psa() { |
| 1886 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1887 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1888 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1889 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1890 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1891 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1892 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1893 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1894 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1895 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +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."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1898 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1899 | -S "error" \ |
| 1900 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1901 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1902 | } |
| 1903 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1904 | run_test_psa_force_curve() { |
| 1905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1906 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1907 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1908 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1909 | "$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] | 1910 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1911 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1912 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1913 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1914 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1915 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1916 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1917 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1918 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1919 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1920 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1921 | } |
| 1922 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1923 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1924 | # a maximum fragment length. |
| 1925 | # first argument ($1) is MFL for SSL client |
| 1926 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1927 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1928 | { |
| 1929 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1930 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1931 | |
| 1932 | # Leave some margin for robustness |
| 1933 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1934 | |
| 1935 | run_test "Handshake memory usage (MFL $1)" \ |
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 | 5ab92be | 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 max_frag_len=$1" \ |
| 1940 | 0 \ |
| 1941 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1942 | } |
| 1943 | |
| 1944 | |
| 1945 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1946 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1947 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1948 | { |
| 1949 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1950 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1951 | |
| 1952 | # first test with default MFU is to get reference memory usage |
| 1953 | MEMORY_USAGE_MFL_16K=0 |
| 1954 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1955 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1956 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1957 | 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] | 1958 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1959 | 0 \ |
| 1960 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1961 | |
| 1962 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1963 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1964 | |
| 1965 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1966 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1967 | |
| 1968 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1969 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1970 | |
| 1971 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1972 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1973 | } |
| 1974 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1975 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1976 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1977 | rm -f context_srv.txt |
| 1978 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1979 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1980 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1981 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1982 | 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] | 1983 | exit 1 |
| 1984 | } |
| 1985 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1986 | # |
| 1987 | # MAIN |
| 1988 | # |
| 1989 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1990 | # Make the outcome file path relative to the original directory, not |
| 1991 | # to .../tests |
| 1992 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1993 | [!/]*) |
| 1994 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1995 | ;; |
| 1996 | esac |
| 1997 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1998 | populate_enabled_hash_algs |
| 1999 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2000 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 2001 | # patterns rather than regular expressions, use a case statement instead |
| 2002 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 2003 | # detects simple cases: plain substring, everything, nothing. |
| 2004 | # |
| 2005 | # As an exception, the character '.' is treated as an ordinary character |
| 2006 | # if it is the only special character in the string. This is because it's |
| 2007 | # rare to need "any one character", but needing a literal '.' is common |
| 2008 | # (e.g. '-f "DTLS 1.2"'). |
| 2009 | need_grep= |
| 2010 | case "$FILTER" in |
| 2011 | '^$') simple_filter=;; |
| 2012 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 2013 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2014 | need_grep=1;; |
| 2015 | *) # No regexp or shell-pattern special character |
| 2016 | simple_filter="*$FILTER*";; |
| 2017 | esac |
| 2018 | case "$EXCLUDE" in |
| 2019 | '^$') simple_exclude=;; |
| 2020 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 2021 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 2022 | need_grep=1;; |
| 2023 | *) # No regexp or shell-pattern special character |
| 2024 | simple_exclude="*$EXCLUDE*";; |
| 2025 | esac |
| 2026 | if [ -n "$need_grep" ]; then |
| 2027 | is_excluded () { |
| 2028 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 2029 | } |
| 2030 | else |
| 2031 | is_excluded () { |
| 2032 | case "$1" in |
| 2033 | $simple_exclude) true;; |
| 2034 | $simple_filter) false;; |
| 2035 | *) true;; |
| 2036 | esac |
| 2037 | } |
| 2038 | fi |
| 2039 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 2040 | # Filter tests according to TEST_SUITE_NAME |
| 2041 | is_excluded_test_suite () { |
| 2042 | if [ -n "$RUN_TEST_SUITE" ] |
| 2043 | then |
| 2044 | case ",$RUN_TEST_SUITE," in |
| 2045 | *",$1,"*) false;; |
| 2046 | *) true;; |
| 2047 | esac |
| 2048 | else |
| 2049 | false |
| 2050 | fi |
| 2051 | |
| 2052 | } |
| 2053 | |
| 2054 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2055 | if [ "$LIST_TESTS" -eq 0 ];then |
| 2056 | |
| 2057 | # sanity checks, avoid an avalanche of errors |
| 2058 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 2059 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 2060 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 2061 | if [ ! -x "$P_SRV_BIN" ]; then |
| 2062 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2063 | exit 1 |
| 2064 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 2065 | if [ ! -x "$P_CLI_BIN" ]; then |
| 2066 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 2067 | exit 1 |
| 2068 | fi |
| 2069 | if [ ! -x "$P_PXY_BIN" ]; then |
| 2070 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 2071 | exit 1 |
| 2072 | fi |
| 2073 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2074 | if which valgrind >/dev/null 2>&1; then :; else |
| 2075 | echo "Memcheck not possible. Valgrind not found" |
| 2076 | exit 1 |
| 2077 | fi |
| 2078 | fi |
| 2079 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 2080 | echo "Command '$OPENSSL' not found" |
| 2081 | exit 1 |
| 2082 | fi |
| 2083 | |
| 2084 | # used by watchdog |
| 2085 | MAIN_PID="$$" |
| 2086 | |
| 2087 | # We use somewhat arbitrary delays for tests: |
| 2088 | # - how long do we wait for the server to start (when lsof not available)? |
| 2089 | # - how long do we allow for the client to finish? |
| 2090 | # (not to check performance, just to avoid waiting indefinitely) |
| 2091 | # Things are slower with valgrind, so give extra time here. |
| 2092 | # |
| 2093 | # Note: without lsof, there is a trade-off between the running time of this |
| 2094 | # script and the risk of spurious errors because we didn't wait long enough. |
| 2095 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 2096 | # the script, only the case where a client or server gets stuck. |
| 2097 | if [ "$MEMCHECK" -gt 0 ]; then |
| 2098 | START_DELAY=6 |
| 2099 | DOG_DELAY=60 |
| 2100 | else |
| 2101 | START_DELAY=2 |
| 2102 | DOG_DELAY=20 |
| 2103 | fi |
| 2104 | |
| 2105 | # some particular tests need more time: |
| 2106 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2107 | # - for the server, we sleep for a number of seconds after the client exits |
| 2108 | # see client_need_more_time() and server_needs_more_time() |
| 2109 | CLI_DELAY_FACTOR=1 |
| 2110 | SRV_DELAY_SECONDS=0 |
| 2111 | |
| 2112 | # fix commands to use this port, force IPv4 while at it |
| 2113 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2114 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2115 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2116 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2117 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2118 | 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"}" |
| 2119 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2120 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2121 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2122 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2123 | |
| 2124 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2125 | # low-security ones. This covers not just cipher suites but also protocol |
| 2126 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2127 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2128 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2129 | # a way to discover it from -help, so check the openssl version. |
| 2130 | case $($OPENSSL version) in |
| 2131 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2132 | *) |
| 2133 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2134 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2135 | ;; |
| 2136 | esac |
| 2137 | |
| 2138 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2139 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2140 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2141 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2142 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2143 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2144 | fi |
| 2145 | |
| 2146 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2147 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2148 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2149 | fi |
| 2150 | |
| 2151 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2152 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2153 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2154 | fi |
| 2155 | |
| 2156 | # Allow SHA-1, because many of our test certificates use it |
| 2157 | P_SRV="$P_SRV allow_sha1=1" |
| 2158 | P_CLI="$P_CLI allow_sha1=1" |
| 2159 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2160 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2161 | # Also pick a unique name for intermediate files |
| 2162 | SRV_OUT="srv_out.$$" |
| 2163 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2164 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2165 | SESSION="session.$$" |
| 2166 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2167 | SKIP_NEXT="NO" |
| 2168 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2169 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2170 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2171 | # Basic test |
| 2172 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2173 | # Checks that: |
| 2174 | # - 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] | 2175 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2176 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2177 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2178 | requires_any_configs_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2179 | PSA_WANT_ECC_MONTGOMERY_255 |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2180 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2181 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2182 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2183 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2184 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2185 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2186 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2187 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2188 | -S "error" \ |
| 2189 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2192 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2193 | run_test "Default, DTLS" \ |
| 2194 | "$P_SRV dtls=1" \ |
| 2195 | "$P_CLI dtls=1" \ |
| 2196 | 0 \ |
| 2197 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2198 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2199 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2200 | run_test "TLS client auth: required" \ |
| 2201 | "$P_SRV auth_mode=required" \ |
| 2202 | "$P_CLI" \ |
| 2203 | 0 \ |
| 2204 | -s "Verifying peer X.509 certificate... ok" |
| 2205 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2206 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2207 | "$P_SRV" \ |
| 2208 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2209 | 0 \ |
| 2210 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2211 | -c "Key size is 256" |
| 2212 | |
| 2213 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2214 | "$P_SRV" \ |
| 2215 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2216 | 0 \ |
| 2217 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2218 | -c "Key size is 128" |
| 2219 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2221 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2222 | # module does not support PSA dispatching so we need builtin support. |
| 2223 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2224 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2225 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2226 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2227 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2228 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2229 | "$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] | 2230 | 0 |
| 2231 | |
| 2232 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2233 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2234 | # module does not support PSA dispatching so we need builtin support. |
| 2235 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2236 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2237 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2238 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2239 | run_test "TLS: password protected server key" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2240 | "$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] | 2241 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2242 | 0 |
| 2243 | |
| 2244 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2246 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2247 | # module does not support PSA dispatching so we need builtin support. |
| 2248 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2249 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2250 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2251 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2252 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2253 | "$P_SRV force_version=tls12\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2254 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2255 | 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] | 2256 | "$P_CLI" \ |
| 2257 | 0 |
| 2258 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2260 | run_test "CA callback on client" \ |
| 2261 | "$P_SRV debug_level=3" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2262 | "$P_CLI ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2263 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2264 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2265 | -S "error" \ |
| 2266 | -C "error" |
| 2267 | |
| 2268 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2269 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2270 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2271 | run_test "CA callback on server" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 2272 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2273 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2274 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2275 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2276 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2277 | -s "Verifying peer X.509 certificate... ok" \ |
| 2278 | -S "error" \ |
| 2279 | -C "error" |
| 2280 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2281 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2283 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2284 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2285 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2286 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2287 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2288 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2289 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2290 | 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] | 2291 | 0 \ |
| 2292 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2293 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2294 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2295 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2296 | -S "error" \ |
| 2297 | -C "error" |
| 2298 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2299 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2300 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2301 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2303 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2304 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2305 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2306 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2307 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2308 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2309 | 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] | 2310 | 0 \ |
| 2311 | -c "key type: Opaque" \ |
| 2312 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2313 | -s "Verifying peer X.509 certificate... ok" \ |
| 2314 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2315 | -S "error" \ |
| 2316 | -C "error" |
| 2317 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2318 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2319 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2320 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2321 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2322 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2323 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2324 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2325 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2326 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2327 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2328 | 0 \ |
| 2329 | -c "key type: Opaque" \ |
| 2330 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2331 | -s "Verifying peer X.509 certificate... ok" \ |
| 2332 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2333 | -S "error" \ |
| 2334 | -C "error" |
| 2335 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2336 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 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 | 5ab92be | 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_USE_PSA_CRYPTO |
| 2354 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2355 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2356 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2357 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2358 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2359 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2360 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2361 | 0 \ |
| 2362 | -c "Verifying peer X.509 certificate... ok" \ |
| 2363 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2364 | -s "key types: Opaque, none" \ |
| 2365 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2366 | -S "error" \ |
| 2367 | -C "error" |
| 2368 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2370 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2371 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2372 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2373 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2374 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2375 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 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_USE_PSA_CRYPTO |
| 2385 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2386 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2387 | requires_config_enabled MBEDTLS_RSA_C |
| 2388 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2389 | requires_hash_alg SHA_256 |
| 2390 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2391 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2392 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2393 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2394 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2395 | 1 \ |
| 2396 | -s "key types: Opaque, none" \ |
| 2397 | -s "error" \ |
| 2398 | -c "error" \ |
| 2399 | -c "Public key type mismatch" |
| 2400 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2401 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2402 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2403 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2404 | requires_hash_alg SHA_256 |
| 2405 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2406 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2407 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2408 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2409 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2410 | 1 \ |
| 2411 | -s "key types: Opaque, none" \ |
| 2412 | -s "got ciphersuites in common, but none of them usable" \ |
| 2413 | -s "error" \ |
| 2414 | -c "error" |
| 2415 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2416 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2417 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2420 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2421 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2422 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2423 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2424 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2425 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2426 | 1 \ |
| 2427 | -s "key types: Opaque, none" \ |
| 2428 | -s "got ciphersuites in common, but none of them usable" \ |
| 2429 | -s "error" \ |
| 2430 | -c "error" |
| 2431 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2432 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2433 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2434 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2435 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2436 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2437 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2438 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2439 | "$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] | 2440 | 1 \ |
| 2441 | -s "key types: Opaque, none" \ |
| 2442 | -s "got ciphersuites in common, but none of them usable" \ |
| 2443 | -s "error" \ |
| 2444 | -c "error" |
| 2445 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2447 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2448 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2449 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2450 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2451 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2452 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2453 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2454 | 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] | 2455 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2456 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2457 | 0 \ |
| 2458 | -c "Verifying peer X.509 certificate... ok" \ |
| 2459 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2460 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2461 | -s "key types: Opaque, Opaque" \ |
| 2462 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2463 | -S "error" \ |
| 2464 | -C "error" |
| 2465 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2467 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2468 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2469 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2470 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2471 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2472 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2473 | 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] | 2474 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2475 | "$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] | 2476 | 0 \ |
| 2477 | -c "Verifying peer X.509 certificate... ok" \ |
| 2478 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2479 | -c "CN=Polarssl Test EC CA" \ |
| 2480 | -s "key types: Opaque, Opaque" \ |
| 2481 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2482 | -S "error" \ |
| 2483 | -C "error" |
| 2484 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2486 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2487 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2488 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2489 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2490 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2491 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2492 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2493 | 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] | 2494 | "$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] | 2495 | 0 \ |
| 2496 | -c "Verifying peer X.509 certificate... ok" \ |
| 2497 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2498 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2499 | -s "key types: Opaque, Opaque" \ |
| 2500 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2501 | -S "error" \ |
| 2502 | -C "error" |
| 2503 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2505 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2506 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2507 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2508 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2509 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2510 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2511 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2512 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2513 | -c "key type: Opaque" \ |
| 2514 | -s "key types: Opaque, Opaque" \ |
| 2515 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2516 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2517 | |
| 2518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2519 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2520 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2522 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2523 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2524 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2525 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2526 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2527 | -c "key type: Opaque" \ |
| 2528 | -s "key types: Opaque, Opaque" \ |
| 2529 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2530 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2531 | |
| 2532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2533 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2534 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2535 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2536 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2537 | 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] | 2538 | "$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] | 2539 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2540 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2541 | -s "key types: Opaque, Opaque" \ |
| 2542 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2543 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2544 | -C "error" \ |
| 2545 | -S "error" \ |
| 2546 | |
| 2547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2548 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2549 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2550 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2551 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2552 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2553 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2554 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2555 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2556 | -c "key type: Opaque" \ |
| 2557 | -s "key types: Opaque, Opaque" \ |
| 2558 | -C "error" \ |
| 2559 | -S "error" \ |
| 2560 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2561 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2563 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2564 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2565 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2566 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2567 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2568 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2569 | 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] | 2570 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2571 | 0 \ |
| 2572 | -c "Verifying peer X.509 certificate... ok" \ |
| 2573 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2574 | -s "key types: Opaque, none" \ |
| 2575 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2576 | -S "error" \ |
| 2577 | -C "error" |
| 2578 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2580 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2581 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2582 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2583 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2584 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2585 | 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] | 2586 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2587 | 0 \ |
| 2588 | -c "Verifying peer X.509 certificate... ok" \ |
| 2589 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2590 | -s "key types: Opaque, none" \ |
| 2591 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2592 | -S "error" \ |
| 2593 | -C "error" |
| 2594 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2596 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2598 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2599 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2600 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2601 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2602 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2603 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2604 | 0 \ |
| 2605 | -c "Verifying peer X.509 certificate... ok" \ |
| 2606 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2607 | -s "key types: Opaque, Opaque" \ |
| 2608 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2609 | -S "error" \ |
| 2610 | -C "error" |
| 2611 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2613 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2614 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2615 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2616 | run_test "Opaque key for server authentication: RSA-" \ |
| 2617 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2618 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2619 | 0 \ |
| 2620 | -c "Verifying peer X.509 certificate... ok" \ |
| 2621 | -c "Ciphersuite is TLS-RSA-" \ |
| 2622 | -s "key types: Opaque, Opaque" \ |
| 2623 | -s "Ciphersuite is TLS-RSA-" \ |
| 2624 | -S "error" \ |
| 2625 | -C "error" |
| 2626 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2627 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2628 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2629 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2630 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2631 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2632 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2633 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2634 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2635 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2636 | 1 \ |
| 2637 | -s "key types: Opaque, none" \ |
| 2638 | -s "got ciphersuites in common, but none of them usable" \ |
| 2639 | -s "error" \ |
| 2640 | -c "error" |
| 2641 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2643 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2644 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2645 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2646 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2647 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2648 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2649 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2650 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2651 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2652 | 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] | 2653 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2654 | 0 \ |
| 2655 | -c "Verifying peer X.509 certificate... ok" \ |
| 2656 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2657 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2658 | -s "key types: Opaque, Opaque" \ |
| 2659 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2660 | -S "error" \ |
| 2661 | -C "error" |
| 2662 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2663 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2664 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2665 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2666 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2667 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2668 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2669 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2670 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2671 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2672 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2673 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2674 | 0 \ |
| 2675 | -c "Verifying peer X.509 certificate... ok" \ |
| 2676 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2677 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2678 | -s "key types: Opaque, Opaque" \ |
| 2679 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2680 | -S "error" \ |
| 2681 | -C "error" |
| 2682 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2683 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2684 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2685 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2687 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2688 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2689 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2690 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2691 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2692 | 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] | 2693 | 0 \ |
| 2694 | -c "key type: Opaque" \ |
| 2695 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2696 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2697 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2698 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2699 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2700 | -S "error" \ |
| 2701 | -C "error" |
| 2702 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2703 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2705 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2707 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2708 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2709 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2710 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2711 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2712 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2713 | 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] | 2714 | 0 \ |
| 2715 | -c "key type: Opaque" \ |
| 2716 | -c "Verifying peer X.509 certificate... ok" \ |
| 2717 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2718 | -s "key types: Opaque, none" \ |
| 2719 | -s "Verifying peer X.509 certificate... ok" \ |
| 2720 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2721 | -S "error" \ |
| 2722 | -C "error" |
| 2723 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2724 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2725 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2726 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2727 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2728 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2729 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2730 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2731 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2732 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2733 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2734 | 0 \ |
| 2735 | -c "key type: Opaque" \ |
| 2736 | -c "Verifying peer X.509 certificate... ok" \ |
| 2737 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2738 | -s "key types: Opaque, none" \ |
| 2739 | -s "Verifying peer X.509 certificate... ok" \ |
| 2740 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2741 | -S "error" \ |
| 2742 | -C "error" |
| 2743 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2744 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2745 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2746 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2747 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2748 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2749 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2750 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2751 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2752 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2753 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2754 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2755 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2756 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2757 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2758 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2759 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2760 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2761 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2762 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2763 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2764 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2765 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2766 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2767 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2768 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2769 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2770 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2771 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2772 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2773 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2774 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2775 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2776 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2777 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2778 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2779 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2780 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2781 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2782 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2783 | run_test_psa_force_curve "secp192k1" |
| 2784 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2785 | # Test current time in ServerHello |
| 2786 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2787 | run_test "ServerHello contains gmt_unix_time" \ |
| 2788 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2789 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2790 | 0 \ |
| 2791 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2792 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2793 | |
| 2794 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2795 | run_test "Unique IV in GCM" \ |
| 2796 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2797 | "$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] | 2798 | 0 \ |
| 2799 | -u "IV used" \ |
| 2800 | -U "IV used" |
| 2801 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2802 | # Test for correctness of sent single supported algorithm |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2803 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2804 | PSA_WANT_ECC_SECP_R1_256 |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2805 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2806 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2807 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2808 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2809 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2810 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2811 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2812 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2813 | "$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] | 2814 | 0 \ |
| 2815 | -c "Supported Signature Algorithm found: 04 03" |
| 2816 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2818 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 07e24e9 | 2024-09-07 19:50:17 +0200 | [diff] [blame] | 2819 | requires_any_configs_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2820 | PSA_WANT_ECC_SECP_R1_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2821 | requires_hash_alg SHA_256 |
| 2822 | run_test "Single supported algorithm sending: openssl client" \ |
| 2823 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2824 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2825 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2826 | 0 |
| 2827 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2828 | # Tests for certificate verification callback |
| 2829 | run_test "Configuration-specific CRT verification callback" \ |
| 2830 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2831 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2832 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2833 | -S "error" \ |
| 2834 | -c "Verify requested for " \ |
| 2835 | -c "Use configuration-specific verification callback" \ |
| 2836 | -C "Use context-specific verification callback" \ |
| 2837 | -C "error" |
| 2838 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2839 | run_test "Context-specific CRT verification callback" \ |
| 2840 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | dee6ffa | 2024-08-16 09:53:41 +0200 | [diff] [blame] | 2841 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2842 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2843 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2844 | -c "Verify requested for " \ |
| 2845 | -c "Use context-specific verification callback" \ |
| 2846 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2847 | -C "error" |
| 2848 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2849 | # Tests for SHA-1 support |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2850 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2851 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2852 | "$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] | 2853 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2854 | 1 \ |
| 2855 | -c "The certificate is signed with an unacceptable hash" |
| 2856 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2857 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2858 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2859 | "$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] | 2860 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2861 | 0 |
| 2862 | |
| 2863 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2864 | "$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] | 2865 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2866 | 0 |
| 2867 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2868 | requires_hash_alg SHA_1 |
| 2869 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2870 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2871 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2872 | "$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] | 2873 | 1 \ |
| 2874 | -s "The certificate is signed with an unacceptable hash" |
| 2875 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2876 | requires_hash_alg SHA_1 |
| 2877 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2878 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2879 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2880 | "$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] | 2881 | 0 |
| 2882 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_RSA_C |
| 2884 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2885 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2886 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2887 | "$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] | 2888 | 0 |
| 2889 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2890 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2892 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2893 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2894 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2895 | 0 \ |
| 2896 | -c "next record in same datagram" \ |
| 2897 | -s "next record in same datagram" |
| 2898 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2900 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2901 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2902 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2903 | 0 \ |
| 2904 | -s "next record in same datagram" \ |
| 2905 | -C "next record in same datagram" |
| 2906 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2908 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2909 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2910 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2911 | 0 \ |
| 2912 | -S "next record in same datagram" \ |
| 2913 | -c "next record in same datagram" |
| 2914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2916 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2917 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2918 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2919 | 0 \ |
| 2920 | -S "next record in same datagram" \ |
| 2921 | -C "next record in same datagram" |
| 2922 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2923 | # Tests for Context serialization |
| 2924 | |
| 2925 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2926 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2927 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2928 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2929 | 0 \ |
| 2930 | -c "Deserializing connection..." \ |
| 2931 | -S "Deserializing connection..." |
| 2932 | |
| 2933 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2934 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2935 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2936 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2937 | 0 \ |
| 2938 | -c "Deserializing connection..." \ |
| 2939 | -S "Deserializing connection..." |
| 2940 | |
| 2941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2942 | run_test "Context serialization, client serializes, GCM" \ |
| 2943 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2944 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2945 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2946 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2947 | -S "Deserializing connection..." |
| 2948 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2952 | run_test "Context serialization, client serializes, with CID" \ |
| 2953 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2954 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2955 | 0 \ |
| 2956 | -c "Deserializing connection..." \ |
| 2957 | -S "Deserializing connection..." |
| 2958 | |
| 2959 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2960 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2961 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2962 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2963 | 0 \ |
| 2964 | -C "Deserializing connection..." \ |
| 2965 | -s "Deserializing connection..." |
| 2966 | |
| 2967 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2968 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2969 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2970 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2971 | 0 \ |
| 2972 | -C "Deserializing connection..." \ |
| 2973 | -s "Deserializing connection..." |
| 2974 | |
| 2975 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2976 | run_test "Context serialization, server serializes, GCM" \ |
| 2977 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2978 | "$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] | 2979 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2980 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2981 | -s "Deserializing connection..." |
| 2982 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2986 | run_test "Context serialization, server serializes, with CID" \ |
| 2987 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2988 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2989 | 0 \ |
| 2990 | -C "Deserializing connection..." \ |
| 2991 | -s "Deserializing connection..." |
| 2992 | |
| 2993 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2994 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2995 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2996 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2997 | 0 \ |
| 2998 | -c "Deserializing connection..." \ |
| 2999 | -s "Deserializing connection..." |
| 3000 | |
| 3001 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3002 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 3003 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 3004 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3005 | 0 \ |
| 3006 | -c "Deserializing connection..." \ |
| 3007 | -s "Deserializing connection..." |
| 3008 | |
| 3009 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3010 | run_test "Context serialization, both serialize, GCM" \ |
| 3011 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 3012 | "$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] | 3013 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 3014 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 3015 | -s "Deserializing connection..." |
| 3016 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3018 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3019 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3020 | run_test "Context serialization, both serialize, with CID" \ |
| 3021 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 3022 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 3023 | 0 \ |
| 3024 | -c "Deserializing connection..." \ |
| 3025 | -s "Deserializing connection..." |
| 3026 | |
| 3027 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3028 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3029 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3030 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3031 | 0 \ |
| 3032 | -c "Deserializing connection..." \ |
| 3033 | -S "Deserializing connection..." |
| 3034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3036 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3037 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 3038 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3039 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3040 | 0 \ |
| 3041 | -c "Deserializing connection..." \ |
| 3042 | -S "Deserializing connection..." |
| 3043 | |
| 3044 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3045 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 3046 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 3047 | "$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] | 3048 | 0 \ |
| 3049 | -c "Deserializing connection..." \ |
| 3050 | -S "Deserializing connection..." |
| 3051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3055 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 3056 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 3057 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3058 | 0 \ |
| 3059 | -c "Deserializing connection..." \ |
| 3060 | -S "Deserializing connection..." |
| 3061 | |
| 3062 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3063 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3064 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3065 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3066 | 0 \ |
| 3067 | -C "Deserializing connection..." \ |
| 3068 | -s "Deserializing connection..." |
| 3069 | |
| 3070 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3071 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 3072 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3073 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3074 | 0 \ |
| 3075 | -C "Deserializing connection..." \ |
| 3076 | -s "Deserializing connection..." |
| 3077 | |
| 3078 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3079 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 3080 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3081 | "$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] | 3082 | 0 \ |
| 3083 | -C "Deserializing connection..." \ |
| 3084 | -s "Deserializing connection..." |
| 3085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 3087 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3088 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3089 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 3090 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3091 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 3092 | 0 \ |
| 3093 | -C "Deserializing connection..." \ |
| 3094 | -s "Deserializing connection..." |
| 3095 | |
| 3096 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3097 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 3098 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 3099 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3100 | 0 \ |
| 3101 | -c "Deserializing connection..." \ |
| 3102 | -s "Deserializing connection..." |
| 3103 | |
| 3104 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3105 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3106 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3107 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3108 | 0 \ |
| 3109 | -c "Deserializing connection..." \ |
| 3110 | -s "Deserializing connection..." |
| 3111 | |
| 3112 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3113 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3114 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3115 | "$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] | 3116 | 0 \ |
| 3117 | -c "Deserializing connection..." \ |
| 3118 | -s "Deserializing connection..." |
| 3119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3121 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3122 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3123 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3124 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3125 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3126 | 0 \ |
| 3127 | -c "Deserializing connection..." \ |
| 3128 | -s "Deserializing connection..." |
| 3129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3131 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3132 | run_test "Saving the serialized context to a file" \ |
| 3133 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3134 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3135 | 0 \ |
| 3136 | -s "Save serialized context to a file... ok" \ |
| 3137 | -c "Save serialized context to a file... ok" |
| 3138 | rm -f context_srv.txt |
| 3139 | rm -f context_cli.txt |
| 3140 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3141 | # Tests for DTLS Connection ID extension |
| 3142 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3143 | # So far, the CID API isn't implemented, so we can't |
| 3144 | # grep for output witnessing its use. This needs to be |
| 3145 | # changed once the CID extension is implemented. |
| 3146 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3149 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3150 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3151 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3152 | 0 \ |
| 3153 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3154 | -s "found CID extension" \ |
| 3155 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3156 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3157 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3158 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3159 | -C "found CID extension" \ |
| 3160 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3161 | -C "Copy CIDs into SSL transform" \ |
| 3162 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3166 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3167 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3168 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3169 | 0 \ |
| 3170 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3171 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3172 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3173 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3174 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3175 | -C "found CID extension" \ |
| 3176 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3177 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3178 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3181 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3182 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3183 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3184 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3185 | 0 \ |
| 3186 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3187 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3188 | -c "client hello, adding CID extension" \ |
| 3189 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3190 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3191 | -s "server hello, adding CID extension" \ |
| 3192 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3193 | -c "Use of CID extension negotiated" \ |
| 3194 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3195 | -c "Copy CIDs into SSL transform" \ |
| 3196 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3197 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3198 | -s "Use of Connection ID has been negotiated" \ |
| 3199 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3203 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3204 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3205 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3206 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3207 | 0 \ |
| 3208 | -c "Enable use of CID extension." \ |
| 3209 | -s "Enable use of CID extension." \ |
| 3210 | -c "client hello, adding CID extension" \ |
| 3211 | -s "found CID extension" \ |
| 3212 | -s "Use of CID extension negotiated" \ |
| 3213 | -s "server hello, adding CID extension" \ |
| 3214 | -c "found CID extension" \ |
| 3215 | -c "Use of CID extension negotiated" \ |
| 3216 | -s "Copy CIDs into SSL transform" \ |
| 3217 | -c "Copy CIDs into SSL transform" \ |
| 3218 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3219 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3220 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3221 | -c "Use of Connection ID has been negotiated" \ |
| 3222 | -c "ignoring unexpected CID" \ |
| 3223 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3224 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3226 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3227 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3228 | -p "$P_PXY mtu=800" \ |
| 3229 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3230 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3231 | 0 \ |
| 3232 | -c "Enable use of CID extension." \ |
| 3233 | -s "Enable use of CID extension." \ |
| 3234 | -c "client hello, adding CID extension" \ |
| 3235 | -s "found CID extension" \ |
| 3236 | -s "Use of CID extension negotiated" \ |
| 3237 | -s "server hello, adding CID extension" \ |
| 3238 | -c "found CID extension" \ |
| 3239 | -c "Use of CID extension negotiated" \ |
| 3240 | -s "Copy CIDs into SSL transform" \ |
| 3241 | -c "Copy CIDs into SSL transform" \ |
| 3242 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3243 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3244 | -s "Use of Connection ID has been negotiated" \ |
| 3245 | -c "Use of Connection ID has been negotiated" |
| 3246 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3249 | 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] | 3250 | -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] | 3251 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3252 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3253 | 0 \ |
| 3254 | -c "Enable use of CID extension." \ |
| 3255 | -s "Enable use of CID extension." \ |
| 3256 | -c "client hello, adding CID extension" \ |
| 3257 | -s "found CID extension" \ |
| 3258 | -s "Use of CID extension negotiated" \ |
| 3259 | -s "server hello, adding CID extension" \ |
| 3260 | -c "found CID extension" \ |
| 3261 | -c "Use of CID extension negotiated" \ |
| 3262 | -s "Copy CIDs into SSL transform" \ |
| 3263 | -c "Copy CIDs into SSL transform" \ |
| 3264 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3265 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3266 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3267 | -c "Use of Connection ID has been negotiated" \ |
| 3268 | -c "ignoring unexpected CID" \ |
| 3269 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3270 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3273 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3274 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3275 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3276 | 0 \ |
| 3277 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3278 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3279 | -c "client hello, adding CID extension" \ |
| 3280 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3281 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3282 | -s "server hello, adding CID extension" \ |
| 3283 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3284 | -c "Use of CID extension negotiated" \ |
| 3285 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3286 | -c "Copy CIDs into SSL transform" \ |
| 3287 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3288 | -s "Peer CID (length 0 Bytes):" \ |
| 3289 | -s "Use of Connection ID has been negotiated" \ |
| 3290 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3293 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3294 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3295 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3296 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3297 | 0 \ |
| 3298 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3299 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3300 | -c "client hello, adding CID extension" \ |
| 3301 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3302 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3303 | -s "server hello, adding CID extension" \ |
| 3304 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3305 | -c "Use of CID extension negotiated" \ |
| 3306 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3307 | -c "Copy CIDs into SSL transform" \ |
| 3308 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3309 | -c "Peer CID (length 0 Bytes):" \ |
| 3310 | -s "Use of Connection ID has been negotiated" \ |
| 3311 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3312 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3315 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3316 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3317 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3318 | 0 \ |
| 3319 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3320 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3321 | -c "client hello, adding CID extension" \ |
| 3322 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3323 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3324 | -s "server hello, adding CID extension" \ |
| 3325 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3326 | -c "Use of CID extension negotiated" \ |
| 3327 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3328 | -c "Copy CIDs into SSL transform" \ |
| 3329 | -S "Use of Connection ID has been negotiated" \ |
| 3330 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3331 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3333 | 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] | 3334 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3335 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3336 | 0 \ |
| 3337 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3338 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3339 | -c "client hello, adding CID extension" \ |
| 3340 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3341 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3342 | -s "server hello, adding CID extension" \ |
| 3343 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3344 | -c "Use of CID extension negotiated" \ |
| 3345 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3346 | -c "Copy CIDs into SSL transform" \ |
| 3347 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3348 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3349 | -s "Use of Connection ID has been negotiated" \ |
| 3350 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3351 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3353 | 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] | 3354 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3355 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3356 | 0 \ |
| 3357 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3358 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3359 | -c "client hello, adding CID extension" \ |
| 3360 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3361 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3362 | -s "server hello, adding CID extension" \ |
| 3363 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3364 | -c "Use of CID extension negotiated" \ |
| 3365 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3366 | -c "Copy CIDs into SSL transform" \ |
| 3367 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3368 | -s "Peer CID (length 0 Bytes):" \ |
| 3369 | -s "Use of Connection ID has been negotiated" \ |
| 3370 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3371 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3373 | 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] | 3374 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3375 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3376 | 0 \ |
| 3377 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3378 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3379 | -c "client hello, adding CID extension" \ |
| 3380 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3381 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3382 | -s "server hello, adding CID extension" \ |
| 3383 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3384 | -c "Use of CID extension negotiated" \ |
| 3385 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3386 | -c "Copy CIDs into SSL transform" \ |
| 3387 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3388 | -c "Peer CID (length 0 Bytes):" \ |
| 3389 | -s "Use of Connection ID has been negotiated" \ |
| 3390 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3391 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3393 | 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] | 3394 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3395 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3396 | 0 \ |
| 3397 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3398 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3399 | -c "client hello, adding CID extension" \ |
| 3400 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3401 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3402 | -s "server hello, adding CID extension" \ |
| 3403 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3404 | -c "Use of CID extension negotiated" \ |
| 3405 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3406 | -c "Copy CIDs into SSL transform" \ |
| 3407 | -S "Use of Connection ID has been negotiated" \ |
| 3408 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3409 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3411 | 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] | 3412 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3413 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3414 | 0 \ |
| 3415 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3416 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3417 | -c "client hello, adding CID extension" \ |
| 3418 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3419 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3420 | -s "server hello, adding CID extension" \ |
| 3421 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3422 | -c "Use of CID extension negotiated" \ |
| 3423 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3424 | -c "Copy CIDs into SSL transform" \ |
| 3425 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3426 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3427 | -s "Use of Connection ID has been negotiated" \ |
| 3428 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3429 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3430 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3431 | 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] | 3432 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3433 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3434 | 0 \ |
| 3435 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3436 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3437 | -c "client hello, adding CID extension" \ |
| 3438 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3439 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3440 | -s "server hello, adding CID extension" \ |
| 3441 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3442 | -c "Use of CID extension negotiated" \ |
| 3443 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3444 | -c "Copy CIDs into SSL transform" \ |
| 3445 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3446 | -s "Peer CID (length 0 Bytes):" \ |
| 3447 | -s "Use of Connection ID has been negotiated" \ |
| 3448 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3449 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3450 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3451 | 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] | 3452 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3453 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3454 | 0 \ |
| 3455 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3456 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3457 | -c "client hello, adding CID extension" \ |
| 3458 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3459 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3460 | -s "server hello, adding CID extension" \ |
| 3461 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3462 | -c "Use of CID extension negotiated" \ |
| 3463 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3464 | -c "Copy CIDs into SSL transform" \ |
| 3465 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3466 | -c "Peer CID (length 0 Bytes):" \ |
| 3467 | -s "Use of Connection ID has been negotiated" \ |
| 3468 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3469 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3471 | 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] | 3472 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3473 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3474 | 0 \ |
| 3475 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3476 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3477 | -c "client hello, adding CID extension" \ |
| 3478 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3479 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3480 | -s "server hello, adding CID extension" \ |
| 3481 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3482 | -c "Use of CID extension negotiated" \ |
| 3483 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3484 | -c "Copy CIDs into SSL transform" \ |
| 3485 | -S "Use of Connection ID has been negotiated" \ |
| 3486 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3487 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3491 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3492 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3493 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3494 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3495 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3496 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3497 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3498 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3499 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3500 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3501 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3502 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3506 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3507 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3508 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3509 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3510 | 0 \ |
| 3511 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3512 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3513 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3514 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3515 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3516 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3517 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3518 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3523 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3524 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3525 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3526 | 0 \ |
| 3527 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3528 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3529 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3530 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3531 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3532 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3533 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3534 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3535 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3537 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3539 | 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] | 3540 | -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] | 3541 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3542 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3543 | 0 \ |
| 3544 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3545 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3546 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3547 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3548 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3549 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3550 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3551 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3552 | -c "ignoring unexpected CID" \ |
| 3553 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3554 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3556 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3558 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3559 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3560 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3561 | 0 \ |
| 3562 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3563 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3564 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3565 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3566 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3567 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3568 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3569 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3570 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3574 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3575 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3576 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3577 | 0 \ |
| 3578 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3579 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3580 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3581 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3582 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3583 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3584 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3585 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3588 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3589 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3590 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3591 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3592 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3593 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3594 | 0 \ |
| 3595 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3596 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3597 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3598 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3599 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3600 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3601 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3602 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3603 | -c "ignoring unexpected CID" \ |
| 3604 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3608 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3609 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3610 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3611 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3612 | 0 \ |
| 3613 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3614 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3615 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3616 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3617 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3618 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3621 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3623 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3624 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3625 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3626 | 0 \ |
| 3627 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3628 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3629 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3630 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3631 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3632 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3633 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3635 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3636 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3637 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3638 | -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] | 3639 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3640 | "$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" \ |
| 3641 | 0 \ |
| 3642 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3643 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3644 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3645 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3646 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3647 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3648 | -c "ignoring unexpected CID" \ |
| 3649 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3652 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3653 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3654 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3655 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3656 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3657 | 0 \ |
| 3658 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3659 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3660 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3661 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3662 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3663 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3664 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3665 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3666 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3667 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3670 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3671 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3672 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3673 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3674 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3675 | 0 \ |
| 3676 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3677 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3678 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3679 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3680 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3681 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3682 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3683 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3684 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3685 | -c "ignoring unexpected CID" \ |
| 3686 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3687 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3689 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3690 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3691 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3692 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3693 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3694 | 0 \ |
| 3695 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3696 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3697 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3698 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3699 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3700 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3701 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3702 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3703 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3704 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3707 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3708 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3709 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3710 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3711 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3712 | 0 \ |
| 3713 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3714 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3715 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3716 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3717 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3718 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3719 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3720 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3721 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3722 | -c "ignoring unexpected CID" \ |
| 3723 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3724 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3725 | # 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] | 3726 | # tests check that the buffer contents are reallocated when the message is |
| 3727 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3729 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3730 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3731 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3732 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3733 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3734 | 0 \ |
| 3735 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3736 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3737 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3738 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3739 | -s "Reallocating in_buf" \ |
| 3740 | -s "Reallocating out_buf" |
| 3741 | |
| 3742 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3743 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3744 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3745 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3746 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3747 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3748 | 0 \ |
| 3749 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3750 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3751 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3752 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3753 | -s "Reallocating in_buf" \ |
| 3754 | -s "Reallocating out_buf" |
| 3755 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3756 | # Tests for Encrypt-then-MAC extension |
| 3757 | |
| 3758 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3759 | "$P_SRV debug_level=3 \ |
| 3760 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3761 | "$P_CLI debug_level=3" \ |
| 3762 | 0 \ |
| 3763 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3764 | -s "found encrypt then mac extension" \ |
| 3765 | -s "server hello, adding encrypt then mac extension" \ |
| 3766 | -c "found encrypt_then_mac extension" \ |
| 3767 | -c "using encrypt then mac" \ |
| 3768 | -s "using encrypt then mac" |
| 3769 | |
| 3770 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3771 | "$P_SRV debug_level=3 etm=0 \ |
| 3772 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3773 | "$P_CLI debug_level=3 etm=1" \ |
| 3774 | 0 \ |
| 3775 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3776 | -s "found encrypt then mac extension" \ |
| 3777 | -S "server hello, adding encrypt then mac extension" \ |
| 3778 | -C "found encrypt_then_mac extension" \ |
| 3779 | -C "using encrypt then mac" \ |
| 3780 | -S "using encrypt then mac" |
| 3781 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3782 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3783 | "$P_SRV debug_level=3 etm=1 \ |
| 3784 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3785 | "$P_CLI debug_level=3 etm=1" \ |
| 3786 | 0 \ |
| 3787 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3788 | -s "found encrypt then mac extension" \ |
| 3789 | -S "server hello, adding encrypt then mac extension" \ |
| 3790 | -C "found encrypt_then_mac extension" \ |
| 3791 | -C "using encrypt then mac" \ |
| 3792 | -S "using encrypt then mac" |
| 3793 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3794 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3795 | "$P_SRV debug_level=3 etm=1 \ |
| 3796 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3797 | "$P_CLI debug_level=3 etm=0" \ |
| 3798 | 0 \ |
| 3799 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3800 | -S "found encrypt then mac extension" \ |
| 3801 | -S "server hello, adding encrypt then mac extension" \ |
| 3802 | -C "found encrypt_then_mac extension" \ |
| 3803 | -C "using encrypt then mac" \ |
| 3804 | -S "using encrypt then mac" |
| 3805 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3806 | # Tests for Extended Master Secret extension |
| 3807 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3808 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3809 | run_test "Extended Master Secret: default" \ |
| 3810 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3811 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3812 | 0 \ |
| 3813 | -c "client hello, adding extended_master_secret extension" \ |
| 3814 | -s "found extended master secret extension" \ |
| 3815 | -s "server hello, adding extended master secret extension" \ |
| 3816 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3817 | -c "session hash for extended master secret" \ |
| 3818 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3819 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3821 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3822 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3823 | "$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] | 3824 | 0 \ |
| 3825 | -c "client hello, adding extended_master_secret extension" \ |
| 3826 | -s "found extended master secret extension" \ |
| 3827 | -S "server hello, adding extended master secret extension" \ |
| 3828 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3829 | -C "session hash for extended master secret" \ |
| 3830 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3831 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3832 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3833 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3834 | "$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] | 3835 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3836 | 0 \ |
| 3837 | -C "client hello, adding extended_master_secret extension" \ |
| 3838 | -S "found extended master secret extension" \ |
| 3839 | -S "server hello, adding extended master secret extension" \ |
| 3840 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3841 | -C "session hash for extended master secret" \ |
| 3842 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3843 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3844 | # Test sending and receiving empty application data records |
| 3845 | |
| 3846 | run_test "Encrypt then MAC: empty application data record" \ |
| 3847 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3848 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3849 | 0 \ |
| 3850 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3851 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3852 | -c "0 bytes written in 1 fragments" |
| 3853 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3854 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3855 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3856 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3857 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3858 | 0 \ |
| 3859 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3860 | -c "0 bytes written in 1 fragments" |
| 3861 | |
| 3862 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3863 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3864 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3865 | 0 \ |
| 3866 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3867 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3868 | -c "0 bytes written in 1 fragments" |
| 3869 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3871 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3872 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3873 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3874 | 0 \ |
| 3875 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3876 | -c "0 bytes written in 1 fragments" |
| 3877 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3878 | # Tests for CBC 1/n-1 record splitting |
| 3879 | |
| 3880 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3881 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3882 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3883 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3884 | 0 \ |
| 3885 | -s "Read from client: 123 bytes read" \ |
| 3886 | -S "Read from client: 1 bytes read" \ |
| 3887 | -S "122 bytes read" |
| 3888 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3889 | # Tests for Session Tickets |
| 3890 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3891 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3892 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3893 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3894 | "$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] | 3895 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3896 | -c "client hello, adding session ticket extension" \ |
| 3897 | -s "found session ticket extension" \ |
| 3898 | -s "server hello, adding session ticket extension" \ |
| 3899 | -c "found session_ticket extension" \ |
| 3900 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3901 | -S "session successfully restored from cache" \ |
| 3902 | -s "session successfully restored from ticket" \ |
| 3903 | -s "a session has been resumed" \ |
| 3904 | -c "a session has been resumed" |
| 3905 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3906 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3907 | run_test "Session resume using tickets: manual rotation" \ |
| 3908 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3909 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3910 | 0 \ |
| 3911 | -c "client hello, adding session ticket extension" \ |
| 3912 | -s "found session ticket extension" \ |
| 3913 | -s "server hello, adding session ticket extension" \ |
| 3914 | -c "found session_ticket extension" \ |
| 3915 | -c "parse new session ticket" \ |
| 3916 | -S "session successfully restored from cache" \ |
| 3917 | -s "session successfully restored from ticket" \ |
| 3918 | -s "a session has been resumed" \ |
| 3919 | -c "a session has been resumed" |
| 3920 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3921 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3922 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3923 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
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" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +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 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3936 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3937 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3938 | "$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] | 3939 | "$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] | 3940 | 0 \ |
| 3941 | -c "client hello, adding session ticket extension" \ |
| 3942 | -s "found session ticket extension" \ |
| 3943 | -s "server hello, adding session ticket extension" \ |
| 3944 | -c "found session_ticket extension" \ |
| 3945 | -c "parse new session ticket" \ |
| 3946 | -S "session successfully restored from cache" \ |
| 3947 | -S "session successfully restored from ticket" \ |
| 3948 | -S "a session has been resumed" \ |
| 3949 | -C "a session has been resumed" |
| 3950 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3951 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3952 | run_test "Session resume using tickets: session copy" \ |
| 3953 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3954 | "$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] | 3955 | 0 \ |
| 3956 | -c "client hello, adding session ticket extension" \ |
| 3957 | -s "found session ticket extension" \ |
| 3958 | -s "server hello, adding session ticket extension" \ |
| 3959 | -c "found session_ticket extension" \ |
| 3960 | -c "parse new session ticket" \ |
| 3961 | -S "session successfully restored from cache" \ |
| 3962 | -s "session successfully restored from ticket" \ |
| 3963 | -s "a session has been resumed" \ |
| 3964 | -c "a session has been resumed" |
| 3965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3967 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3968 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3969 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 3970 | "$P_CLI debug_level=3 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3971 | 0 \ |
| 3972 | -c "client hello, adding session ticket extension" \ |
| 3973 | -c "found session_ticket extension" \ |
| 3974 | -c "parse new session ticket" \ |
| 3975 | -c "a session has been resumed" |
| 3976 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3978 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3979 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3980 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3981 | "( $O_CLI -sess_out $SESSION; \ |
| 3982 | $O_CLI -sess_in $SESSION; \ |
| 3983 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3984 | 0 \ |
| 3985 | -s "found session ticket extension" \ |
| 3986 | -s "server hello, adding session ticket extension" \ |
| 3987 | -S "session successfully restored from cache" \ |
| 3988 | -s "session successfully restored from ticket" \ |
| 3989 | -s "a session has been resumed" |
| 3990 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3991 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3992 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3993 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3994 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3995 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3996 | 0 \ |
| 3997 | -c "client hello, adding session ticket extension" \ |
| 3998 | -s "found session ticket extension" \ |
| 3999 | -s "server hello, adding session ticket extension" \ |
| 4000 | -c "found session_ticket extension" \ |
| 4001 | -c "parse new session ticket" \ |
| 4002 | -S "session successfully restored from cache" \ |
| 4003 | -s "session successfully restored from ticket" \ |
| 4004 | -s "a session has been resumed" \ |
| 4005 | -c "a session has been resumed" |
| 4006 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4007 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4008 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4009 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 4010 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4011 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4012 | 0 \ |
| 4013 | -c "client hello, adding session ticket extension" \ |
| 4014 | -s "found session ticket extension" \ |
| 4015 | -s "server hello, adding session ticket extension" \ |
| 4016 | -c "found session_ticket extension" \ |
| 4017 | -c "parse new session ticket" \ |
| 4018 | -S "session successfully restored from cache" \ |
| 4019 | -s "session successfully restored from ticket" \ |
| 4020 | -s "a session has been resumed" \ |
| 4021 | -c "a session has been resumed" |
| 4022 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4023 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4024 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4025 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 4026 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4027 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4028 | 0 \ |
| 4029 | -c "client hello, adding session ticket extension" \ |
| 4030 | -s "found session ticket extension" \ |
| 4031 | -s "server hello, adding session ticket extension" \ |
| 4032 | -c "found session_ticket extension" \ |
| 4033 | -c "parse new session ticket" \ |
| 4034 | -S "session successfully restored from cache" \ |
| 4035 | -s "session successfully restored from ticket" \ |
| 4036 | -s "a session has been resumed" \ |
| 4037 | -c "a session has been resumed" |
| 4038 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4039 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4040 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4041 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 4042 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4043 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4044 | 0 \ |
| 4045 | -c "client hello, adding session ticket extension" \ |
| 4046 | -s "found session ticket extension" \ |
| 4047 | -s "server hello, adding session ticket extension" \ |
| 4048 | -c "found session_ticket extension" \ |
| 4049 | -c "parse new session ticket" \ |
| 4050 | -S "session successfully restored from cache" \ |
| 4051 | -s "session successfully restored from ticket" \ |
| 4052 | -s "a session has been resumed" \ |
| 4053 | -c "a session has been resumed" |
| 4054 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4055 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4056 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4057 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 4058 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4059 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4060 | 0 \ |
| 4061 | -c "client hello, adding session ticket extension" \ |
| 4062 | -s "found session ticket extension" \ |
| 4063 | -s "server hello, adding session ticket extension" \ |
| 4064 | -c "found session_ticket extension" \ |
| 4065 | -c "parse new session ticket" \ |
| 4066 | -S "session successfully restored from cache" \ |
| 4067 | -s "session successfully restored from ticket" \ |
| 4068 | -s "a session has been resumed" \ |
| 4069 | -c "a session has been resumed" |
| 4070 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4071 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4073 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 4074 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4075 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4076 | 0 \ |
| 4077 | -c "client hello, adding session ticket extension" \ |
| 4078 | -s "found session ticket extension" \ |
| 4079 | -s "server hello, adding session ticket extension" \ |
| 4080 | -c "found session_ticket extension" \ |
| 4081 | -c "parse new session ticket" \ |
| 4082 | -S "session successfully restored from cache" \ |
| 4083 | -s "session successfully restored from ticket" \ |
| 4084 | -s "a session has been resumed" \ |
| 4085 | -c "a session has been resumed" |
| 4086 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4087 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4088 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4089 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 4090 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4091 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4092 | 0 \ |
| 4093 | -c "client hello, adding session ticket extension" \ |
| 4094 | -s "found session ticket extension" \ |
| 4095 | -s "server hello, adding session ticket extension" \ |
| 4096 | -c "found session_ticket extension" \ |
| 4097 | -c "parse new session ticket" \ |
| 4098 | -S "session successfully restored from cache" \ |
| 4099 | -s "session successfully restored from ticket" \ |
| 4100 | -s "a session has been resumed" \ |
| 4101 | -c "a session has been resumed" |
| 4102 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4103 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4105 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4106 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4107 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4108 | 0 \ |
| 4109 | -c "client hello, adding session ticket extension" \ |
| 4110 | -s "found session ticket extension" \ |
| 4111 | -s "server hello, adding session ticket extension" \ |
| 4112 | -c "found session_ticket extension" \ |
| 4113 | -c "parse new session ticket" \ |
| 4114 | -S "session successfully restored from cache" \ |
| 4115 | -s "session successfully restored from ticket" \ |
| 4116 | -s "a session has been resumed" \ |
| 4117 | -c "a session has been resumed" |
| 4118 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4119 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4120 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4121 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4122 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4123 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4124 | 0 \ |
| 4125 | -c "client hello, adding session ticket extension" \ |
| 4126 | -s "found session ticket extension" \ |
| 4127 | -s "server hello, adding session ticket extension" \ |
| 4128 | -c "found session_ticket extension" \ |
| 4129 | -c "parse new session ticket" \ |
| 4130 | -S "session successfully restored from cache" \ |
| 4131 | -s "session successfully restored from ticket" \ |
| 4132 | -s "a session has been resumed" \ |
| 4133 | -c "a session has been resumed" |
| 4134 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4135 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4137 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4138 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4139 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4140 | 0 \ |
| 4141 | -c "client hello, adding session ticket extension" \ |
| 4142 | -s "found session ticket extension" \ |
| 4143 | -s "server hello, adding session ticket extension" \ |
| 4144 | -c "found session_ticket extension" \ |
| 4145 | -c "parse new session ticket" \ |
| 4146 | -S "session successfully restored from cache" \ |
| 4147 | -s "session successfully restored from ticket" \ |
| 4148 | -s "a session has been resumed" \ |
| 4149 | -c "a session has been resumed" |
| 4150 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4151 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4153 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4154 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4155 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4156 | 0 \ |
| 4157 | -c "client hello, adding session ticket extension" \ |
| 4158 | -s "found session ticket extension" \ |
| 4159 | -s "server hello, adding session ticket extension" \ |
| 4160 | -c "found session_ticket extension" \ |
| 4161 | -c "parse new session ticket" \ |
| 4162 | -S "session successfully restored from cache" \ |
| 4163 | -s "session successfully restored from ticket" \ |
| 4164 | -s "a session has been resumed" \ |
| 4165 | -c "a session has been resumed" |
| 4166 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4167 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4168 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4169 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4170 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4171 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4172 | 0 \ |
| 4173 | -c "client hello, adding session ticket extension" \ |
| 4174 | -s "found session ticket extension" \ |
| 4175 | -s "server hello, adding session ticket extension" \ |
| 4176 | -c "found session_ticket extension" \ |
| 4177 | -c "parse new session ticket" \ |
| 4178 | -S "session successfully restored from cache" \ |
| 4179 | -s "session successfully restored from ticket" \ |
| 4180 | -s "a session has been resumed" \ |
| 4181 | -c "a session has been resumed" |
| 4182 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4183 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4184 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4185 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4186 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4187 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4188 | 0 \ |
| 4189 | -c "client hello, adding session ticket extension" \ |
| 4190 | -s "found session ticket extension" \ |
| 4191 | -s "server hello, adding session ticket extension" \ |
| 4192 | -c "found session_ticket extension" \ |
| 4193 | -c "parse new session ticket" \ |
| 4194 | -S "session successfully restored from cache" \ |
| 4195 | -s "session successfully restored from ticket" \ |
| 4196 | -s "a session has been resumed" \ |
| 4197 | -c "a session has been resumed" |
| 4198 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4199 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4200 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4201 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4202 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4203 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4204 | 0 \ |
| 4205 | -c "client hello, adding session ticket extension" \ |
| 4206 | -s "found session ticket extension" \ |
| 4207 | -s "server hello, adding session ticket extension" \ |
| 4208 | -c "found session_ticket extension" \ |
| 4209 | -c "parse new session ticket" \ |
| 4210 | -S "session successfully restored from cache" \ |
| 4211 | -s "session successfully restored from ticket" \ |
| 4212 | -s "a session has been resumed" \ |
| 4213 | -c "a session has been resumed" |
| 4214 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4215 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4216 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4217 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4218 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4219 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4220 | 0 \ |
| 4221 | -c "client hello, adding session ticket extension" \ |
| 4222 | -s "found session ticket extension" \ |
| 4223 | -s "server hello, adding session ticket extension" \ |
| 4224 | -c "found session_ticket extension" \ |
| 4225 | -c "parse new session ticket" \ |
| 4226 | -S "session successfully restored from cache" \ |
| 4227 | -s "session successfully restored from ticket" \ |
| 4228 | -s "a session has been resumed" \ |
| 4229 | -c "a session has been resumed" |
| 4230 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4231 | # Tests for Session Tickets with DTLS |
| 4232 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4234 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4235 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4236 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4237 | "$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] | 4238 | 0 \ |
| 4239 | -c "client hello, adding session ticket extension" \ |
| 4240 | -s "found session ticket extension" \ |
| 4241 | -s "server hello, adding session ticket extension" \ |
| 4242 | -c "found session_ticket extension" \ |
| 4243 | -c "parse new session ticket" \ |
| 4244 | -S "session successfully restored from cache" \ |
| 4245 | -s "session successfully restored from ticket" \ |
| 4246 | -s "a session has been resumed" \ |
| 4247 | -c "a session has been resumed" |
| 4248 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4250 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4251 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4252 | "$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] | 4253 | "$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] | 4254 | 0 \ |
| 4255 | -c "client hello, adding session ticket extension" \ |
| 4256 | -s "found session ticket extension" \ |
| 4257 | -s "server hello, adding session ticket extension" \ |
| 4258 | -c "found session_ticket extension" \ |
| 4259 | -c "parse new session ticket" \ |
| 4260 | -S "session successfully restored from cache" \ |
| 4261 | -s "session successfully restored from ticket" \ |
| 4262 | -s "a session has been resumed" \ |
| 4263 | -c "a session has been resumed" |
| 4264 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4266 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4267 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4268 | "$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] | 4269 | "$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] | 4270 | 0 \ |
| 4271 | -c "client hello, adding session ticket extension" \ |
| 4272 | -s "found session ticket extension" \ |
| 4273 | -s "server hello, adding session ticket extension" \ |
| 4274 | -c "found session_ticket extension" \ |
| 4275 | -c "parse new session ticket" \ |
| 4276 | -S "session successfully restored from cache" \ |
| 4277 | -S "session successfully restored from ticket" \ |
| 4278 | -S "a session has been resumed" \ |
| 4279 | -C "a session has been resumed" |
| 4280 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4282 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4283 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4284 | "$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] | 4285 | "$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] | 4286 | 0 \ |
| 4287 | -c "client hello, adding session ticket extension" \ |
| 4288 | -s "found session ticket extension" \ |
| 4289 | -s "server hello, adding session ticket extension" \ |
| 4290 | -c "found session_ticket extension" \ |
| 4291 | -c "parse new session ticket" \ |
| 4292 | -S "session successfully restored from cache" \ |
| 4293 | -s "session successfully restored from ticket" \ |
| 4294 | -s "a session has been resumed" \ |
| 4295 | -c "a session has been resumed" |
| 4296 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4298 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4299 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4300 | "$O_SRV -dtls" \ |
| 4301 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4302 | 0 \ |
| 4303 | -c "client hello, adding session ticket extension" \ |
| 4304 | -c "found session_ticket extension" \ |
| 4305 | -c "parse new session ticket" \ |
| 4306 | -c "a session has been resumed" |
| 4307 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4308 | # 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] | 4309 | # 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] | 4310 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4313 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4314 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4315 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4316 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4317 | rm -f $SESSION )" \ |
| 4318 | 0 \ |
| 4319 | -s "found session ticket extension" \ |
| 4320 | -s "server hello, adding session ticket extension" \ |
| 4321 | -S "session successfully restored from cache" \ |
| 4322 | -s "session successfully restored from ticket" \ |
| 4323 | -s "a session has been resumed" |
| 4324 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4325 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4326 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4328 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4329 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4330 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4331 | "$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] | 4332 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4333 | -c "client hello, adding session ticket extension" \ |
| 4334 | -s "found session ticket extension" \ |
| 4335 | -S "server hello, adding session ticket extension" \ |
| 4336 | -C "found session_ticket extension" \ |
| 4337 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4338 | -s "session successfully restored from cache" \ |
| 4339 | -S "session successfully restored from ticket" \ |
| 4340 | -s "a session has been resumed" \ |
| 4341 | -c "a session has been resumed" |
| 4342 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4343 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4345 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4346 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4347 | "$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] | 4348 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4349 | -C "client hello, adding session ticket extension" \ |
| 4350 | -S "found session ticket extension" \ |
| 4351 | -S "server hello, adding session ticket extension" \ |
| 4352 | -C "found session_ticket extension" \ |
| 4353 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4354 | -s "session successfully restored from cache" \ |
| 4355 | -S "session successfully restored from ticket" \ |
| 4356 | -s "a session has been resumed" \ |
| 4357 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4358 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4359 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4360 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4361 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4362 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4363 | 0 \ |
| 4364 | -S "session successfully restored from cache" \ |
| 4365 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4366 | -S "a session has been resumed" \ |
| 4367 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4368 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4370 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4371 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4372 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4373 | 0 \ |
| 4374 | -s "session successfully restored from cache" \ |
| 4375 | -S "session successfully restored from ticket" \ |
| 4376 | -s "a session has been resumed" \ |
| 4377 | -c "a session has been resumed" |
| 4378 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4379 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4380 | run_test "Session resume using cache: cache removed" \ |
| 4381 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4382 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4383 | 0 \ |
| 4384 | -C "client hello, adding session ticket extension" \ |
| 4385 | -S "found session ticket extension" \ |
| 4386 | -S "server hello, adding session ticket extension" \ |
| 4387 | -C "found session_ticket extension" \ |
| 4388 | -C "parse new session ticket" \ |
| 4389 | -S "session successfully restored from cache" \ |
| 4390 | -S "session successfully restored from ticket" \ |
| 4391 | -S "a session has been resumed" \ |
| 4392 | -C "a session has been resumed" |
| 4393 | |
| 4394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4395 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4396 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4397 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4398 | "$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] | 4399 | 0 \ |
| 4400 | -s "session successfully restored from cache" \ |
| 4401 | -S "session successfully restored from ticket" \ |
| 4402 | -s "a session has been resumed" \ |
| 4403 | -c "a session has been resumed" |
| 4404 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4406 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4407 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4408 | "$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] | 4409 | 0 \ |
| 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 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4415 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4416 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4417 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4418 | "$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] | 4419 | 0 \ |
| 4420 | -s "session successfully restored from cache" \ |
| 4421 | -S "session successfully restored from ticket" \ |
| 4422 | -s "a session has been resumed" \ |
| 4423 | -c "a session has been resumed" |
| 4424 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4426 | run_test "Session resume using cache: session copy" \ |
| 4427 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4428 | "$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] | 4429 | 0 \ |
| 4430 | -s "session successfully restored from cache" \ |
| 4431 | -S "session successfully restored from ticket" \ |
| 4432 | -s "a session has been resumed" \ |
| 4433 | -c "a session has been resumed" |
| 4434 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4435 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4436 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4437 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4438 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4439 | "( $O_CLI -sess_out $SESSION; \ |
| 4440 | $O_CLI -sess_in $SESSION; \ |
| 4441 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4442 | 0 \ |
| 4443 | -s "found session ticket extension" \ |
| 4444 | -S "server hello, adding session ticket extension" \ |
| 4445 | -s "session successfully restored from cache" \ |
| 4446 | -S "session successfully restored from ticket" \ |
| 4447 | -s "a session has been resumed" |
| 4448 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4451 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4452 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4453 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4454 | 0 \ |
| 4455 | -C "found session_ticket extension" \ |
| 4456 | -C "parse new session ticket" \ |
| 4457 | -c "a session has been resumed" |
| 4458 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4459 | # Tests for Session resume and extensions |
| 4460 | |
| 4461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4462 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4463 | run_test "Session resume and connection ID" \ |
| 4464 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4465 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4466 | 0 \ |
| 4467 | -c "Enable use of CID extension." \ |
| 4468 | -s "Enable use of CID extension." \ |
| 4469 | -c "client hello, adding CID extension" \ |
| 4470 | -s "found CID extension" \ |
| 4471 | -s "Use of CID extension negotiated" \ |
| 4472 | -s "server hello, adding CID extension" \ |
| 4473 | -c "found CID extension" \ |
| 4474 | -c "Use of CID extension negotiated" \ |
| 4475 | -s "Copy CIDs into SSL transform" \ |
| 4476 | -c "Copy CIDs into SSL transform" \ |
| 4477 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4478 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4479 | -s "Use of Connection ID has been negotiated" \ |
| 4480 | -c "Use of Connection ID has been negotiated" |
| 4481 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4482 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4483 | |
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 | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4486 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4487 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4488 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4489 | "$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] | 4490 | 0 \ |
| 4491 | -c "client hello, adding session ticket extension" \ |
| 4492 | -s "found session ticket extension" \ |
| 4493 | -S "server hello, adding session ticket extension" \ |
| 4494 | -C "found session_ticket extension" \ |
| 4495 | -C "parse new session ticket" \ |
| 4496 | -s "session successfully restored from cache" \ |
| 4497 | -S "session successfully restored from ticket" \ |
| 4498 | -s "a session has been resumed" \ |
| 4499 | -c "a session has been resumed" |
| 4500 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4502 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4503 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4504 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4505 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4506 | "$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] | 4507 | 0 \ |
| 4508 | -C "client hello, adding session ticket extension" \ |
| 4509 | -S "found session ticket extension" \ |
| 4510 | -S "server hello, adding session ticket extension" \ |
| 4511 | -C "found session_ticket extension" \ |
| 4512 | -C "parse new session ticket" \ |
| 4513 | -s "session successfully restored from cache" \ |
| 4514 | -S "session successfully restored from ticket" \ |
| 4515 | -s "a session has been resumed" \ |
| 4516 | -c "a session has been resumed" |
| 4517 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4520 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4521 | "$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] | 4522 | "$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] | 4523 | 0 \ |
| 4524 | -S "session successfully restored from cache" \ |
| 4525 | -S "session successfully restored from ticket" \ |
| 4526 | -S "a session has been resumed" \ |
| 4527 | -C "a session has been resumed" |
| 4528 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4530 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4531 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4532 | "$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] | 4533 | "$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] | 4534 | 0 \ |
| 4535 | -s "session successfully restored from cache" \ |
| 4536 | -S "session successfully restored from ticket" \ |
| 4537 | -s "a session has been resumed" \ |
| 4538 | -c "a session has been resumed" |
| 4539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4541 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4542 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4543 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4544 | "$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] | 4545 | 0 \ |
| 4546 | -s "session successfully restored from cache" \ |
| 4547 | -S "session successfully restored from ticket" \ |
| 4548 | -s "a session has been resumed" \ |
| 4549 | -c "a session has been resumed" |
| 4550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4553 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4554 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4555 | "$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] | 4556 | 0 \ |
| 4557 | -S "session successfully restored from cache" \ |
| 4558 | -S "session successfully restored from ticket" \ |
| 4559 | -S "a session has been resumed" \ |
| 4560 | -C "a session has been resumed" |
| 4561 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4563 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4564 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4565 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4566 | "$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] | 4567 | 0 \ |
| 4568 | -s "session successfully restored from cache" \ |
| 4569 | -S "session successfully restored from ticket" \ |
| 4570 | -s "a session has been resumed" \ |
| 4571 | -c "a session has been resumed" |
| 4572 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4574 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4575 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4576 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4577 | "$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] | 4578 | 0 \ |
| 4579 | -s "session successfully restored from cache" \ |
| 4580 | -S "session successfully restored from ticket" \ |
| 4581 | -s "a session has been resumed" \ |
| 4582 | -c "a session has been resumed" |
| 4583 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4584 | # 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] | 4585 | # 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] | 4586 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4588 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4589 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4590 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4591 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4592 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4593 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4594 | rm -f $SESSION )" \ |
| 4595 | 0 \ |
| 4596 | -s "found session ticket extension" \ |
| 4597 | -S "server hello, adding session ticket extension" \ |
| 4598 | -s "session successfully restored from cache" \ |
| 4599 | -S "session successfully restored from ticket" \ |
| 4600 | -s "a session has been resumed" |
| 4601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4603 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4604 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4605 | "$O_SRV -dtls" \ |
| 4606 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4607 | 0 \ |
| 4608 | -C "found session_ticket extension" \ |
| 4609 | -C "parse new session ticket" \ |
| 4610 | -c "a session has been resumed" |
| 4611 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4612 | # Tests for Max Fragment Length extension |
| 4613 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4614 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4616 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4617 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4618 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4619 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4620 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4621 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4622 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4623 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4624 | -C "client hello, adding max_fragment_length extension" \ |
| 4625 | -S "found max fragment length extension" \ |
| 4626 | -S "server hello, max_fragment_length extension" \ |
| 4627 | -C "found max_fragment_length extension" |
| 4628 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4629 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4631 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4632 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4633 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4634 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4635 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4636 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4637 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4638 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4639 | -C "client hello, adding max_fragment_length extension" \ |
| 4640 | -S "found max fragment length extension" \ |
| 4641 | -S "server hello, max_fragment_length extension" \ |
| 4642 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4643 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4644 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4645 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4646 | |
| 4647 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4649 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4650 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4651 | "$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] | 4652 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4653 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4654 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4655 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4656 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4657 | -C "client hello, adding max_fragment_length extension" \ |
| 4658 | -S "found max fragment length extension" \ |
| 4659 | -S "server hello, max_fragment_length extension" \ |
| 4660 | -C "found max_fragment_length extension" \ |
| 4661 | -c "fragment larger than.*maximum " |
| 4662 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4663 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4664 | # (session fragment length will be 16384 regardless of mbedtls |
| 4665 | # content length configuration.) |
| 4666 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4667 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4669 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4670 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4671 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4672 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4673 | -C "Maximum incoming record payload length is 16384" \ |
| 4674 | -C "Maximum outgoing record payload length is 16384" \ |
| 4675 | -S "Maximum incoming record payload length is 16384" \ |
| 4676 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4677 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4678 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4679 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4680 | |
| 4681 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4683 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4684 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4685 | "$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] | 4686 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4687 | -C "Maximum incoming record payload length is 16384" \ |
| 4688 | -C "Maximum outgoing record payload length is 16384" \ |
| 4689 | -S "Maximum incoming record payload length is 16384" \ |
| 4690 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4691 | -c "fragment larger than.*maximum " |
| 4692 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4693 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4694 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4695 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4696 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4697 | "$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] | 4698 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4699 | -c "Maximum incoming record payload length is 4096" \ |
| 4700 | -c "Maximum outgoing record payload length is 4096" \ |
| 4701 | -s "Maximum incoming record payload length is 4096" \ |
| 4702 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4703 | -c "client hello, adding max_fragment_length extension" \ |
| 4704 | -s "found max fragment length extension" \ |
| 4705 | -s "server hello, max_fragment_length extension" \ |
| 4706 | -c "found max_fragment_length extension" |
| 4707 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4708 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4709 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4710 | run_test "Max fragment length: client 512, server 1024" \ |
| 4711 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4712 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4713 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4714 | -c "Maximum incoming record payload length is 512" \ |
| 4715 | -c "Maximum outgoing record payload length is 512" \ |
| 4716 | -s "Maximum incoming record payload length is 512" \ |
| 4717 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4718 | -c "client hello, adding max_fragment_length extension" \ |
| 4719 | -s "found max fragment length extension" \ |
| 4720 | -s "server hello, max_fragment_length extension" \ |
| 4721 | -c "found max_fragment_length extension" |
| 4722 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4723 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4724 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4725 | run_test "Max fragment length: client 512, server 2048" \ |
| 4726 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4727 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4728 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4729 | -c "Maximum incoming record payload length is 512" \ |
| 4730 | -c "Maximum outgoing record payload length is 512" \ |
| 4731 | -s "Maximum incoming record payload length is 512" \ |
| 4732 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4733 | -c "client hello, adding max_fragment_length extension" \ |
| 4734 | -s "found max fragment length extension" \ |
| 4735 | -s "server hello, max_fragment_length extension" \ |
| 4736 | -c "found max_fragment_length extension" |
| 4737 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4738 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4740 | run_test "Max fragment length: client 512, server 4096" \ |
| 4741 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4742 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4743 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4744 | -c "Maximum incoming record payload length is 512" \ |
| 4745 | -c "Maximum outgoing record payload length is 512" \ |
| 4746 | -s "Maximum incoming record payload length is 512" \ |
| 4747 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4748 | -c "client hello, adding max_fragment_length extension" \ |
| 4749 | -s "found max fragment length extension" \ |
| 4750 | -s "server hello, max_fragment_length extension" \ |
| 4751 | -c "found max_fragment_length extension" |
| 4752 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4753 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4754 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4755 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4756 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4757 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4758 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4759 | -c "Maximum incoming record payload length is 1024" \ |
| 4760 | -c "Maximum outgoing record payload length is 1024" \ |
| 4761 | -s "Maximum incoming record payload length is 1024" \ |
| 4762 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4763 | -c "client hello, adding max_fragment_length extension" \ |
| 4764 | -s "found max fragment length extension" \ |
| 4765 | -s "server hello, max_fragment_length extension" \ |
| 4766 | -c "found max_fragment_length extension" |
| 4767 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4768 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4769 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4770 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4771 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4772 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4773 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4774 | -c "Maximum incoming record payload length is 1024" \ |
| 4775 | -c "Maximum outgoing record payload length is 1024" \ |
| 4776 | -s "Maximum incoming record payload length is 1024" \ |
| 4777 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4778 | -c "client hello, adding max_fragment_length extension" \ |
| 4779 | -s "found max fragment length extension" \ |
| 4780 | -s "server hello, max_fragment_length extension" \ |
| 4781 | -c "found max_fragment_length extension" |
| 4782 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4783 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4784 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4785 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4786 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4787 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4788 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4789 | -c "Maximum incoming record payload length is 1024" \ |
| 4790 | -c "Maximum outgoing record payload length is 1024" \ |
| 4791 | -s "Maximum incoming record payload length is 1024" \ |
| 4792 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4793 | -c "client hello, adding max_fragment_length extension" \ |
| 4794 | -s "found max fragment length extension" \ |
| 4795 | -s "server hello, max_fragment_length extension" \ |
| 4796 | -c "found max_fragment_length extension" |
| 4797 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4798 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4799 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4800 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4801 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4802 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4803 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4804 | -c "Maximum incoming record payload length is 2048" \ |
| 4805 | -c "Maximum outgoing record payload length is 2048" \ |
| 4806 | -s "Maximum incoming record payload length is 2048" \ |
| 4807 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4808 | -c "client hello, adding max_fragment_length extension" \ |
| 4809 | -s "found max fragment length extension" \ |
| 4810 | -s "server hello, 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 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4814 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4815 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4816 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4817 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 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 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4828 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4829 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4830 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4831 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4832 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4833 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4834 | -c "Maximum incoming record payload length is 2048" \ |
| 4835 | -c "Maximum outgoing record payload length is 2048" \ |
| 4836 | -s "Maximum incoming record payload length is 2048" \ |
| 4837 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4838 | -c "client hello, adding max_fragment_length extension" \ |
| 4839 | -s "found max fragment length extension" \ |
| 4840 | -s "server hello, max_fragment_length extension" \ |
| 4841 | -c "found max_fragment_length extension" |
| 4842 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4843 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4844 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4845 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4846 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4847 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4848 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4849 | -c "Maximum incoming record payload length is 4096" \ |
| 4850 | -c "Maximum outgoing record payload length is 4096" \ |
| 4851 | -s "Maximum incoming record payload length is 4096" \ |
| 4852 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4853 | -c "client hello, adding max_fragment_length extension" \ |
| 4854 | -s "found max fragment length extension" \ |
| 4855 | -s "server hello, max_fragment_length extension" \ |
| 4856 | -c "found max_fragment_length extension" |
| 4857 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4858 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4859 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4860 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4861 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4862 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4863 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4864 | -c "Maximum incoming record payload length is 4096" \ |
| 4865 | -c "Maximum outgoing record payload length is 4096" \ |
| 4866 | -s "Maximum incoming record payload length is 4096" \ |
| 4867 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4868 | -c "client hello, adding max_fragment_length extension" \ |
| 4869 | -s "found max fragment length extension" \ |
| 4870 | -s "server hello, max_fragment_length extension" \ |
| 4871 | -c "found max_fragment_length extension" |
| 4872 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4873 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4874 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4875 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4876 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4877 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4878 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4879 | -c "Maximum incoming record payload length is 4096" \ |
| 4880 | -c "Maximum outgoing record payload length is 4096" \ |
| 4881 | -s "Maximum incoming record payload length is 4096" \ |
| 4882 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4883 | -c "client hello, adding max_fragment_length extension" \ |
| 4884 | -s "found max fragment length extension" \ |
| 4885 | -s "server hello, max_fragment_length extension" \ |
| 4886 | -c "found max_fragment_length extension" |
| 4887 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4888 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4889 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4890 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4891 | "$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] | 4892 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4893 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4894 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4895 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4896 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4897 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4898 | -C "client hello, adding max_fragment_length extension" \ |
| 4899 | -S "found max fragment length extension" \ |
| 4900 | -S "server hello, max_fragment_length extension" \ |
| 4901 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4902 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4903 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4904 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4905 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4908 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4909 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4910 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4911 | -c "Maximum incoming record payload length is 4096" \ |
| 4912 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4913 | -c "client hello, adding max_fragment_length extension" \ |
| 4914 | -c "found max_fragment_length extension" |
| 4915 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4916 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4917 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4918 | run_test "Max fragment length: client, message just fits" \ |
| 4919 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4920 | "$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] | 4921 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4922 | -c "Maximum incoming record payload length is 2048" \ |
| 4923 | -c "Maximum outgoing record payload length is 2048" \ |
| 4924 | -s "Maximum incoming record payload length is 2048" \ |
| 4925 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4926 | -c "client hello, adding max_fragment_length extension" \ |
| 4927 | -s "found max fragment length extension" \ |
| 4928 | -s "server hello, max_fragment_length extension" \ |
| 4929 | -c "found max_fragment_length extension" \ |
| 4930 | -c "2048 bytes written in 1 fragments" \ |
| 4931 | -s "2048 bytes read" |
| 4932 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4933 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4934 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4935 | run_test "Max fragment length: client, larger message" \ |
| 4936 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4937 | "$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] | 4938 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4939 | -c "Maximum incoming record payload length is 2048" \ |
| 4940 | -c "Maximum outgoing record payload length is 2048" \ |
| 4941 | -s "Maximum incoming record payload length is 2048" \ |
| 4942 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4943 | -c "client hello, adding max_fragment_length extension" \ |
| 4944 | -s "found max fragment length extension" \ |
| 4945 | -s "server hello, max_fragment_length extension" \ |
| 4946 | -c "found max_fragment_length extension" \ |
| 4947 | -c "2345 bytes written in 2 fragments" \ |
| 4948 | -s "2048 bytes read" \ |
| 4949 | -s "297 bytes read" |
| 4950 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4951 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4952 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4954 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4955 | "$P_SRV debug_level=3 dtls=1" \ |
| 4956 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4957 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4958 | -c "Maximum incoming record payload length is 2048" \ |
| 4959 | -c "Maximum outgoing record payload length is 2048" \ |
| 4960 | -s "Maximum incoming record payload length is 2048" \ |
| 4961 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4962 | -c "client hello, adding max_fragment_length extension" \ |
| 4963 | -s "found max fragment length extension" \ |
| 4964 | -s "server hello, max_fragment_length extension" \ |
| 4965 | -c "found max_fragment_length extension" \ |
| 4966 | -c "fragment larger than.*maximum" |
| 4967 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4968 | # Tests for Record Size Limit extension |
| 4969 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4970 | requires_gnutls_tls1_3 |
| 4971 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 4973 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4974 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4975 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4976 | 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] | 4977 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4978 | "$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] | 4979 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4980 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4981 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4982 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4983 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4984 | |
| 4985 | requires_gnutls_tls1_3 |
| 4986 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 4987 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 4988 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4989 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4990 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4991 | 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] | 4992 | "$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] | 4993 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4994 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4995 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4996 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4997 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4998 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4999 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5000 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 5001 | # maximum record size using gnutls_record_set_max_size() |
| 5002 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 5003 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 5004 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 5005 | # more recent function gnutls_record_set_max_recv_size() |
| 5006 | # (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] | 5007 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 5008 | # 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] | 5009 | # Thus, these tests are currently limited to the value range 512-4096. |
| 5010 | # Also, the value sent in the extension will be one larger than the value |
| 5011 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5012 | # 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] | 5013 | |
| 5014 | # 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] | 5015 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 5016 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5017 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5018 | requires_gnutls_tls1_3 |
| 5019 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5021 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5022 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5023 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5024 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 5025 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5026 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5027 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5028 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5029 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5030 | 0 \ |
| 5031 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5032 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5033 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5034 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5035 | -s "Maximum outgoing record payload length is 511" \ |
| 5036 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5037 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5038 | requires_gnutls_tls1_3 |
| 5039 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5040 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5041 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5042 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5044 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 5045 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5046 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5047 | response_size=768" \ |
| 5048 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5049 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5050 | 0 \ |
| 5051 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5052 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5053 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5054 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5055 | -s "Maximum outgoing record payload length is 511" \ |
| 5056 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 5057 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5058 | requires_gnutls_tls1_3 |
| 5059 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5060 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5061 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5062 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 5064 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 5065 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 5066 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 5067 | response_size=1280" \ |
| 5068 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 5069 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 5070 | 0 \ |
| 5071 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 5072 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 5073 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5074 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 5075 | -s "Maximum outgoing record payload length is 511" \ |
| 5076 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5077 | |
| 5078 | requires_gnutls_tls1_3 |
| 5079 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5080 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5081 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5082 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5084 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 5085 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 5086 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5087 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5088 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5089 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5090 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5091 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5092 | -s "Maximum outgoing record payload length is 1023" \ |
| 5093 | -s "512 bytes written in 1 fragments" |
| 5094 | |
| 5095 | requires_gnutls_tls1_3 |
| 5096 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5098 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5099 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5100 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5101 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 5102 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 5103 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5104 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5105 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5106 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5107 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5108 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5109 | -s "Maximum outgoing record payload length is 1023" \ |
| 5110 | -s "1536 bytes written in 2 fragments" |
| 5111 | |
| 5112 | requires_gnutls_tls1_3 |
| 5113 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5114 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5115 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5116 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5117 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5118 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5119 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5120 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5121 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5122 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5123 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5124 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5125 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5126 | -s "Maximum outgoing record payload length is 1023" \ |
| 5127 | -s "2560 bytes written in 3 fragments" |
| 5128 | |
| 5129 | requires_gnutls_tls1_3 |
| 5130 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5131 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5132 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5133 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5134 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5135 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5136 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5137 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5138 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5139 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5140 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5141 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5142 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5143 | -s "Maximum outgoing record payload length is 4095" \ |
| 5144 | -s "2048 bytes written in 1 fragments" |
| 5145 | |
| 5146 | requires_gnutls_tls1_3 |
| 5147 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5149 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5150 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5151 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5152 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5153 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5154 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5155 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5156 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5157 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5158 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5159 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5160 | -s "Maximum outgoing record payload length is 4095" \ |
| 5161 | -s "6144 bytes written in 2 fragments" |
| 5162 | |
| 5163 | requires_gnutls_tls1_3 |
| 5164 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5165 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5166 | requires_config_enabled MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5167 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5168 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5169 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5170 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5171 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5172 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5173 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5174 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5175 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5176 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5177 | -s "Maximum outgoing record payload length is 4095" \ |
| 5178 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5179 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5180 | requires_gnutls_tls1_3 |
| 5181 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5183 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5184 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5185 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5186 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5187 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5188 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5189 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5190 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5191 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5192 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5193 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5194 | -c "Maximum outgoing record payload length is 511" \ |
| 5195 | -c "256 bytes written in 1 fragments" |
| 5196 | |
| 5197 | requires_gnutls_tls1_3 |
| 5198 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5199 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5200 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5201 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5202 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5203 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5204 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5205 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5206 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5207 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5208 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5209 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5210 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5211 | -c "Maximum outgoing record payload length is 511" \ |
| 5212 | -c "768 bytes written in 2 fragments" |
| 5213 | |
| 5214 | requires_gnutls_tls1_3 |
| 5215 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5216 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5217 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5218 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5219 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5220 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5221 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5222 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5223 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5224 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5225 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5226 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5227 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5228 | -c "Maximum outgoing record payload length is 511" \ |
| 5229 | -c "1280 bytes written in 3 fragments" |
| 5230 | |
| 5231 | requires_gnutls_tls1_3 |
| 5232 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5233 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5234 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5235 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5236 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5237 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5238 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5239 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5240 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5241 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5242 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5243 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5244 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5245 | -c "Maximum outgoing record payload length is 1023" \ |
| 5246 | -c "512 bytes written in 1 fragments" |
| 5247 | |
| 5248 | requires_gnutls_tls1_3 |
| 5249 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5250 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5251 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5252 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5253 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5254 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5255 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5256 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5257 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5258 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5259 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5260 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5261 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5262 | -c "Maximum outgoing record payload length is 1023" \ |
| 5263 | -c "1536 bytes written in 2 fragments" |
| 5264 | |
| 5265 | requires_gnutls_tls1_3 |
| 5266 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5267 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5268 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5269 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5270 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5271 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5272 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5273 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5274 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5275 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5276 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5277 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5278 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5279 | -c "Maximum outgoing record payload length is 1023" \ |
| 5280 | -c "2560 bytes written in 3 fragments" |
| 5281 | |
| 5282 | requires_gnutls_tls1_3 |
| 5283 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5285 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5286 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5287 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5288 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5289 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5290 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5291 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5292 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5293 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5294 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5295 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5296 | -c "Maximum outgoing record payload length is 4095" \ |
| 5297 | -c "2048 bytes written in 1 fragments" |
| 5298 | |
| 5299 | requires_gnutls_tls1_3 |
| 5300 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5302 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5304 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5305 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5306 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5307 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5308 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5309 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5310 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5311 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5312 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5313 | -c "Maximum outgoing record payload length is 4095" \ |
| 5314 | -c "6144 bytes written in 2 fragments" |
| 5315 | |
| 5316 | requires_gnutls_tls1_3 |
| 5317 | requires_gnutls_record_size_limit |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5318 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5319 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5321 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5322 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5323 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5324 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5325 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5326 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5327 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5328 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5329 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5330 | -c "Maximum outgoing record payload length is 4095" \ |
| 5331 | -c "10240 bytes written in 3 fragments" |
| 5332 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5333 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5334 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5335 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5336 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 5337 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 5338 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 5339 | requires_config_enabled MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5340 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5341 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5342 | 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] | 5343 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5344 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5345 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5346 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5347 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5348 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5349 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5350 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5351 | -s "Maximum incoming record payload length is 16384" |
| 5352 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5353 | # End of Record size limit tests |
| 5354 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5355 | # Tests for renegotiation |
| 5356 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5357 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5358 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5359 | # TLS 1.3 extensions in the initial handshake. |
| 5360 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5361 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5362 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5363 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5364 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5365 | 0 \ |
| 5366 | -C "client hello, adding renegotiation extension" \ |
| 5367 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5368 | -S "found renegotiation extension" \ |
| 5369 | -s "server hello, secure renegotiation extension" \ |
| 5370 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5371 | -C "=> renegotiate" \ |
| 5372 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5373 | -S "write hello request" |
| 5374 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5376 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5377 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5378 | "$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] | 5379 | 0 \ |
| 5380 | -c "client hello, adding renegotiation extension" \ |
| 5381 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5382 | -s "found renegotiation extension" \ |
| 5383 | -s "server hello, secure renegotiation extension" \ |
| 5384 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5385 | -c "=> renegotiate" \ |
| 5386 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5387 | -S "write hello request" |
| 5388 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5391 | "$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] | 5392 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5393 | 0 \ |
| 5394 | -c "client hello, adding renegotiation extension" \ |
| 5395 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5396 | -s "found renegotiation extension" \ |
| 5397 | -s "server hello, secure renegotiation extension" \ |
| 5398 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5399 | -c "=> renegotiate" \ |
| 5400 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5401 | -s "write hello request" |
| 5402 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5403 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5404 | # 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] | 5405 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5407 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5408 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5409 | "$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] | 5410 | 0 \ |
| 5411 | -c "client hello, adding renegotiation extension" \ |
| 5412 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5413 | -s "found renegotiation extension" \ |
| 5414 | -s "server hello, secure renegotiation extension" \ |
| 5415 | -c "found renegotiation extension" \ |
| 5416 | -c "=> renegotiate" \ |
| 5417 | -s "=> renegotiate" \ |
| 5418 | -S "write hello request" \ |
| 5419 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5420 | |
| 5421 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5422 | # 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] | 5423 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5425 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
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 auth_mode=optional renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5427 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5428 | 0 \ |
| 5429 | -c "client hello, adding renegotiation extension" \ |
| 5430 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5431 | -s "found renegotiation extension" \ |
| 5432 | -s "server hello, secure renegotiation extension" \ |
| 5433 | -c "found renegotiation extension" \ |
| 5434 | -c "=> renegotiate" \ |
| 5435 | -s "=> renegotiate" \ |
| 5436 | -s "write hello request" \ |
| 5437 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5438 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5440 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5441 | "$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] | 5442 | "$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] | 5443 | 0 \ |
| 5444 | -c "client hello, adding renegotiation extension" \ |
| 5445 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5446 | -s "found renegotiation extension" \ |
| 5447 | -s "server hello, secure renegotiation extension" \ |
| 5448 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5449 | -c "=> renegotiate" \ |
| 5450 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5451 | -s "write hello request" |
| 5452 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5453 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5454 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5455 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5456 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5457 | "$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] | 5458 | "$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" \ |
| 5459 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5460 | -c "Maximum incoming record payload length is 2048" \ |
| 5461 | -c "Maximum outgoing record payload length is 2048" \ |
| 5462 | -s "Maximum incoming record payload length is 2048" \ |
| 5463 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5464 | -c "client hello, adding max_fragment_length extension" \ |
| 5465 | -s "found max fragment length extension" \ |
| 5466 | -s "server hello, max_fragment_length extension" \ |
| 5467 | -c "found max_fragment_length extension" \ |
| 5468 | -c "client hello, adding renegotiation extension" \ |
| 5469 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5470 | -s "found renegotiation extension" \ |
| 5471 | -s "server hello, secure renegotiation extension" \ |
| 5472 | -c "found renegotiation extension" \ |
| 5473 | -c "=> renegotiate" \ |
| 5474 | -s "=> renegotiate" \ |
| 5475 | -s "write hello request" |
| 5476 | |
| 5477 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5478 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5479 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5480 | "$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] | 5481 | 1 \ |
| 5482 | -c "client hello, adding renegotiation extension" \ |
| 5483 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5484 | -S "found renegotiation extension" \ |
| 5485 | -s "server hello, secure renegotiation extension" \ |
| 5486 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5487 | -c "=> renegotiate" \ |
| 5488 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5489 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5490 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5491 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5492 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5494 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5495 | "$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] | 5496 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5497 | 0 \ |
| 5498 | -C "client hello, adding renegotiation extension" \ |
| 5499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5500 | -S "found renegotiation extension" \ |
| 5501 | -s "server hello, secure renegotiation extension" \ |
| 5502 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5503 | -C "=> renegotiate" \ |
| 5504 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5505 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5506 | -S "SSL - An unexpected message was received from our peer" \ |
| 5507 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5508 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5510 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5511 | "$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] | 5512 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5513 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5514 | 0 \ |
| 5515 | -C "client hello, adding renegotiation extension" \ |
| 5516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5517 | -S "found renegotiation extension" \ |
| 5518 | -s "server hello, secure renegotiation extension" \ |
| 5519 | -c "found renegotiation extension" \ |
| 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 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5526 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5528 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5529 | "$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] | 5530 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5531 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5532 | 0 \ |
| 5533 | -C "client hello, adding renegotiation extension" \ |
| 5534 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5535 | -S "found renegotiation extension" \ |
| 5536 | -s "server hello, secure renegotiation extension" \ |
| 5537 | -c "found renegotiation extension" \ |
| 5538 | -C "=> renegotiate" \ |
| 5539 | -S "=> renegotiate" \ |
| 5540 | -s "write hello request" \ |
| 5541 | -S "SSL - An unexpected message was received from our peer" \ |
| 5542 | -S "failed" |
| 5543 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5545 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5546 | "$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] | 5547 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5548 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5549 | 0 \ |
| 5550 | -C "client hello, adding renegotiation extension" \ |
| 5551 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5552 | -S "found renegotiation extension" \ |
| 5553 | -s "server hello, secure renegotiation extension" \ |
| 5554 | -c "found renegotiation extension" \ |
| 5555 | -C "=> renegotiate" \ |
| 5556 | -S "=> renegotiate" \ |
| 5557 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5558 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5559 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5560 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5561 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5562 | "$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] | 5563 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5564 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5565 | 0 \ |
| 5566 | -c "client hello, adding renegotiation extension" \ |
| 5567 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5568 | -s "found renegotiation extension" \ |
| 5569 | -s "server hello, secure renegotiation extension" \ |
| 5570 | -c "found renegotiation extension" \ |
| 5571 | -c "=> renegotiate" \ |
| 5572 | -s "=> renegotiate" \ |
| 5573 | -s "write hello request" \ |
| 5574 | -S "SSL - An unexpected message was received from our peer" \ |
| 5575 | -S "failed" |
| 5576 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5578 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5579 | "$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] | 5580 | "$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] | 5581 | 0 \ |
| 5582 | -C "client hello, adding renegotiation extension" \ |
| 5583 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5584 | -S "found renegotiation extension" \ |
| 5585 | -s "server hello, secure renegotiation extension" \ |
| 5586 | -c "found renegotiation extension" \ |
| 5587 | -S "record counter limit reached: renegotiate" \ |
| 5588 | -C "=> renegotiate" \ |
| 5589 | -S "=> renegotiate" \ |
| 5590 | -S "write hello request" \ |
| 5591 | -S "SSL - An unexpected message was received from our peer" \ |
| 5592 | -S "failed" |
| 5593 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5594 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5595 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5596 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5597 | "$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] | 5598 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5599 | 0 \ |
| 5600 | -c "client hello, adding renegotiation extension" \ |
| 5601 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5602 | -s "found renegotiation extension" \ |
| 5603 | -s "server hello, secure renegotiation extension" \ |
| 5604 | -c "found renegotiation extension" \ |
| 5605 | -s "record counter limit reached: renegotiate" \ |
| 5606 | -c "=> renegotiate" \ |
| 5607 | -s "=> renegotiate" \ |
| 5608 | -s "write hello request" \ |
| 5609 | -S "SSL - An unexpected message was received from our peer" \ |
| 5610 | -S "failed" |
| 5611 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5613 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5614 | "$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] | 5615 | "$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] | 5616 | 0 \ |
| 5617 | -c "client hello, adding renegotiation extension" \ |
| 5618 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5619 | -s "found renegotiation extension" \ |
| 5620 | -s "server hello, secure renegotiation extension" \ |
| 5621 | -c "found renegotiation extension" \ |
| 5622 | -s "record counter limit reached: renegotiate" \ |
| 5623 | -c "=> renegotiate" \ |
| 5624 | -s "=> renegotiate" \ |
| 5625 | -s "write hello request" \ |
| 5626 | -S "SSL - An unexpected message was received from our peer" \ |
| 5627 | -S "failed" |
| 5628 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5630 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5631 | "$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] | 5632 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5633 | 0 \ |
| 5634 | -C "client hello, adding renegotiation extension" \ |
| 5635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5636 | -S "found renegotiation extension" \ |
| 5637 | -s "server hello, secure renegotiation extension" \ |
| 5638 | -c "found renegotiation extension" \ |
| 5639 | -S "record counter limit reached: renegotiate" \ |
| 5640 | -C "=> renegotiate" \ |
| 5641 | -S "=> renegotiate" \ |
| 5642 | -S "write hello request" \ |
| 5643 | -S "SSL - An unexpected message was received from our peer" \ |
| 5644 | -S "failed" |
| 5645 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5646 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5647 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5648 | "$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] | 5649 | "$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] | 5650 | 0 \ |
| 5651 | -c "client hello, adding renegotiation extension" \ |
| 5652 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5653 | -s "found renegotiation extension" \ |
| 5654 | -s "server hello, secure renegotiation extension" \ |
| 5655 | -c "found renegotiation extension" \ |
| 5656 | -c "=> renegotiate" \ |
| 5657 | -s "=> renegotiate" \ |
| 5658 | -S "write hello request" |
| 5659 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5660 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5661 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5662 | "$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] | 5663 | "$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] | 5664 | 0 \ |
| 5665 | -c "client hello, adding renegotiation extension" \ |
| 5666 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5667 | -s "found renegotiation extension" \ |
| 5668 | -s "server hello, secure renegotiation extension" \ |
| 5669 | -c "found renegotiation extension" \ |
| 5670 | -c "=> renegotiate" \ |
| 5671 | -s "=> renegotiate" \ |
| 5672 | -s "write hello request" |
| 5673 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5674 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5676 | run_test "Renegotiation: openssl server, client-initiated" \ |
Gilles Peskine | ed8cc46 | 2024-09-06 13:52:14 +0200 | [diff] [blame] | 5677 | "$O_SRV -www $OPENSSL_S_SERVER_CLIENT_RENEGOTIATION -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5678 | "$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] | 5679 | 0 \ |
| 5680 | -c "client hello, adding renegotiation extension" \ |
| 5681 | -c "found renegotiation extension" \ |
| 5682 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5683 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5684 | -C "error" \ |
| 5685 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5686 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5687 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5688 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5690 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5691 | "$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] | 5692 | "$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] | 5693 | 0 \ |
| 5694 | -c "client hello, adding renegotiation extension" \ |
| 5695 | -c "found renegotiation extension" \ |
| 5696 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5697 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5698 | -C "error" \ |
| 5699 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5700 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5701 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5702 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5704 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5705 | "$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] | 5706 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5707 | 1 \ |
| 5708 | -c "client hello, adding renegotiation extension" \ |
| 5709 | -C "found renegotiation extension" \ |
| 5710 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5711 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 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 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [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 "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
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 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5721 | allow_legacy=0" \ |
| 5722 | 1 \ |
| 5723 | -c "client hello, adding renegotiation extension" \ |
| 5724 | -C "found renegotiation extension" \ |
| 5725 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5726 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5727 | -c "error" \ |
| 5728 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5729 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5730 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5731 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5733 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5734 | "$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] | 5735 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5736 | allow_legacy=1" \ |
| 5737 | 0 \ |
| 5738 | -c "client hello, adding renegotiation extension" \ |
| 5739 | -C "found renegotiation extension" \ |
| 5740 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5741 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5742 | -C "error" \ |
| 5743 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5744 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5747 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5748 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5749 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5750 | 0 \ |
| 5751 | -c "client hello, adding renegotiation extension" \ |
| 5752 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5753 | -s "found renegotiation extension" \ |
| 5754 | -s "server hello, secure renegotiation extension" \ |
| 5755 | -c "found renegotiation extension" \ |
| 5756 | -c "=> renegotiate" \ |
| 5757 | -s "=> renegotiate" \ |
| 5758 | -S "write hello request" |
| 5759 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5760 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5762 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5763 | "$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] | 5764 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5765 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5766 | 0 \ |
| 5767 | -c "client hello, adding renegotiation extension" \ |
| 5768 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5769 | -s "found renegotiation extension" \ |
| 5770 | -s "server hello, secure renegotiation extension" \ |
| 5771 | -c "found renegotiation extension" \ |
| 5772 | -c "=> renegotiate" \ |
| 5773 | -s "=> renegotiate" \ |
| 5774 | -s "write hello request" |
| 5775 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5778 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5779 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5780 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5781 | 0 \ |
| 5782 | -c "client hello, adding renegotiation extension" \ |
| 5783 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5784 | -s "found renegotiation extension" \ |
| 5785 | -s "server hello, secure renegotiation extension" \ |
| 5786 | -s "record counter limit reached: renegotiate" \ |
| 5787 | -c "=> renegotiate" \ |
| 5788 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5789 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5790 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5791 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5794 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5795 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5796 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5797 | 0 \ |
| 5798 | -c "client hello, adding renegotiation extension" \ |
| 5799 | -c "found renegotiation extension" \ |
| 5800 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5801 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5802 | -C "error" \ |
| 5803 | -s "Extra-header:" |
| 5804 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5805 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5806 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5807 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5808 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5810 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5811 | "$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] | 5812 | "$P_CLI debug_level=3" \ |
| 5813 | 0 \ |
| 5814 | -c "found renegotiation extension" \ |
| 5815 | -C "error" \ |
| 5816 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5817 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5818 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5821 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5822 | "$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] | 5823 | "$P_CLI debug_level=3" \ |
| 5824 | 0 \ |
| 5825 | -C "found renegotiation extension" \ |
| 5826 | -C "error" \ |
| 5827 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5828 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5829 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5830 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5832 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5833 | "$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] | 5834 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5835 | 1 \ |
| 5836 | -C "found renegotiation extension" \ |
| 5837 | -c "error" \ |
| 5838 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5839 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5840 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5843 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5844 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5845 | "$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] | 5846 | 0 \ |
| 5847 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5848 | -s "server hello, secure renegotiation extension" |
| 5849 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5850 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5851 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5853 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5854 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5855 | "$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] | 5856 | 0 \ |
| 5857 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5858 | -S "server hello, secure renegotiation extension" |
| 5859 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5860 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5861 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5863 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5864 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5865 | "$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] | 5866 | 1 \ |
| 5867 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5868 | -S "server hello, secure renegotiation extension" |
| 5869 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5870 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5871 | |
| 5872 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5874 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5875 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5876 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5877 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -c "Handshake was completed" \ |
| 5880 | |
| 5881 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5883 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5884 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5885 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5886 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5887 | 0 \ |
| 5888 | -c "Handshake was completed" \ |
| 5889 | |
| 5890 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5892 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5893 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5894 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5895 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5896 | 0 \ |
| 5897 | -c "Handshake was completed" \ |
| 5898 | |
| 5899 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5901 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5902 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5903 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5904 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5905 | 0 \ |
| 5906 | -c "Handshake was completed" \ |
| 5907 | |
| 5908 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5910 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5911 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5912 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5913 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5914 | 0 \ |
| 5915 | -c "Handshake was completed" \ |
| 5916 | |
| 5917 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5919 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5920 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5921 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5922 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5923 | 0 \ |
| 5924 | -c "Handshake was completed" \ |
| 5925 | |
| 5926 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5928 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5929 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5930 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5931 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5932 | 0 \ |
| 5933 | -c "Handshake was completed" \ |
| 5934 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5935 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5936 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5937 | |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5938 | # 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] | 5939 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5940 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5941 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5942 | "$P_CLI debug_level=3 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5943 | 1 \ |
| 5944 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5945 | -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] | 5946 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5947 | -c "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5948 | -c "X509 - Certificate verification failed" |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5949 | # MBEDTLS_X509_BADCERT_NOT_TRUSTED -> MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA |
| 5950 | # We don't check that the server receives the alert because it might |
| 5951 | # detect that its write end of the connection is closed and abort |
| 5952 | # before reading the alert message. |
| 5953 | |
| 5954 | run_test "Authentication: server badcert, client required (1.2)" \ |
| 5955 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5956 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 5957 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required" \ |
| 5958 | 1 \ |
| 5959 | -c "x509_verify_cert() returned" \ |
| 5960 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5961 | -c "! mbedtls_ssl_handshake returned" \ |
| 5962 | -c "send alert level=2 message=48" \ |
| 5963 | -c "X509 - Certificate verification failed" |
| 5964 | # 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] | 5965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5966 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5967 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5968 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 5969 | "$P_CLI force_version=tls13 debug_level=3 auth_mode=optional" \ |
| 5970 | 0 \ |
| 5971 | -c "x509_verify_cert() returned" \ |
| 5972 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5973 | -C "! mbedtls_ssl_handshake returned" \ |
| 5974 | -C "send alert level=2 message=48" \ |
| 5975 | -C "X509 - Certificate verification failed" |
| 5976 | |
| 5977 | run_test "Authentication: server badcert, client optional (1.2)" \ |
| 5978 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5979 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5980 | "$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] | 5981 | 0 \ |
| 5982 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5983 | -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] | 5984 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 5985 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5986 | -C "X509 - Certificate verification failed" |
| 5987 | |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 5988 | run_test "Authentication: server badcert, client none" \ |
| 5989 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5990 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 5991 | "$P_CLI debug_level=3 auth_mode=none" \ |
| 5992 | 0 \ |
| 5993 | -C "x509_verify_cert() returned" \ |
| 5994 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5995 | -C "! mbedtls_ssl_handshake returned" \ |
| 5996 | -C "send alert level=2 message=48" \ |
| 5997 | -C "X509 - Certificate verification failed" |
| 5998 | |
| 5999 | run_test "Authentication: server badcert, client none (1.2)" \ |
| 6000 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6001 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 6002 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 6003 | 0 \ |
| 6004 | -C "x509_verify_cert() returned" \ |
| 6005 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6006 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | d6e2069 | 2024-08-05 12:41:59 +0200 | [diff] [blame] | 6007 | -C "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | a3cf1a5 | 2024-08-05 11:21:01 +0200 | [diff] [blame] | 6008 | -C "X509 - Certificate verification failed" |
| 6009 | |
Manuel Pégourié-Gonnard | a0a781e | 2024-08-14 10:34:53 +0200 | [diff] [blame] | 6010 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 6011 | "$P_SRV" \ |
| 6012 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 6013 | 1 \ |
| 6014 | -c "x509_verify_cert() returned" \ |
| 6015 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6016 | -c "! Certificate verification flags"\ |
| 6017 | -c "! mbedtls_ssl_handshake returned" \ |
| 6018 | -c "SSL - No CA Chain is set, but required to operate" |
| 6019 | |
| 6020 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6021 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 6022 | "$P_SRV force_version=tls12" \ |
| 6023 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 6024 | 1 \ |
| 6025 | -c "x509_verify_cert() returned" \ |
| 6026 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6027 | -c "! Certificate verification flags"\ |
| 6028 | -c "! mbedtls_ssl_handshake returned" \ |
| 6029 | -c "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6030 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6031 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 6032 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6033 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 6034 | 0 \ |
| 6035 | -c "x509_verify_cert() returned" \ |
| 6036 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6037 | -c "! Certificate verification flags"\ |
| 6038 | -C "! mbedtls_ssl_handshake returned" \ |
| 6039 | -C "X509 - Certificate verification failed" \ |
| 6040 | -C "SSL - No CA Chain is set, but required to operate" |
| 6041 | |
| 6042 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6043 | run_test "Authentication: server goodcert, client optional, no trusted CA (1.2)" \ |
| 6044 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6045 | "$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] | 6046 | 0 \ |
| 6047 | -c "x509_verify_cert() returned" \ |
| 6048 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6049 | -c "! Certificate verification flags"\ |
| 6050 | -C "! mbedtls_ssl_handshake returned" \ |
| 6051 | -C "X509 - Certificate verification failed" \ |
| 6052 | -C "SSL - No CA Chain is set, but required to operate" |
| 6053 | |
Manuel Pégourié-Gonnard | 2b98a4e | 2024-08-14 10:44:02 +0200 | [diff] [blame] | 6054 | run_test "Authentication: server goodcert, client none, no trusted CA" \ |
| 6055 | "$P_SRV" \ |
| 6056 | "$P_CLI debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6057 | 0 \ |
| 6058 | -C "x509_verify_cert() returned" \ |
| 6059 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6060 | -C "! Certificate verification flags"\ |
| 6061 | -C "! mbedtls_ssl_handshake returned" \ |
| 6062 | -C "X509 - Certificate verification failed" \ |
| 6063 | -C "SSL - No CA Chain is set, but required to operate" |
| 6064 | |
| 6065 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 6066 | run_test "Authentication: server goodcert, client none, no trusted CA (1.2)" \ |
| 6067 | "$P_SRV" \ |
| 6068 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=none ca_file=none ca_path=none" \ |
| 6069 | 0 \ |
| 6070 | -C "x509_verify_cert() returned" \ |
| 6071 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6072 | -C "! Certificate verification flags"\ |
| 6073 | -C "! mbedtls_ssl_handshake returned" \ |
| 6074 | -C "X509 - Certificate verification failed" \ |
| 6075 | -C "SSL - No CA Chain is set, but required to operate" |
Manuel Pégourié-Gonnard | 060e284 | 2024-08-05 11:10:47 +0200 | [diff] [blame] | 6076 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6077 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6078 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6079 | # the client informs the server about the supported curves - it does, though, in the |
| 6080 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6081 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6082 | # different means to have the server ignoring the client's supported curve list. |
| 6083 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6084 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6085 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6086 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6087 | "$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] | 6088 | 1 \ |
| 6089 | -c "bad certificate (EC key curve)"\ |
| 6090 | -c "! Certificate verification flags"\ |
| 6091 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6092 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 6093 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6094 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6095 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6096 | "$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] | 6097 | 1 \ |
| 6098 | -c "bad certificate (EC key curve)"\ |
| 6099 | -c "! Certificate verification flags"\ |
| 6100 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6101 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6102 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6103 | run_test "Authentication: client SHA256, server required" \ |
| 6104 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6105 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6106 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6107 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6108 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6109 | -c "Supported Signature Algorithm found: 04 " \ |
| 6110 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6111 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6112 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6113 | run_test "Authentication: client SHA384, server required" \ |
| 6114 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6115 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6116 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6117 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6118 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6119 | -c "Supported Signature Algorithm found: 04 " \ |
| 6120 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 6121 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6122 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 6123 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 6124 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6125 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6126 | 1 \ |
| 6127 | -S "skip write certificate request" \ |
| 6128 | -C "skip parse certificate request" \ |
| 6129 | -c "got a certificate request" \ |
| 6130 | -c "= write certificate$" \ |
| 6131 | -C "skip write certificate$" \ |
| 6132 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 6133 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6134 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6135 | -s "No client certification received from the client, but required by the authentication mode" |
| 6136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6137 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6138 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6139 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6140 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6141 | 1 \ |
| 6142 | -S "skip write certificate request" \ |
| 6143 | -C "skip parse certificate request" \ |
| 6144 | -c "got a certificate request" \ |
| 6145 | -C "skip write certificate" \ |
| 6146 | -C "skip write certificate verify" \ |
| 6147 | -S "skip parse certificate verify" \ |
| 6148 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6149 | -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] | 6150 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6151 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6152 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 6153 | # We don't check that the client receives the alert because it might |
| 6154 | # detect that its write end of the connection is closed and abort |
| 6155 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6156 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6157 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6158 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 6159 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6160 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 6161 | 0 \ |
| 6162 | -S "skip write certificate request" \ |
| 6163 | -C "skip parse certificate request" \ |
| 6164 | -c "got a certificate request" \ |
| 6165 | -C "skip write certificate" \ |
| 6166 | -C "skip write certificate verify" \ |
| 6167 | -S "skip parse certificate verify" \ |
| 6168 | -S "x509_verify_cert() returned" \ |
| 6169 | -S "! The certificate is not correctly signed" \ |
| 6170 | -S "X509 - Certificate verification failed" |
| 6171 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6172 | run_test "Authentication: client cert not trusted, server required" \ |
| 6173 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6174 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6175 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6176 | 1 \ |
| 6177 | -S "skip write certificate request" \ |
| 6178 | -C "skip parse certificate request" \ |
| 6179 | -c "got a certificate request" \ |
| 6180 | -C "skip write certificate" \ |
| 6181 | -C "skip write certificate verify" \ |
| 6182 | -S "skip parse certificate verify" \ |
| 6183 | -s "x509_verify_cert() returned" \ |
| 6184 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6185 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6186 | -s "X509 - Certificate verification failed" |
| 6187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6188 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6189 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6190 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6191 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6192 | 0 \ |
| 6193 | -S "skip write certificate request" \ |
| 6194 | -C "skip parse certificate request" \ |
| 6195 | -c "got a certificate request" \ |
| 6196 | -C "skip write certificate" \ |
| 6197 | -C "skip write certificate verify" \ |
| 6198 | -S "skip parse certificate verify" \ |
| 6199 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6200 | -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] | 6201 | -S "! mbedtls_ssl_handshake returned" \ |
| 6202 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6203 | -S "X509 - Certificate verification failed" |
| 6204 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6205 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6206 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6207 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6208 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6209 | 0 \ |
| 6210 | -s "skip write certificate request" \ |
| 6211 | -C "skip parse certificate request" \ |
| 6212 | -c "got no certificate request" \ |
| 6213 | -c "skip write certificate" \ |
| 6214 | -c "skip write certificate verify" \ |
| 6215 | -s "skip parse certificate verify" \ |
| 6216 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6217 | -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] | 6218 | -S "! mbedtls_ssl_handshake returned" \ |
| 6219 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6220 | -S "X509 - Certificate verification failed" |
| 6221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6222 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6223 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6224 | "$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] | 6225 | 0 \ |
| 6226 | -S "skip write certificate request" \ |
| 6227 | -C "skip parse certificate request" \ |
| 6228 | -c "got a certificate request" \ |
| 6229 | -C "skip write certificate$" \ |
| 6230 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6231 | -c "skip write certificate verify" \ |
| 6232 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6233 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6234 | -S "! mbedtls_ssl_handshake returned" \ |
| 6235 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6236 | -S "X509 - Certificate verification failed" |
| 6237 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6238 | requires_openssl_tls1_3_with_compatible_ephemeral |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6239 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6240 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6241 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6242 | 0 \ |
| 6243 | -S "skip write certificate request" \ |
| 6244 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6245 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6246 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6247 | -S "X509 - Certificate verification failed" |
| 6248 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6249 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6250 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6251 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6252 | "$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] | 6253 | 0 \ |
| 6254 | -C "skip parse certificate request" \ |
| 6255 | -c "got a certificate request" \ |
| 6256 | -C "skip write certificate$" \ |
| 6257 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6258 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6259 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6261 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6262 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6263 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6264 | 1 \ |
| 6265 | -C "skip parse certificate request" \ |
| 6266 | -c "got a certificate request" \ |
| 6267 | -C "skip write certificate$" \ |
| 6268 | -c "skip write certificate verify" \ |
| 6269 | -c "! mbedtls_ssl_handshake returned" |
| 6270 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6271 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6272 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6273 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6274 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6275 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6276 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6277 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6278 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6279 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6280 | # 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] | 6281 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6282 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6283 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6284 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6285 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6286 | "$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] | 6287 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6288 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6289 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6290 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6291 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6292 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6293 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6294 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6295 | "$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] | 6296 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6297 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6298 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6299 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6300 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6301 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6302 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6303 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | e1cc926 | 2024-08-14 09:47:38 +0200 | [diff] [blame] | 6304 | "$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] | 6305 | auth_mode=optional" \ |
| 6306 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6307 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6308 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6309 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6310 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6311 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6312 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6313 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6314 | "$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] | 6315 | auth_mode=none" \ |
| 6316 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6317 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6318 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6319 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6320 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6321 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6322 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6323 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6324 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6325 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6326 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6327 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6328 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6329 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6330 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6331 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6332 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6333 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6334 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6335 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6336 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6337 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6338 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6339 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6340 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6341 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6342 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6343 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6344 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6345 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6346 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6347 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6348 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6349 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6350 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6351 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6352 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6353 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6354 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6355 | # Tests for CA list in CertificateRequest messages |
| 6356 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6357 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6358 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6359 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6360 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6361 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6362 | 0 \ |
| 6363 | -s "requested DN" |
| 6364 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6365 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6366 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6367 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6368 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6369 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6370 | 0 \ |
| 6371 | -S "requested DN" |
| 6372 | |
| 6373 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6374 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6375 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6376 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6377 | 1 \ |
| 6378 | -S "requested DN" \ |
| 6379 | -s "x509_verify_cert() returned" \ |
| 6380 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6381 | -s "! mbedtls_ssl_handshake returned" \ |
| 6382 | -c "! mbedtls_ssl_handshake returned" \ |
| 6383 | -s "X509 - Certificate verification failed" |
| 6384 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6385 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6386 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6387 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6388 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6389 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6390 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6391 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6392 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6393 | 0 \ |
| 6394 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6395 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6396 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6397 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6398 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6399 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6400 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6401 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6402 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6403 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6404 | 0 \ |
| 6405 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6406 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6407 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6408 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6409 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6410 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6411 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6412 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6413 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6414 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6415 | 0 \ |
| 6416 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6417 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6418 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6419 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6420 | |
| 6421 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6422 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6423 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6424 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6425 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6426 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6427 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6428 | -c "x509_verify_cert() returned" \ |
| 6429 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6430 | -c "! mbedtls_ssl_handshake returned" \ |
| 6431 | -c "X509 - Certificate verification failed" |
| 6432 | |
| 6433 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6434 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6435 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6436 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6437 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6438 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6439 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6440 | -c "x509_verify_cert() returned" \ |
| 6441 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6442 | -C "! mbedtls_ssl_handshake returned" \ |
| 6443 | -C "X509 - Certificate verification failed" |
| 6444 | |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6445 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6446 | run_test "Authentication, CA callback: server badcert, client none" \ |
| 6447 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6448 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 6449 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=none" \ |
| 6450 | 0 \ |
| 6451 | -C "use CA callback for X.509 CRT verification" \ |
| 6452 | -C "x509_verify_cert() returned" \ |
| 6453 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6454 | -C "! mbedtls_ssl_handshake returned" \ |
| 6455 | -C "X509 - Certificate verification failed" |
| 6456 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6457 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6458 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6459 | # the client informs the server about the supported curves - it does, though, in the |
| 6460 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6461 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6462 | # different means to have the server ignoring the client's supported curve list. |
| 6463 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6464 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6465 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6466 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6467 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6468 | "$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] | 6469 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6470 | -c "use CA callback for X.509 CRT verification" \ |
| 6471 | -c "bad certificate (EC key curve)" \ |
| 6472 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6473 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6474 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6475 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6476 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6477 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6478 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6479 | "$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] | 6480 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6481 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6482 | -c "bad certificate (EC key curve)"\ |
| 6483 | -c "! Certificate verification flags"\ |
| 6484 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6485 | |
| 6486 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6487 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6488 | run_test "Authentication, CA callback: client SHA384, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6489 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6490 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6491 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6492 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6493 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6494 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6495 | -c "Supported Signature Algorithm found: 04 " \ |
| 6496 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6497 | |
| 6498 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6499 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 84442a3 | 2024-04-03 08:57:09 +0200 | [diff] [blame] | 6500 | run_test "Authentication, CA callback: client SHA256, server required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6501 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6502 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6503 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6504 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6505 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6506 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6507 | -c "Supported Signature Algorithm found: 04 " \ |
| 6508 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6509 | |
| 6510 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6511 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6512 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6513 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6514 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6515 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6516 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6517 | -S "skip write certificate request" \ |
| 6518 | -C "skip parse certificate request" \ |
| 6519 | -c "got a certificate request" \ |
| 6520 | -C "skip write certificate" \ |
| 6521 | -C "skip write certificate verify" \ |
| 6522 | -S "skip parse certificate verify" \ |
| 6523 | -s "x509_verify_cert() returned" \ |
| 6524 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6525 | -s "! mbedtls_ssl_handshake returned" \ |
| 6526 | -s "send alert level=2 message=48" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6527 | -s "X509 - Certificate verification failed" |
| 6528 | # We don't check that the client receives the alert because it might |
| 6529 | # detect that its write end of the connection is closed and abort |
| 6530 | # before reading the alert message. |
| 6531 | |
| 6532 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6533 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6534 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6535 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6536 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6537 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6538 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6539 | -S "skip write certificate request" \ |
| 6540 | -C "skip parse certificate request" \ |
| 6541 | -c "got a certificate request" \ |
| 6542 | -C "skip write certificate" \ |
| 6543 | -C "skip write certificate verify" \ |
| 6544 | -S "skip parse certificate verify" \ |
| 6545 | -s "x509_verify_cert() returned" \ |
| 6546 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6547 | -s "! mbedtls_ssl_handshake returned" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6548 | -s "X509 - Certificate verification failed" |
| 6549 | |
| 6550 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6551 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6552 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6553 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6554 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6555 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6556 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6557 | -S "skip write certificate request" \ |
| 6558 | -C "skip parse certificate request" \ |
| 6559 | -c "got a certificate request" \ |
| 6560 | -C "skip write certificate" \ |
| 6561 | -C "skip write certificate verify" \ |
| 6562 | -S "skip parse certificate verify" \ |
| 6563 | -s "x509_verify_cert() returned" \ |
| 6564 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6565 | -S "! mbedtls_ssl_handshake returned" \ |
| 6566 | -C "! mbedtls_ssl_handshake returned" \ |
| 6567 | -S "X509 - Certificate verification failed" |
| 6568 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6569 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6570 | requires_full_size_output_buffer |
| 6571 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6572 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6573 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6574 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6575 | "$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] | 6576 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6577 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6578 | -C "X509 - A fatal error occurred" |
| 6579 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6580 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6581 | requires_full_size_output_buffer |
| 6582 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6583 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6584 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6585 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6586 | "$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] | 6587 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6588 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6589 | -c "X509 - A fatal error occurred" |
| 6590 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6591 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6592 | requires_full_size_output_buffer |
| 6593 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6594 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6595 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6596 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6597 | "$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] | 6598 | debug_level=3 auth_mode=optional" \ |
| 6599 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6600 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6601 | -c "X509 - A fatal error occurred" |
| 6602 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6603 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6604 | requires_full_size_output_buffer |
| 6605 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6606 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6607 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6608 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6609 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6610 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6611 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6612 | -s "X509 - A fatal error occurred" |
| 6613 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6614 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6615 | requires_full_size_output_buffer |
| 6616 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6617 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6618 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6619 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6620 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6621 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6622 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6623 | -s "X509 - A fatal error occurred" |
| 6624 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6625 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6626 | requires_full_size_output_buffer |
| 6627 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6628 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | 8d5da8f | 2024-04-03 09:10:02 +0200 | [diff] [blame] | 6629 | "$P_SRV ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6630 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6631 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6632 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6633 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6634 | -S "X509 - A fatal error occurred" |
| 6635 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6636 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6637 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6638 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6639 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6640 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6641 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6642 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6643 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6644 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6645 | 0 \ |
| 6646 | -c "signed using.*ECDSA with SHA256" \ |
| 6647 | -C "signed using.*ECDSA with SHA1" |
| 6648 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6649 | # tests for SNI |
| 6650 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6651 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6652 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6653 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6654 | 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] | 6655 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6656 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6657 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6658 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6659 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6660 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6661 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6662 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6663 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6664 | 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] | 6665 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6666 | 0 \ |
| 6667 | -s "parse ServerName extension" \ |
| 6668 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6669 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6670 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6671 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6672 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6673 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6674 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6675 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,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] | 6676 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6677 | 0 \ |
| 6678 | -s "parse ServerName extension" \ |
| 6679 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6680 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6681 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6682 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6683 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6684 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6685 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6686 | 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] | 6687 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6688 | 1 \ |
| 6689 | -s "parse ServerName extension" \ |
| 6690 | -s "ssl_sni_wrapper() returned" \ |
| 6691 | -s "mbedtls_ssl_handshake returned" \ |
| 6692 | -c "mbedtls_ssl_handshake returned" \ |
| 6693 | -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] | 6694 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6695 | run_test "SNI: client auth no override: optional" \ |
| 6696 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6697 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6698 | 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] | 6699 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6700 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6701 | -S "skip write certificate request" \ |
| 6702 | -C "skip parse certificate request" \ |
| 6703 | -c "got a certificate request" \ |
| 6704 | -C "skip write certificate" \ |
| 6705 | -C "skip write certificate verify" \ |
| 6706 | -S "skip parse certificate verify" |
| 6707 | |
| 6708 | run_test "SNI: client auth override: none -> optional" \ |
| 6709 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6710 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6711 | 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] | 6712 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6713 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6714 | -S "skip write certificate request" \ |
| 6715 | -C "skip parse certificate request" \ |
| 6716 | -c "got a certificate request" \ |
| 6717 | -C "skip write certificate" \ |
| 6718 | -C "skip write certificate verify" \ |
| 6719 | -S "skip parse certificate verify" |
| 6720 | |
| 6721 | run_test "SNI: client auth override: optional -> none" \ |
| 6722 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6723 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6724 | 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] | 6725 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6726 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6727 | -s "skip write certificate request" \ |
| 6728 | -C "skip parse certificate request" \ |
| 6729 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6730 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6731 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6732 | run_test "SNI: CA no override" \ |
| 6733 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6734 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6735 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6736 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6737 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6738 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6739 | 1 \ |
| 6740 | -S "skip write certificate request" \ |
| 6741 | -C "skip parse certificate request" \ |
| 6742 | -c "got a certificate request" \ |
| 6743 | -C "skip write certificate" \ |
| 6744 | -C "skip write certificate verify" \ |
| 6745 | -S "skip parse certificate verify" \ |
| 6746 | -s "x509_verify_cert() returned" \ |
| 6747 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6748 | -S "The certificate has been revoked (is on a CRL)" |
| 6749 | |
| 6750 | run_test "SNI: CA override" \ |
| 6751 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6752 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6753 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6754 | 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] | 6755 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6756 | 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] | 6757 | 0 \ |
| 6758 | -S "skip write certificate request" \ |
| 6759 | -C "skip parse certificate request" \ |
| 6760 | -c "got a certificate request" \ |
| 6761 | -C "skip write certificate" \ |
| 6762 | -C "skip write certificate verify" \ |
| 6763 | -S "skip parse certificate verify" \ |
| 6764 | -S "x509_verify_cert() returned" \ |
| 6765 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6766 | -S "The certificate has been revoked (is on a CRL)" |
| 6767 | |
| 6768 | run_test "SNI: CA override with CRL" \ |
| 6769 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6770 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6771 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6772 | 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] | 6773 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6774 | 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] | 6775 | 1 \ |
| 6776 | -S "skip write certificate request" \ |
| 6777 | -C "skip parse certificate request" \ |
| 6778 | -c "got a certificate request" \ |
| 6779 | -C "skip write certificate" \ |
| 6780 | -C "skip write certificate verify" \ |
| 6781 | -S "skip parse certificate verify" \ |
| 6782 | -s "x509_verify_cert() returned" \ |
| 6783 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6784 | -s "send alert level=2 message=44" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6785 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6786 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6787 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6788 | # Tests for SNI and DTLS |
| 6789 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6790 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6792 | run_test "SNI: DTLS, no SNI callback" \ |
| 6793 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6794 | 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] | 6795 | "$P_CLI server_name=localhost dtls=1" \ |
| 6796 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6797 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6798 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6799 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6800 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6802 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6803 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6804 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6805 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6806 | "$P_CLI server_name=localhost dtls=1" \ |
| 6807 | 0 \ |
| 6808 | -s "parse ServerName extension" \ |
| 6809 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6810 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6811 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6812 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6814 | run_test "SNI: DTLS, matching cert 2" \ |
| 6815 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6816 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6817 | 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] | 6818 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6819 | 0 \ |
| 6820 | -s "parse ServerName extension" \ |
| 6821 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6822 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6825 | run_test "SNI: DTLS, no matching cert" \ |
| 6826 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6827 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6828 | 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] | 6829 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6830 | 1 \ |
| 6831 | -s "parse ServerName extension" \ |
| 6832 | -s "ssl_sni_wrapper() returned" \ |
| 6833 | -s "mbedtls_ssl_handshake returned" \ |
| 6834 | -c "mbedtls_ssl_handshake returned" \ |
| 6835 | -c "SSL - A fatal alert message was received from our peer" |
| 6836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6838 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6839 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6840 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6841 | 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] | 6842 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6843 | 0 \ |
| 6844 | -S "skip write certificate request" \ |
| 6845 | -C "skip parse certificate request" \ |
| 6846 | -c "got a certificate request" \ |
| 6847 | -C "skip write certificate" \ |
| 6848 | -C "skip write certificate verify" \ |
| 6849 | -S "skip parse certificate verify" |
| 6850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6852 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6853 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6854 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6855 | 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] | 6856 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6857 | 0 \ |
| 6858 | -S "skip write certificate request" \ |
| 6859 | -C "skip parse certificate request" \ |
| 6860 | -c "got a certificate request" \ |
| 6861 | -C "skip write certificate" \ |
| 6862 | -C "skip write certificate verify" \ |
| 6863 | -S "skip parse certificate verify" |
| 6864 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6866 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6867 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6868 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6869 | 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] | 6870 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6871 | 0 \ |
| 6872 | -s "skip write certificate request" \ |
| 6873 | -C "skip parse certificate request" \ |
| 6874 | -c "got no certificate request" \ |
| 6875 | -c "skip write certificate" \ |
| 6876 | -c "skip write certificate verify" \ |
| 6877 | -s "skip parse certificate verify" |
| 6878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6880 | run_test "SNI: DTLS, CA no override" \ |
| 6881 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6882 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6883 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6884 | 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] | 6885 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6886 | 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] | 6887 | 1 \ |
| 6888 | -S "skip write certificate request" \ |
| 6889 | -C "skip parse certificate request" \ |
| 6890 | -c "got a certificate request" \ |
| 6891 | -C "skip write certificate" \ |
| 6892 | -C "skip write certificate verify" \ |
| 6893 | -S "skip parse certificate verify" \ |
| 6894 | -s "x509_verify_cert() returned" \ |
| 6895 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6896 | -S "The certificate has been revoked (is on a CRL)" |
| 6897 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6899 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6900 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6901 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6902 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6903 | 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] | 6904 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6905 | 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] | 6906 | 0 \ |
| 6907 | -S "skip write certificate request" \ |
| 6908 | -C "skip parse certificate request" \ |
| 6909 | -c "got a certificate request" \ |
| 6910 | -C "skip write certificate" \ |
| 6911 | -C "skip write certificate verify" \ |
| 6912 | -S "skip parse certificate verify" \ |
| 6913 | -S "x509_verify_cert() returned" \ |
| 6914 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6915 | -S "The certificate has been revoked (is on a CRL)" |
| 6916 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6918 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6919 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6920 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6921 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6922 | 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] | 6923 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6924 | 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] | 6925 | 1 \ |
| 6926 | -S "skip write certificate request" \ |
| 6927 | -C "skip parse certificate request" \ |
| 6928 | -c "got a certificate request" \ |
| 6929 | -C "skip write certificate" \ |
| 6930 | -C "skip write certificate verify" \ |
| 6931 | -S "skip parse certificate verify" \ |
| 6932 | -s "x509_verify_cert() returned" \ |
| 6933 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6934 | -s "send alert level=2 message=44" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6935 | -s "The certificate has been revoked (is on a CRL)" |
Manuel Pégourié-Gonnard | 4192bba | 2024-08-05 12:44:57 +0200 | [diff] [blame] | 6936 | # MBEDTLS_X509_BADCERT_REVOKED -> MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6937 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6938 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6939 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6940 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6941 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6942 | "$P_CLI nbio=2 tickets=0" \ |
| 6943 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6944 | -S "mbedtls_ssl_handshake returned" \ |
| 6945 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6946 | -c "Read from server: .* bytes read" |
| 6947 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6948 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6949 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6950 | "$P_CLI nbio=2 tickets=0" \ |
| 6951 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6952 | -S "mbedtls_ssl_handshake returned" \ |
| 6953 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6954 | -c "Read from server: .* bytes read" |
| 6955 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6956 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6957 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6958 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6959 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6960 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6961 | -S "mbedtls_ssl_handshake returned" \ |
| 6962 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6963 | -c "Read from server: .* bytes read" |
| 6964 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6965 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6966 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6967 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6968 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6969 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6970 | -S "mbedtls_ssl_handshake returned" \ |
| 6971 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6972 | -c "Read from server: .* bytes read" |
| 6973 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6974 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6975 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6976 | 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] | 6977 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6978 | "$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] | 6979 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6980 | -S "mbedtls_ssl_handshake returned" \ |
| 6981 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6982 | -c "Read from server: .* bytes read" |
| 6983 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6985 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6986 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6988 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6989 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 6990 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6991 | 0 \ |
| 6992 | -S "mbedtls_ssl_handshake returned" \ |
| 6993 | -C "mbedtls_ssl_handshake returned" \ |
| 6994 | -c "Read from server: .* bytes read" |
| 6995 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6996 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6997 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6998 | 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] | 6999 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7000 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 7001 | 0 \ |
| 7002 | -S "mbedtls_ssl_handshake returned" \ |
| 7003 | -C "mbedtls_ssl_handshake returned" \ |
| 7004 | -c "Read from server: .* bytes read" |
| 7005 | |
| 7006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7007 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7008 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7009 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7010 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 7011 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7012 | "$P_CLI nbio=2 tickets=1 new_session_tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7013 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7014 | -S "mbedtls_ssl_handshake returned" \ |
| 7015 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7016 | -c "Read from server: .* bytes read" |
| 7017 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7018 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7019 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7020 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7021 | "$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] | 7022 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7023 | -S "mbedtls_ssl_handshake returned" \ |
| 7024 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 7025 | -c "Read from server: .* bytes read" |
| 7026 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7027 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 7028 | |
| 7029 | run_test "Event-driven I/O: basic handshake" \ |
| 7030 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 7031 | "$P_CLI event=1 tickets=0" \ |
| 7032 | 0 \ |
| 7033 | -S "mbedtls_ssl_handshake returned" \ |
| 7034 | -C "mbedtls_ssl_handshake returned" \ |
| 7035 | -c "Read from server: .* bytes read" |
| 7036 | |
| 7037 | run_test "Event-driven I/O: client auth" \ |
| 7038 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 7039 | "$P_CLI event=1 tickets=0" \ |
| 7040 | 0 \ |
| 7041 | -S "mbedtls_ssl_handshake returned" \ |
| 7042 | -C "mbedtls_ssl_handshake returned" \ |
| 7043 | -c "Read from server: .* bytes read" |
| 7044 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7045 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7046 | run_test "Event-driven I/O: ticket" \ |
| 7047 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7048 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7049 | 0 \ |
| 7050 | -S "mbedtls_ssl_handshake returned" \ |
| 7051 | -C "mbedtls_ssl_handshake returned" \ |
| 7052 | -c "Read from server: .* bytes read" |
| 7053 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7054 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7055 | run_test "Event-driven I/O: ticket + client auth" \ |
| 7056 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7057 | "$P_CLI event=1 tickets=1 new_session_tickets=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7058 | 0 \ |
| 7059 | -S "mbedtls_ssl_handshake returned" \ |
| 7060 | -C "mbedtls_ssl_handshake returned" \ |
| 7061 | -c "Read from server: .* bytes read" |
| 7062 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7063 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7064 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7065 | 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] | 7066 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7067 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7068 | 0 \ |
| 7069 | -S "mbedtls_ssl_handshake returned" \ |
| 7070 | -C "mbedtls_ssl_handshake returned" \ |
| 7071 | -c "Read from server: .* bytes read" |
| 7072 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7074 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7075 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7076 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7077 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 7078 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7079 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7080 | 0 \ |
| 7081 | -S "mbedtls_ssl_handshake returned" \ |
| 7082 | -C "mbedtls_ssl_handshake returned" \ |
| 7083 | -c "Read from server: .* bytes read" |
| 7084 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7085 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7086 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7087 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7088 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7089 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 7090 | 0 \ |
| 7091 | -S "mbedtls_ssl_handshake returned" \ |
| 7092 | -C "mbedtls_ssl_handshake returned" \ |
| 7093 | -c "Read from server: .* bytes read" |
| 7094 | |
| 7095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7096 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7097 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7098 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7099 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 7100 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | aa80f53 | 2024-09-04 10:51:33 +0200 | [diff] [blame] | 7101 | "$P_CLI event=1 tickets=1 new_session_tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7102 | 0 \ |
| 7103 | -S "mbedtls_ssl_handshake returned" \ |
| 7104 | -C "mbedtls_ssl_handshake returned" \ |
| 7105 | -c "Read from server: .* bytes read" |
| 7106 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 7107 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7108 | run_test "Event-driven I/O: session-id resume" \ |
| 7109 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 7110 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 7111 | 0 \ |
| 7112 | -S "mbedtls_ssl_handshake returned" \ |
| 7113 | -C "mbedtls_ssl_handshake returned" \ |
| 7114 | -c "Read from server: .* bytes read" |
| 7115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7117 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 7118 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 7119 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7120 | 0 \ |
| 7121 | -c "Read from server: .* bytes read" |
| 7122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7124 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 7125 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 7126 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 7127 | 0 \ |
| 7128 | -c "Read from server: .* bytes read" |
| 7129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7131 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7132 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 7133 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 7134 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7135 | 0 \ |
| 7136 | -c "Read from server: .* bytes read" |
| 7137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7140 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 7141 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 7142 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 7143 | 0 \ |
| 7144 | -c "Read from server: .* bytes read" |
| 7145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7148 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 7149 | "$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] | 7150 | "$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] | 7151 | 0 \ |
| 7152 | -c "Read from server: .* bytes read" |
| 7153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 7155 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7156 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 7157 | "$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] | 7158 | "$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] | 7159 | 0 \ |
| 7160 | -c "Read from server: .* bytes read" |
| 7161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 7163 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 7164 | "$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] | 7165 | "$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] | 7166 | 0 \ |
| 7167 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7168 | |
| 7169 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 7170 | # During session resumption, the client will send its ApplicationData record |
| 7171 | # within the same datagram as the Finished messages. In this situation, the |
| 7172 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 7173 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7175 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7176 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 7177 | "$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] | 7178 | "$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] | 7179 | 0 \ |
| 7180 | -c "Read from server: .* bytes read" |
| 7181 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7182 | # Tests for version negotiation. Some information to ease the understanding |
| 7183 | # of the version negotiation test titles below: |
| 7184 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 7185 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 7186 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 7187 | # TLS 1.3/1.2 may be enabled or not. |
| 7188 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7189 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7190 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7191 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7192 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7193 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7194 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7195 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7196 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7197 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7198 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7199 | 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] | 7200 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7201 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7202 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7203 | -S "mbedtls_ssl_handshake returned" \ |
| 7204 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7205 | -s "Protocol is TLSv1.2" \ |
| 7206 | -c "Protocol is TLSv1.2" |
| 7207 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7208 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7209 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7212 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7213 | 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] | 7214 | "$P_SRV max_version=tls12" \ |
| 7215 | "$P_CLI max_version=tls12" \ |
| 7216 | 0 \ |
| 7217 | -S "mbedtls_ssl_handshake returned" \ |
| 7218 | -C "mbedtls_ssl_handshake returned" \ |
| 7219 | -s "Protocol is TLSv1.2" \ |
| 7220 | -c "Protocol is TLSv1.2" |
| 7221 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7223 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7224 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7225 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7226 | 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] | 7227 | "$P_SRV" \ |
| 7228 | "$P_CLI" \ |
| 7229 | 0 \ |
| 7230 | -S "mbedtls_ssl_handshake returned" \ |
| 7231 | -C "mbedtls_ssl_handshake returned" \ |
| 7232 | -s "Protocol is TLSv1.3" \ |
| 7233 | -c "Protocol is TLSv1.3" |
| 7234 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7236 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7239 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7240 | 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] | 7241 | "$P_SRV min_version=tls13" \ |
| 7242 | "$P_CLI min_version=tls13" \ |
| 7243 | 0 \ |
| 7244 | -S "mbedtls_ssl_handshake returned" \ |
| 7245 | -C "mbedtls_ssl_handshake returned" \ |
| 7246 | -s "Protocol is TLSv1.3" \ |
| 7247 | -c "Protocol is TLSv1.3" |
| 7248 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7249 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7250 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7253 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7254 | 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] | 7255 | "$P_SRV" \ |
| 7256 | "$P_CLI" \ |
| 7257 | 0 \ |
| 7258 | -S "mbedtls_ssl_handshake returned" \ |
| 7259 | -C "mbedtls_ssl_handshake returned" \ |
| 7260 | -s "Protocol is TLSv1.3" \ |
| 7261 | -c "Protocol is TLSv1.3" |
| 7262 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7263 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7264 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7267 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7268 | 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] | 7269 | "$P_SRV min_version=tls13" \ |
| 7270 | "$P_CLI" \ |
| 7271 | 0 \ |
| 7272 | -S "mbedtls_ssl_handshake returned" \ |
| 7273 | -C "mbedtls_ssl_handshake returned" \ |
| 7274 | -s "Protocol is TLSv1.3" \ |
| 7275 | -c "Protocol is TLSv1.3" |
| 7276 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7277 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7278 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7281 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7282 | 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] | 7283 | "$P_SRV max_version=tls12" \ |
| 7284 | "$P_CLI" \ |
| 7285 | 0 \ |
| 7286 | -S "mbedtls_ssl_handshake returned" \ |
| 7287 | -C "mbedtls_ssl_handshake returned" \ |
| 7288 | -s "Protocol is TLSv1.2" \ |
| 7289 | -c "Protocol is TLSv1.2" |
| 7290 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7291 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7292 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7295 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7296 | 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] | 7297 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7298 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7299 | 0 \ |
| 7300 | -S "mbedtls_ssl_handshake returned" \ |
| 7301 | -C "mbedtls_ssl_handshake returned" \ |
| 7302 | -s "Protocol is TLSv1.2" \ |
| 7303 | -c "Protocol is TLSv1.2" |
| 7304 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7305 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7306 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7309 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7310 | 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] | 7311 | "$P_SRV" \ |
| 7312 | "$P_CLI min_version=tls13" \ |
| 7313 | 0 \ |
| 7314 | -S "mbedtls_ssl_handshake returned" \ |
| 7315 | -C "mbedtls_ssl_handshake returned" \ |
| 7316 | -s "Protocol is TLSv1.3" \ |
| 7317 | -c "Protocol is TLSv1.3" |
| 7318 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7320 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7323 | 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] | 7324 | "$P_SRV min_version=tls13" \ |
| 7325 | "$P_CLI max_version=tls12" \ |
| 7326 | 1 \ |
| 7327 | -s "Handshake protocol not within min/max boundaries" \ |
| 7328 | -S "Protocol is TLSv1.2" \ |
| 7329 | -C "Protocol is TLSv1.2" \ |
| 7330 | -S "Protocol is TLSv1.3" \ |
| 7331 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7332 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7333 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7334 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7337 | 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] | 7338 | "$P_SRV max_version=tls12" \ |
| 7339 | "$P_CLI min_version=tls13" \ |
| 7340 | 1 \ |
| 7341 | -s "The handshake negotiation failed" \ |
| 7342 | -S "Protocol is TLSv1.2" \ |
| 7343 | -C "Protocol is TLSv1.2" \ |
| 7344 | -S "Protocol is TLSv1.3" \ |
| 7345 | -C "Protocol is TLSv1.3" |
| 7346 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7347 | # Tests of version negotiation on server side against GnuTLS client |
| 7348 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7349 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7351 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7352 | 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] | 7353 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7354 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7355 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7356 | -S "mbedtls_ssl_handshake returned" \ |
| 7357 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7358 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7359 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7362 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7363 | 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] | 7364 | "$P_SRV max_version=tls12" \ |
| 7365 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7366 | 0 \ |
| 7367 | -S "mbedtls_ssl_handshake returned" \ |
| 7368 | -s "Protocol is TLSv1.2" |
| 7369 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7370 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7372 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7373 | 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] | 7374 | "$P_SRV" \ |
| 7375 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7376 | 0 \ |
| 7377 | -S "mbedtls_ssl_handshake returned" \ |
| 7378 | -s "Protocol is TLSv1.3" |
| 7379 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7380 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7382 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7383 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7384 | 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] | 7385 | "$P_SRV min_version=tls13" \ |
| 7386 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7387 | 0 \ |
| 7388 | -S "mbedtls_ssl_handshake returned" \ |
| 7389 | -s "Protocol is TLSv1.3" |
| 7390 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7393 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7394 | 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] | 7395 | "$P_SRV" \ |
| 7396 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7397 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7398 | -S "mbedtls_ssl_handshake returned" \ |
| 7399 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7400 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7401 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7402 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7404 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7405 | 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] | 7406 | "$P_SRV" \ |
| 7407 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7408 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7409 | -S "mbedtls_ssl_handshake returned" \ |
| 7410 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7411 | |
| 7412 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7413 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7414 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7415 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7416 | # client then detects the downgrade indication and aborts the handshake even |
| 7417 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7418 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7419 | # implementation that are otherwise not exercised. |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7420 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7423 | 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] | 7424 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7425 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7426 | 1 \ |
| 7427 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7428 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7429 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7432 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7433 | 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] | 7434 | "$P_SRV min_version=tls13" \ |
| 7435 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7436 | 0 \ |
| 7437 | -S "mbedtls_ssl_handshake returned" \ |
| 7438 | -s "Protocol is TLSv1.3" |
| 7439 | |
| 7440 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7441 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7442 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7443 | 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] | 7444 | "$P_SRV" \ |
| 7445 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7446 | 0 \ |
| 7447 | -S "mbedtls_ssl_handshake returned" \ |
| 7448 | -s "Protocol is TLSv1.2" |
| 7449 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7453 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7454 | 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] | 7455 | "$P_SRV max_version=tls12" \ |
| 7456 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7457 | 0 \ |
| 7458 | -S "mbedtls_ssl_handshake returned" \ |
| 7459 | -s "Protocol is TLSv1.2" |
| 7460 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7462 | 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] | 7463 | "$P_SRV" \ |
| 7464 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7465 | 1 \ |
| 7466 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7467 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7468 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7469 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7470 | 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] | 7471 | "$P_SRV" \ |
| 7472 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7473 | 1 \ |
| 7474 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7475 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7476 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7477 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7478 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7479 | 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] | 7480 | "$P_SRV" \ |
| 7481 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7482 | 1 \ |
| 7483 | -s "Handshake protocol not within min/max boundaries" \ |
| 7484 | -S "Protocol is TLSv1.2" |
| 7485 | |
| 7486 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7487 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7488 | 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] | 7489 | "$P_SRV" \ |
| 7490 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7491 | 1 \ |
| 7492 | -S "Handshake protocol not within min/max boundaries" \ |
| 7493 | -s "The handshake negotiation failed" \ |
| 7494 | -S "Protocol is TLSv1.3" |
| 7495 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7499 | 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] | 7500 | "$P_SRV min_version=tls13" \ |
| 7501 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7502 | 1 \ |
| 7503 | -s "Handshake protocol not within min/max boundaries" \ |
| 7504 | -S "Protocol is TLSv1.2" |
| 7505 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7506 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7509 | 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] | 7510 | "$P_SRV max_version=tls12" \ |
| 7511 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7512 | 1 \ |
| 7513 | -S "Handshake protocol not within min/max boundaries" \ |
| 7514 | -s "The handshake negotiation failed" \ |
| 7515 | -S "Protocol is TLSv1.3" |
| 7516 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7517 | # Tests of version negotiation on server side against OpenSSL client |
| 7518 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7519 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7521 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7522 | 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] | 7523 | "$P_SRV" \ |
| 7524 | "$O_NEXT_CLI -tls1_2" \ |
| 7525 | 0 \ |
| 7526 | -S "mbedtls_ssl_handshake returned" \ |
| 7527 | -s "Protocol is TLSv1.2" |
| 7528 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7529 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7532 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7533 | 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] | 7534 | "$P_SRV max_version=tls12" \ |
| 7535 | "$O_NEXT_CLI -tls1_2" \ |
| 7536 | 0 \ |
| 7537 | -S "mbedtls_ssl_handshake returned" \ |
| 7538 | -s "Protocol is TLSv1.2" |
| 7539 | |
| 7540 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7541 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7543 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7544 | run_test "Server version nego O->m: cli 1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7545 | "$P_SRV" \ |
| 7546 | "$O_NEXT_CLI -tls1_3" \ |
| 7547 | 0 \ |
| 7548 | -S "mbedtls_ssl_handshake returned" \ |
| 7549 | -s "Protocol is TLSv1.3" |
| 7550 | |
| 7551 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7552 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7555 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7556 | 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] | 7557 | "$P_SRV min_version=tls13" \ |
| 7558 | "$O_NEXT_CLI -tls1_3" \ |
| 7559 | 0 \ |
| 7560 | -S "mbedtls_ssl_handshake returned" \ |
| 7561 | -s "Protocol is TLSv1.3" |
| 7562 | |
| 7563 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7566 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7567 | run_test "Server version nego O->m: cli 1.2+1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7568 | "$P_SRV" \ |
| 7569 | "$O_NEXT_CLI" \ |
| 7570 | 0 \ |
| 7571 | -S "mbedtls_ssl_handshake returned" \ |
| 7572 | -s "Protocol is TLSv1.3" |
| 7573 | |
| 7574 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7575 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7577 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7578 | 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] | 7579 | "$P_SRV" \ |
| 7580 | "$O_NEXT_CLI -no_middlebox" \ |
| 7581 | 0 \ |
| 7582 | -S "mbedtls_ssl_handshake returned" \ |
| 7583 | -s "Protocol is TLSv1.3" |
| 7584 | |
| 7585 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7586 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7589 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7590 | 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] | 7591 | "$P_SRV min_version=tls13" \ |
| 7592 | "$O_NEXT_CLI" \ |
| 7593 | 0 \ |
| 7594 | -S "mbedtls_ssl_handshake returned" \ |
| 7595 | -s "Protocol is TLSv1.3" |
| 7596 | |
| 7597 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7598 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7599 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7600 | 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] | 7601 | "$P_SRV" \ |
| 7602 | "$O_NEXT_CLI" \ |
| 7603 | 0 \ |
| 7604 | -S "mbedtls_ssl_handshake returned" \ |
| 7605 | -s "Protocol is TLSv1.2" |
| 7606 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7607 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7610 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7611 | 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] | 7612 | "$P_SRV max_version=tls12" \ |
| 7613 | "$O_NEXT_CLI" \ |
| 7614 | 0 \ |
| 7615 | -S "mbedtls_ssl_handshake returned" \ |
| 7616 | -s "Protocol is TLSv1.2" |
| 7617 | |
| 7618 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7619 | 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] | 7620 | "$P_SRV" \ |
| 7621 | "$O_CLI -tls1" \ |
| 7622 | 1 \ |
| 7623 | -s "Handshake protocol not within min/max boundaries" \ |
| 7624 | -S "Protocol is TLSv1.0" |
| 7625 | |
| 7626 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7627 | 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] | 7628 | "$P_SRV" \ |
| 7629 | "$O_CLI -tls1_1" \ |
| 7630 | 1 \ |
| 7631 | -s "Handshake protocol not within min/max boundaries" \ |
| 7632 | -S "Protocol is TLSv1.1" |
| 7633 | |
| 7634 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7635 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7636 | 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] | 7637 | "$P_SRV" \ |
| 7638 | "$O_NEXT_CLI -tls1_2" \ |
| 7639 | 1 \ |
| 7640 | -s "Handshake protocol not within min/max boundaries" \ |
| 7641 | -S "Protocol is TLSv1.2" |
| 7642 | |
| 7643 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7644 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7645 | 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] | 7646 | "$P_SRV" \ |
| 7647 | "$O_NEXT_CLI -tls1_3" \ |
| 7648 | 1 \ |
| 7649 | -S "Handshake protocol not within min/max boundaries" \ |
| 7650 | -s "The handshake negotiation failed" \ |
| 7651 | -S "Protocol is TLSv1.3" |
| 7652 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7653 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7656 | 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] | 7657 | "$P_SRV min_version=tls13" \ |
| 7658 | "$O_NEXT_CLI -tls1_2" \ |
| 7659 | 1 \ |
| 7660 | -s "Handshake protocol not within min/max boundaries" \ |
| 7661 | -S "Protocol is TLSv1.2" |
| 7662 | |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7666 | 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] | 7667 | "$P_SRV max_version=tls12" \ |
| 7668 | "$O_NEXT_CLI -tls1_3" \ |
| 7669 | 1 \ |
| 7670 | -S "Handshake protocol not within min/max boundaries" \ |
| 7671 | -s "The handshake negotiation failed" \ |
| 7672 | -S "Protocol is TLSv1.3" |
| 7673 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7674 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7677 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7678 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7679 | "$P_CLI" \ |
| 7680 | 1 \ |
| 7681 | -s "Error in protocol version" \ |
| 7682 | -c "Handshake protocol not within min/max boundaries" \ |
| 7683 | -S "Version: TLS1.0" \ |
| 7684 | -C "Protocol is TLSv1.0" |
| 7685 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7686 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7687 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7688 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7689 | "$P_CLI" \ |
| 7690 | 1 \ |
| 7691 | -s "Error in protocol version" \ |
| 7692 | -c "Handshake protocol not within min/max boundaries" \ |
| 7693 | -S "Version: TLS1.1" \ |
| 7694 | -C "Protocol is TLSv1.1" |
| 7695 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7697 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7698 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7699 | skip_handshake_stage_check |
| 7700 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7701 | 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] | 7702 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7703 | "$P_CLI debug_level=4" \ |
| 7704 | 1 \ |
| 7705 | -s "Client's version: 3.3" \ |
| 7706 | -S "Version: TLS1.0" \ |
| 7707 | -C "Protocol is TLSv1.0" |
| 7708 | |
| 7709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7710 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7711 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7712 | skip_handshake_stage_check |
| 7713 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7714 | 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] | 7715 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7716 | "$P_CLI debug_level=4" \ |
| 7717 | 1 \ |
| 7718 | -s "Client's version: 3.3" \ |
| 7719 | -S "Version: TLS1.1" \ |
| 7720 | -C "Protocol is TLSv1.1" |
| 7721 | |
| 7722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7723 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7724 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7725 | skip_handshake_stage_check |
| 7726 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7727 | 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] | 7728 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7729 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7730 | 1 \ |
| 7731 | -s "Client's version: 3.3" \ |
| 7732 | -c "is a fatal alert message (msg 40)" \ |
| 7733 | -S "Version: TLS1.2" \ |
| 7734 | -C "Protocol is TLSv1.2" |
| 7735 | |
| 7736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7737 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7738 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7739 | skip_handshake_stage_check |
| 7740 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7741 | 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] | 7742 | "$O_NEXT_SRV -msg -tls1" \ |
| 7743 | "$P_CLI debug_level=4" \ |
| 7744 | 1 \ |
| 7745 | -s "fatal protocol_version" \ |
| 7746 | -c "is a fatal alert message (msg 70)" \ |
| 7747 | -S "Version: TLS1.0" \ |
| 7748 | -C "Protocol : TLSv1.0" |
| 7749 | |
| 7750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7751 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7752 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7753 | skip_handshake_stage_check |
| 7754 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7755 | 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] | 7756 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7757 | "$P_CLI debug_level=4" \ |
| 7758 | 1 \ |
| 7759 | -s "fatal protocol_version" \ |
| 7760 | -c "is a fatal alert message (msg 70)" \ |
| 7761 | -S "Version: TLS1.1" \ |
| 7762 | -C "Protocol : TLSv1.1" |
| 7763 | |
| 7764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7765 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7766 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7767 | skip_handshake_stage_check |
| 7768 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7769 | 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] | 7770 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7771 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7772 | 1 \ |
| 7773 | -s "fatal protocol_version" \ |
| 7774 | -c "is a fatal alert message (msg 70)" \ |
| 7775 | -S "Version: TLS1.2" \ |
| 7776 | -C "Protocol : TLSv1.2" |
| 7777 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7778 | # Tests for ALPN extension |
| 7779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7780 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7781 | "$P_SRV debug_level=3" \ |
| 7782 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7783 | 0 \ |
| 7784 | -C "client hello, adding alpn extension" \ |
| 7785 | -S "found alpn extension" \ |
| 7786 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7787 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7788 | -C "found alpn extension " \ |
| 7789 | -C "Application Layer Protocol is" \ |
| 7790 | -S "Application Layer Protocol is" |
| 7791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7792 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7793 | "$P_SRV debug_level=3" \ |
| 7794 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7795 | 0 \ |
| 7796 | -c "client hello, adding alpn extension" \ |
| 7797 | -s "found alpn extension" \ |
| 7798 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7799 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7800 | -C "found alpn extension " \ |
| 7801 | -c "Application Layer Protocol is (none)" \ |
| 7802 | -S "Application Layer Protocol is" |
| 7803 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7804 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7805 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7806 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7807 | 0 \ |
| 7808 | -C "client hello, adding alpn extension" \ |
| 7809 | -S "found alpn extension" \ |
| 7810 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7811 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7812 | -C "found alpn extension " \ |
| 7813 | -C "Application Layer Protocol is" \ |
| 7814 | -s "Application Layer Protocol is (none)" |
| 7815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7816 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7817 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7818 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7819 | 0 \ |
| 7820 | -c "client hello, adding alpn extension" \ |
| 7821 | -s "found alpn extension" \ |
| 7822 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7823 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7824 | -c "found alpn extension" \ |
| 7825 | -c "Application Layer Protocol is abc" \ |
| 7826 | -s "Application Layer Protocol is abc" |
| 7827 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7828 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7829 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7830 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7831 | 0 \ |
| 7832 | -c "client hello, adding alpn extension" \ |
| 7833 | -s "found alpn extension" \ |
| 7834 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7835 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7836 | -c "found alpn extension" \ |
| 7837 | -c "Application Layer Protocol is abc" \ |
| 7838 | -s "Application Layer Protocol is abc" |
| 7839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7840 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7841 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7842 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7843 | 0 \ |
| 7844 | -c "client hello, adding alpn extension" \ |
| 7845 | -s "found alpn extension" \ |
| 7846 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7847 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7848 | -c "found alpn extension" \ |
| 7849 | -c "Application Layer Protocol is 1234" \ |
| 7850 | -s "Application Layer Protocol is 1234" |
| 7851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7852 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7853 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7854 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7855 | 1 \ |
| 7856 | -c "client hello, adding alpn extension" \ |
| 7857 | -s "found alpn extension" \ |
| 7858 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7859 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7860 | -C "found alpn extension" \ |
| 7861 | -C "Application Layer Protocol is 1234" \ |
| 7862 | -S "Application Layer Protocol is 1234" |
| 7863 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7864 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7865 | # Tests for keyUsage in leaf certificates, part 1: |
| 7866 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7867 | # |
| 7868 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7869 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7870 | # 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] | 7871 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7872 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7873 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7874 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7875 | "$P_CLI" \ |
| 7876 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7877 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7878 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7879 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7880 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7881 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7882 | "$P_CLI" \ |
| 7883 | 0 \ |
| 7884 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7885 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7886 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7887 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7888 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7889 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7890 | 1 \ |
| 7891 | -C "Ciphersuite is " |
| 7892 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7893 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7894 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7895 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7896 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7897 | "$P_CLI" \ |
| 7898 | 0 \ |
| 7899 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7900 | |
| 7901 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7902 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7903 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7904 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7905 | "$P_CLI" \ |
| 7906 | 0 \ |
| 7907 | -c "Ciphersuite is TLS-ECDH-" |
| 7908 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7909 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7910 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7911 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7912 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7913 | 1 \ |
| 7914 | -C "Ciphersuite is " |
| 7915 | |
| 7916 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7917 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7918 | # |
| 7919 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7920 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7921 | # 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] | 7922 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7923 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7924 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7925 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7926 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7927 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7928 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7929 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7930 | -C "Processing of the Certificate handshake message failed" \ |
| 7931 | -c "Ciphersuite is TLS-" |
| 7932 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7933 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7934 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7935 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7936 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7937 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7938 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7939 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7940 | -C "Processing of the Certificate handshake message failed" \ |
| 7941 | -c "Ciphersuite is TLS-" |
| 7942 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7943 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7944 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7945 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7946 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7947 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7948 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7949 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7950 | -C "Processing of the Certificate handshake message failed" \ |
| 7951 | -c "Ciphersuite is TLS-" |
| 7952 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7953 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7954 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7955 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7956 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7957 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7958 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7959 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7960 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7961 | -C "Ciphersuite is TLS-" \ |
| 7962 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7963 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7964 | # 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] | 7965 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7966 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7967 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7968 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7969 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7970 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7971 | 0 \ |
| 7972 | -c "bad certificate (usage extensions)" \ |
| 7973 | -C "Processing of the Certificate handshake message failed" \ |
| 7974 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7975 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7976 | -c "! Usage does not match the keyUsage extension" |
| 7977 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7978 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7979 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7980 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7981 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7982 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7983 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7984 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7985 | -C "Processing of the Certificate handshake message failed" \ |
| 7986 | -c "Ciphersuite is TLS-" |
| 7987 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7988 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7989 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7990 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7991 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7992 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7993 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7994 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7995 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7996 | -C "Ciphersuite is TLS-" \ |
| 7997 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7998 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7999 | # 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] | 8000 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8001 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8002 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8003 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8004 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8005 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8006 | 0 \ |
| 8007 | -c "bad certificate (usage extensions)" \ |
| 8008 | -C "Processing of the Certificate handshake message failed" \ |
| 8009 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 8010 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 8011 | -c "! Usage does not match the keyUsage extension" |
| 8012 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8013 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8014 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8015 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 8016 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8017 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 8018 | "$P_CLI debug_level=3" \ |
| 8019 | 0 \ |
| 8020 | -C "bad certificate (usage extensions)" \ |
| 8021 | -C "Processing of the Certificate handshake message failed" \ |
| 8022 | -c "Ciphersuite is" |
| 8023 | |
| 8024 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8025 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8026 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8027 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8028 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8029 | "$P_CLI debug_level=3" \ |
| 8030 | 0 \ |
| 8031 | -C "bad certificate (usage extensions)" \ |
| 8032 | -C "Processing of the Certificate handshake message failed" \ |
| 8033 | -c "Ciphersuite is" |
| 8034 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8035 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8036 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8037 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8038 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8039 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8040 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8041 | 1 \ |
| 8042 | -c "bad certificate (usage extensions)" \ |
| 8043 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8044 | -C "Ciphersuite is" \ |
| 8045 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8046 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8047 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8048 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8049 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8050 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8051 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8052 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 8053 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8054 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8055 | 1 \ |
| 8056 | -c "bad certificate (usage extensions)" \ |
| 8057 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8058 | -C "Ciphersuite is" \ |
| 8059 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8060 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8061 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8062 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8063 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8064 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8065 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8066 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8067 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8068 | "$P_CLI debug_level=3" \ |
| 8069 | 0 \ |
| 8070 | -C "bad certificate (usage extensions)" \ |
| 8071 | -C "Processing of the Certificate handshake message failed" \ |
| 8072 | -c "Ciphersuite is" |
| 8073 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8074 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8075 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8076 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8077 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8078 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8079 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8080 | 1 \ |
| 8081 | -c "bad certificate (usage extensions)" \ |
| 8082 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8083 | -C "Ciphersuite is" \ |
| 8084 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8085 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8086 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8087 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8088 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8089 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8090 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8091 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8092 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8093 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8094 | 1 \ |
| 8095 | -c "bad certificate (usage extensions)" \ |
| 8096 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8097 | -C "Ciphersuite is" \ |
| 8098 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8099 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8100 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8101 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8102 | # Tests for keyUsage in leaf certificates, part 3: |
| 8103 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8104 | # |
| 8105 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8106 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8108 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8109 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8110 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8111 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8112 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8113 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8114 | -S "bad certificate (usage extensions)" \ |
| 8115 | -S "Processing of the Certificate handshake message failed" |
| 8116 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8118 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
| 8119 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 8120 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8121 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 8122 | 0 \ |
| 8123 | -s "Verifying peer X.509 certificate... ok" \ |
| 8124 | -S "bad certificate (usage extensions)" \ |
| 8125 | -S "Processing of the Certificate handshake message failed" |
| 8126 | |
| 8127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8128 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 8129 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8130 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8131 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8132 | 0 \ |
| 8133 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8134 | -S "send alert level=2 message=43" \ |
| 8135 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8136 | -S "Processing of the Certificate handshake message failed" |
| 8137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8139 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 8140 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8141 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 8142 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8143 | 1 \ |
| 8144 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8145 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8146 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8147 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8148 | # 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] | 8149 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8151 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8152 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8153 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8154 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8155 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8156 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8157 | -S "bad certificate (usage extensions)" \ |
| 8158 | -S "Processing of the Certificate handshake message failed" |
| 8159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8161 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 8162 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8163 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8164 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8165 | 0 \ |
| 8166 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8167 | -S "send alert level=2 message=43" \ |
| 8168 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 8169 | -S "Processing of the Certificate handshake message failed" |
| 8170 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8172 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 8173 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 8174 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8175 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8176 | 1 \ |
| 8177 | -s "bad certificate (usage extensions)" \ |
| 8178 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8179 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8180 | -s "Processing of the Certificate handshake message failed" |
| 8181 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8182 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8183 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8184 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8185 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8186 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8187 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 8188 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8189 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8190 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8191 | -S "bad certificate (usage extensions)" \ |
| 8192 | -S "Processing of the Certificate handshake message failed" |
| 8193 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8194 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8195 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 8196 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8197 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8198 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8199 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 8200 | 0 \ |
| 8201 | -s "Verifying peer X.509 certificate... ok" \ |
| 8202 | -S "bad certificate (usage extensions)" \ |
| 8203 | -S "Processing of the Certificate handshake message failed" |
| 8204 | |
| 8205 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8206 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8207 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8208 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8209 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8210 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8211 | 0 \ |
| 8212 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8213 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8214 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8215 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8216 | |
| 8217 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8218 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8219 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8220 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8221 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8222 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8223 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8224 | -s "bad certificate (usage extensions)" \ |
| 8225 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8226 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8227 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8228 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8229 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8230 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8231 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8232 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8233 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8234 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8235 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8236 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8237 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8238 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8239 | -S "bad certificate (usage extensions)" \ |
| 8240 | -S "Processing of the Certificate handshake message failed" |
| 8241 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8242 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8243 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8244 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8245 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8246 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8247 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8248 | 0 \ |
| 8249 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8250 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8251 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8252 | |
| 8253 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8254 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8255 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8256 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8257 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8258 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8259 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8260 | -s "bad certificate (usage extensions)" \ |
| 8261 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8262 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8263 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8264 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8265 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8266 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8267 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8268 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8269 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8270 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8271 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8272 | "$P_CLI" \ |
| 8273 | 0 |
| 8274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8275 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8276 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8277 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8278 | "$P_CLI" \ |
| 8279 | 0 |
| 8280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8281 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8282 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8283 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8284 | "$P_CLI" \ |
| 8285 | 0 |
| 8286 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8287 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8288 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8289 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8290 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8291 | 1 |
| 8292 | |
| 8293 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8294 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8296 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8297 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8298 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8299 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8300 | 0 \ |
| 8301 | -C "bad certificate (usage extensions)" \ |
| 8302 | -C "Processing of the Certificate handshake message failed" \ |
| 8303 | -c "Ciphersuite is TLS-" |
| 8304 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8306 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8307 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8308 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8309 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8310 | 0 \ |
| 8311 | -C "bad certificate (usage extensions)" \ |
| 8312 | -C "Processing of the Certificate handshake message failed" \ |
| 8313 | -c "Ciphersuite is TLS-" |
| 8314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8316 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8317 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8318 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8319 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8320 | 0 \ |
| 8321 | -C "bad certificate (usage extensions)" \ |
| 8322 | -C "Processing of the Certificate handshake message failed" \ |
| 8323 | -c "Ciphersuite is TLS-" |
| 8324 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8326 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
| 8327 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8328 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8329 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8330 | 0 \ |
| 8331 | -c "bad certificate (usage extensions)" \ |
| 8332 | -C "Processing of the Certificate handshake message failed" \ |
| 8333 | -c "Ciphersuite is TLS-" \ |
| 8334 | -C "send alert level=2 message=43" \ |
| 8335 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8336 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8337 | |
| 8338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8339 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8340 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8341 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8342 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8343 | 1 \ |
| 8344 | -c "bad certificate (usage extensions)" \ |
| 8345 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8346 | -C "Ciphersuite is TLS-" \ |
| 8347 | -c "send alert level=2 message=43" \ |
| 8348 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8349 | # 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] | 8350 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8351 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8352 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8353 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8354 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8355 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8356 | "$P_CLI debug_level=1" \ |
| 8357 | 0 \ |
| 8358 | -C "bad certificate (usage extensions)" \ |
| 8359 | -C "Processing of the Certificate handshake message failed" \ |
| 8360 | -c "Ciphersuite is" |
| 8361 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8362 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8363 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8364 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8365 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8366 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8367 | "$P_CLI debug_level=1" \ |
| 8368 | 0 \ |
| 8369 | -C "bad certificate (usage extensions)" \ |
| 8370 | -C "Processing of the Certificate handshake message failed" \ |
| 8371 | -c "Ciphersuite is" |
| 8372 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8373 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8374 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8375 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8376 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8377 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8378 | "$P_CLI debug_level=1" \ |
| 8379 | 0 \ |
| 8380 | -C "bad certificate (usage extensions)" \ |
| 8381 | -C "Processing of the Certificate handshake message failed" \ |
| 8382 | -c "Ciphersuite is" |
| 8383 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8384 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8385 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8386 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8387 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8388 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8389 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8390 | 1 \ |
| 8391 | -c "bad certificate (usage extensions)" \ |
| 8392 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8393 | -C "Ciphersuite is" \ |
| 8394 | -c "send alert level=2 message=43" \ |
| 8395 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8396 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8397 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8398 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8401 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8402 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8403 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8404 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8405 | 0 \ |
| 8406 | -S "bad certificate (usage extensions)" \ |
| 8407 | -S "Processing of the Certificate handshake message failed" |
| 8408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8410 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8411 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8412 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8413 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8414 | 0 \ |
| 8415 | -S "bad certificate (usage extensions)" \ |
| 8416 | -S "Processing of the Certificate handshake message failed" |
| 8417 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8419 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8420 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8421 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8422 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8423 | 0 \ |
| 8424 | -S "bad certificate (usage extensions)" \ |
| 8425 | -S "Processing of the Certificate handshake message failed" |
| 8426 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8428 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8429 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8430 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8431 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8432 | 0 \ |
| 8433 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8434 | -S "send alert level=2 message=43" \ |
| 8435 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8436 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8439 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8440 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8441 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8442 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8443 | 1 \ |
| 8444 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8445 | -s "send alert level=2 message=43" \ |
| 8446 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8447 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8448 | # 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] | 8449 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8450 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8451 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8452 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8453 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8454 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8455 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8456 | 0 \ |
| 8457 | -S "bad certificate (usage extensions)" \ |
| 8458 | -S "Processing of the Certificate handshake message failed" |
| 8459 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8460 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8461 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8462 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8463 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8464 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8465 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8466 | 0 \ |
| 8467 | -S "bad certificate (usage extensions)" \ |
| 8468 | -S "Processing of the Certificate handshake message failed" |
| 8469 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8470 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8471 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8472 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8473 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8474 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8475 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8476 | 0 \ |
| 8477 | -S "bad certificate (usage extensions)" \ |
| 8478 | -S "Processing of the Certificate handshake message failed" |
| 8479 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8480 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8481 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8482 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8483 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8484 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8485 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8486 | 0 \ |
| 8487 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8488 | -S "send alert level=2 message=43" \ |
| 8489 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8490 | -S "Processing of the Certificate handshake message failed" |
| 8491 | |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8492 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 8493 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8494 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8495 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8496 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8497 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8498 | 1 \ |
| 8499 | -s "bad certificate (usage extensions)" \ |
| 8500 | -s "send alert level=2 message=43" \ |
| 8501 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8502 | -s "Processing of the Certificate handshake message failed" |
| 8503 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8504 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8505 | # Tests for DHM parameters loading |
| 8506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8507 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8508 | "$P_SRV" \ |
| 8509 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8510 | debug_level=3" \ |
| 8511 | 0 \ |
| 8512 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8513 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8514 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8515 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8516 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8517 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8518 | debug_level=3" \ |
| 8519 | 0 \ |
| 8520 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8521 | -c "value of 'DHM: G ' (2 bits)" |
| 8522 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8523 | # Tests for DHM client-side size checking |
| 8524 | |
| 8525 | run_test "DHM size: server default, client default, OK" \ |
| 8526 | "$P_SRV" \ |
| 8527 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8528 | debug_level=1" \ |
| 8529 | 0 \ |
| 8530 | -C "DHM prime too short:" |
| 8531 | |
| 8532 | run_test "DHM size: server default, client 2048, OK" \ |
| 8533 | "$P_SRV" \ |
| 8534 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8535 | debug_level=1 dhmlen=2048" \ |
| 8536 | 0 \ |
| 8537 | -C "DHM prime too short:" |
| 8538 | |
| 8539 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8540 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8541 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8542 | debug_level=1" \ |
| 8543 | 0 \ |
| 8544 | -C "DHM prime too short:" |
| 8545 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8546 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8547 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8548 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8549 | debug_level=1 dhmlen=999" \ |
| 8550 | 0 \ |
| 8551 | -C "DHM prime too short:" |
| 8552 | |
| 8553 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8554 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8555 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8556 | debug_level=1 dhmlen=1000" \ |
| 8557 | 0 \ |
| 8558 | -C "DHM prime too short:" |
| 8559 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8560 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8561 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8562 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8563 | debug_level=1" \ |
| 8564 | 1 \ |
| 8565 | -c "DHM prime too short:" |
| 8566 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8567 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8568 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8569 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8570 | debug_level=1 dhmlen=1001" \ |
| 8571 | 1 \ |
| 8572 | -c "DHM prime too short:" |
| 8573 | |
| 8574 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8575 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8576 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8577 | debug_level=1 dhmlen=1000" \ |
| 8578 | 1 \ |
| 8579 | -c "DHM prime too short:" |
| 8580 | |
| 8581 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8582 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8583 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8584 | debug_level=1 dhmlen=999" \ |
| 8585 | 1 \ |
| 8586 | -c "DHM prime too short:" |
| 8587 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8588 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8589 | "$P_SRV" \ |
| 8590 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8591 | debug_level=1 dhmlen=2049" \ |
| 8592 | 1 \ |
| 8593 | -c "DHM prime too short:" |
| 8594 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8595 | # Tests for PSK callback |
| 8596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8597 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8598 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8599 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8600 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8601 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8602 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8603 | -S "SSL - Unknown identity received" \ |
| 8604 | -S "SSL - Verification of the message MAC failed" |
| 8605 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8606 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8607 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8608 | "$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] | 8609 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8610 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8611 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8612 | -C "session hash for extended master secret"\ |
| 8613 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8614 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8615 | -S "SSL - Unknown identity received" \ |
| 8616 | -S "SSL - Verification of the message MAC failed" |
| 8617 | |
| 8618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8619 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8620 | "$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] | 8621 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8622 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8623 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8624 | -C "session hash for extended master secret"\ |
| 8625 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8626 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8627 | -S "SSL - Unknown identity received" \ |
| 8628 | -S "SSL - Verification of the message MAC failed" |
| 8629 | |
| 8630 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8631 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8632 | "$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] | 8633 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8634 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8635 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8636 | -c "session hash for extended master secret"\ |
| 8637 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8638 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8639 | -S "SSL - Unknown identity received" \ |
| 8640 | -S "SSL - Verification of the message MAC failed" |
| 8641 | |
| 8642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8643 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8644 | "$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] | 8645 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8646 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8647 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8648 | -c "session hash for extended master secret"\ |
| 8649 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8650 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8651 | -S "SSL - Unknown identity received" \ |
| 8652 | -S "SSL - Verification of the message MAC failed" |
| 8653 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8654 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8655 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8656 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8657 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8658 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8659 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8660 | -C "session hash for extended master secret"\ |
| 8661 | -S "session hash for extended master secret"\ |
| 8662 | -S "SSL - The handshake negotiation failed" \ |
| 8663 | -S "SSL - Unknown identity received" \ |
| 8664 | -S "SSL - Verification of the message MAC failed" |
| 8665 | |
| 8666 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8667 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8668 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8669 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8670 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8671 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8672 | -C "session hash for extended master secret"\ |
| 8673 | -S "session hash for extended master secret"\ |
| 8674 | -S "SSL - The handshake negotiation failed" \ |
| 8675 | -S "SSL - Unknown identity received" \ |
| 8676 | -S "SSL - Verification of the message MAC failed" |
| 8677 | |
| 8678 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8679 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8680 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8681 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8682 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8683 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8684 | -c "session hash for extended master secret"\ |
| 8685 | -s "session hash for extended master secret"\ |
| 8686 | -S "SSL - The handshake negotiation failed" \ |
| 8687 | -S "SSL - Unknown identity received" \ |
| 8688 | -S "SSL - Verification of the message MAC failed" |
| 8689 | |
| 8690 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8691 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8692 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8693 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8694 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8695 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8696 | -c "session hash for extended master secret"\ |
| 8697 | -s "session hash for extended master secret"\ |
| 8698 | -S "SSL - The handshake negotiation failed" \ |
| 8699 | -S "SSL - Unknown identity received" \ |
| 8700 | -S "SSL - Verification of the message MAC failed" |
| 8701 | |
| 8702 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8703 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8704 | "$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] | 8705 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8706 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8707 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8708 | -C "session hash for extended master secret"\ |
| 8709 | -S "session hash for extended master secret"\ |
| 8710 | -S "SSL - The handshake negotiation failed" \ |
| 8711 | -S "SSL - Unknown identity received" \ |
| 8712 | -S "SSL - Verification of the message MAC failed" |
| 8713 | |
| 8714 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8715 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8716 | "$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] | 8717 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8718 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8719 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8720 | -C "session hash for extended master secret"\ |
| 8721 | -S "session hash for extended master secret"\ |
| 8722 | -S "SSL - The handshake negotiation failed" \ |
| 8723 | -S "SSL - Unknown identity received" \ |
| 8724 | -S "SSL - Verification of the message MAC failed" |
| 8725 | |
| 8726 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8727 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8728 | "$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] | 8729 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8730 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8731 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8732 | -c "session hash for extended master secret"\ |
| 8733 | -s "session hash for extended master secret"\ |
| 8734 | -S "SSL - The handshake negotiation failed" \ |
| 8735 | -S "SSL - Unknown identity received" \ |
| 8736 | -S "SSL - Verification of the message MAC failed" |
| 8737 | |
| 8738 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8739 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8740 | "$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] | 8741 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8742 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8743 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8744 | -c "session hash for extended master secret"\ |
| 8745 | -s "session hash for extended master secret"\ |
| 8746 | -S "SSL - The handshake negotiation failed" \ |
| 8747 | -S "SSL - Unknown identity received" \ |
| 8748 | -S "SSL - Verification of the message MAC failed" |
| 8749 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8751 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8752 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8753 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8754 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8755 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8756 | -C "session hash for extended master secret"\ |
| 8757 | -S "session hash for extended master secret"\ |
| 8758 | -S "SSL - The handshake negotiation failed" \ |
| 8759 | -S "SSL - Unknown identity received" \ |
| 8760 | -S "SSL - Verification of the message MAC failed" |
| 8761 | |
| 8762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8763 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8764 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8765 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8766 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8767 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8768 | -C "session hash for extended master secret"\ |
| 8769 | -S "session hash for extended master secret"\ |
| 8770 | -S "SSL - The handshake negotiation failed" \ |
| 8771 | -S "SSL - Unknown identity received" \ |
| 8772 | -S "SSL - Verification of the message MAC failed" |
| 8773 | |
| 8774 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8775 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8776 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8777 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8778 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8779 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8780 | -c "session hash for extended master secret"\ |
| 8781 | -s "session hash for extended master secret"\ |
| 8782 | -S "SSL - The handshake negotiation failed" \ |
| 8783 | -S "SSL - Unknown identity received" \ |
| 8784 | -S "SSL - Verification of the message MAC failed" |
| 8785 | |
| 8786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8787 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8788 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8789 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8790 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8791 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8792 | -c "session hash for extended master secret"\ |
| 8793 | -s "session hash for extended master secret"\ |
| 8794 | -S "SSL - The handshake negotiation failed" \ |
| 8795 | -S "SSL - Unknown identity received" \ |
| 8796 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8797 | |
| 8798 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8799 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8800 | "$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] | 8801 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8802 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8803 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8804 | -C "session hash for extended master secret"\ |
| 8805 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8806 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8807 | -S "SSL - Unknown identity received" \ |
| 8808 | -S "SSL - Verification of the message MAC failed" |
| 8809 | |
| 8810 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8811 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8812 | "$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] | 8813 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8814 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8815 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8816 | -C "session hash for extended master secret"\ |
| 8817 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8818 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8819 | -S "SSL - Unknown identity received" \ |
| 8820 | -S "SSL - Verification of the message MAC failed" |
| 8821 | |
| 8822 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8823 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8824 | "$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] | 8825 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8826 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8827 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8828 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8829 | -c "session hash for extended master secret"\ |
| 8830 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8831 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8832 | -S "SSL - Unknown identity received" \ |
| 8833 | -S "SSL - Verification of the message MAC failed" |
| 8834 | |
| 8835 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8836 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8837 | "$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] | 8838 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8839 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8840 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8841 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8842 | -c "session hash for extended master secret"\ |
| 8843 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8844 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8845 | -S "SSL - Unknown identity received" \ |
| 8846 | -S "SSL - Verification of the message MAC failed" |
| 8847 | |
| 8848 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8849 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8850 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8851 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8852 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8853 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8854 | -C "session hash for extended master secret"\ |
| 8855 | -S "session hash for extended master secret"\ |
| 8856 | -S "SSL - The handshake negotiation failed" \ |
| 8857 | -S "SSL - Unknown identity received" \ |
| 8858 | -S "SSL - Verification of the message MAC failed" |
| 8859 | |
| 8860 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8861 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8862 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8863 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8864 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8865 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8866 | -C "session hash for extended master secret"\ |
| 8867 | -S "session hash for extended master secret"\ |
| 8868 | -S "SSL - The handshake negotiation failed" \ |
| 8869 | -S "SSL - Unknown identity received" \ |
| 8870 | -S "SSL - Verification of the message MAC failed" |
| 8871 | |
| 8872 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8873 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8874 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8875 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8876 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8877 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8878 | 0 \ |
| 8879 | -c "session hash for extended master secret"\ |
| 8880 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8881 | -S "SSL - The handshake negotiation failed" \ |
| 8882 | -S "SSL - Unknown identity received" \ |
| 8883 | -S "SSL - Verification of the message MAC failed" |
| 8884 | |
| 8885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8886 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8887 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8888 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8889 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8890 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8891 | 0 \ |
| 8892 | -c "session hash for extended master secret"\ |
| 8893 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8894 | -S "SSL - The handshake negotiation failed" \ |
| 8895 | -S "SSL - Unknown identity received" \ |
| 8896 | -S "SSL - Verification of the message MAC failed" |
| 8897 | |
| 8898 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8899 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8900 | "$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] | 8901 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8902 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8903 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8904 | -C "session hash for extended master secret"\ |
| 8905 | -S "session hash for extended master secret"\ |
| 8906 | -S "SSL - The handshake negotiation failed" \ |
| 8907 | -S "SSL - Unknown identity received" \ |
| 8908 | -S "SSL - Verification of the message MAC failed" |
| 8909 | |
| 8910 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8911 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8912 | "$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] | 8913 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8914 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8915 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8916 | -C "session hash for extended master secret"\ |
| 8917 | -S "session hash for extended master secret"\ |
| 8918 | -S "SSL - The handshake negotiation failed" \ |
| 8919 | -S "SSL - Unknown identity received" \ |
| 8920 | -S "SSL - Verification of the message MAC failed" |
| 8921 | |
| 8922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8923 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8924 | "$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] | 8925 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8926 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8927 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8928 | 0 \ |
| 8929 | -c "session hash for extended master secret"\ |
| 8930 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8931 | -S "SSL - The handshake negotiation failed" \ |
| 8932 | -S "SSL - Unknown identity received" \ |
| 8933 | -S "SSL - Verification of the message MAC failed" |
| 8934 | |
| 8935 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8936 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8937 | "$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] | 8938 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8939 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8940 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8941 | 0 \ |
| 8942 | -c "session hash for extended master secret"\ |
| 8943 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8944 | -S "SSL - The handshake negotiation failed" \ |
| 8945 | -S "SSL - Unknown identity received" \ |
| 8946 | -S "SSL - Verification of the message MAC failed" |
| 8947 | |
| 8948 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8949 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8950 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8951 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8952 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8953 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8954 | -C "session hash for extended master secret"\ |
| 8955 | -S "session hash for extended master secret"\ |
| 8956 | -S "SSL - The handshake negotiation failed" \ |
| 8957 | -S "SSL - Unknown identity received" \ |
| 8958 | -S "SSL - Verification of the message MAC failed" |
| 8959 | |
| 8960 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8961 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8962 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8963 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8964 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8965 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8966 | -C "session hash for extended master secret"\ |
| 8967 | -S "session hash for extended master secret"\ |
| 8968 | -S "SSL - The handshake negotiation failed" \ |
| 8969 | -S "SSL - Unknown identity received" \ |
| 8970 | -S "SSL - Verification of the message MAC failed" |
| 8971 | |
| 8972 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8973 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8974 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8975 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8976 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8977 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8978 | 0 \ |
| 8979 | -c "session hash for extended master secret"\ |
| 8980 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8981 | -S "SSL - The handshake negotiation failed" \ |
| 8982 | -S "SSL - Unknown identity received" \ |
| 8983 | -S "SSL - Verification of the message MAC failed" |
| 8984 | |
| 8985 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8986 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8987 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8988 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8989 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8990 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8991 | 0 \ |
| 8992 | -c "session hash for extended master secret"\ |
| 8993 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8994 | -S "SSL - The handshake negotiation failed" \ |
| 8995 | -S "SSL - Unknown identity received" \ |
| 8996 | -S "SSL - Verification of the message MAC failed" |
| 8997 | |
| 8998 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8999 | 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] | 9000 | "$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" \ |
| 9001 | "$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] | 9002 | psk_identity=def psk=beef" \ |
| 9003 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9004 | -C "session hash for extended master secret"\ |
| 9005 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9006 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9007 | -S "SSL - Unknown identity received" \ |
| 9008 | -S "SSL - Verification of the message MAC failed" |
| 9009 | |
| 9010 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9011 | 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] | 9012 | "$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" \ |
| 9013 | "$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] | 9014 | psk_identity=def psk=beef" \ |
| 9015 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9016 | -C "session hash for extended master secret"\ |
| 9017 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9018 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9019 | -S "SSL - Unknown identity received" \ |
| 9020 | -S "SSL - Verification of the message MAC failed" |
| 9021 | |
| 9022 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9023 | 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] | 9024 | "$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] | 9025 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9026 | "$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] | 9027 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9028 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9029 | -c "session hash for extended master secret"\ |
| 9030 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9031 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9032 | -S "SSL - Unknown identity received" \ |
| 9033 | -S "SSL - Verification of the message MAC failed" |
| 9034 | |
| 9035 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9036 | 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] | 9037 | "$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] | 9038 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9039 | "$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] | 9040 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9041 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9042 | -c "session hash for extended master secret"\ |
| 9043 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9044 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9045 | -S "SSL - Unknown identity received" \ |
| 9046 | -S "SSL - Verification of the message MAC failed" |
| 9047 | |
| 9048 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9049 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 9050 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 9051 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9052 | psk_identity=def psk=beef" \ |
| 9053 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9054 | -C "session hash for extended master secret"\ |
| 9055 | -S "session hash for extended master secret"\ |
| 9056 | -S "SSL - The handshake negotiation failed" \ |
| 9057 | -S "SSL - Unknown identity received" \ |
| 9058 | -S "SSL - Verification of the message MAC failed" |
| 9059 | |
| 9060 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9061 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 9062 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 9063 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9064 | psk_identity=def psk=beef" \ |
| 9065 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9066 | -C "session hash for extended master secret"\ |
| 9067 | -S "session hash for extended master secret"\ |
| 9068 | -S "SSL - The handshake negotiation failed" \ |
| 9069 | -S "SSL - Unknown identity received" \ |
| 9070 | -S "SSL - Verification of the message MAC failed" |
| 9071 | |
| 9072 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9073 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 9074 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9075 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9076 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 9077 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9078 | 0 \ |
| 9079 | -c "session hash for extended master secret"\ |
| 9080 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9081 | -S "SSL - The handshake negotiation failed" \ |
| 9082 | -S "SSL - Unknown identity received" \ |
| 9083 | -S "SSL - Verification of the message MAC failed" |
| 9084 | |
| 9085 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9086 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 9087 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9088 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9089 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9090 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9091 | 0 \ |
| 9092 | -c "session hash for extended master secret"\ |
| 9093 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 9094 | -S "SSL - The handshake negotiation failed" \ |
| 9095 | -S "SSL - Unknown identity received" \ |
| 9096 | -S "SSL - Verification of the message MAC failed" |
| 9097 | |
| 9098 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9099 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 9100 | "$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" \ |
| 9101 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9102 | psk_identity=def psk=beef" \ |
| 9103 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9104 | -C "session hash for extended master secret"\ |
| 9105 | -S "session hash for extended master secret"\ |
| 9106 | -S "SSL - The handshake negotiation failed" \ |
| 9107 | -S "SSL - Unknown identity received" \ |
| 9108 | -S "SSL - Verification of the message MAC failed" |
| 9109 | |
| 9110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9111 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 9112 | "$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" \ |
| 9113 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9114 | psk_identity=def psk=beef" \ |
| 9115 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9116 | -C "session hash for extended master secret"\ |
| 9117 | -S "session hash for extended master secret"\ |
| 9118 | -S "SSL - The handshake negotiation failed" \ |
| 9119 | -S "SSL - Unknown identity received" \ |
| 9120 | -S "SSL - Verification of the message MAC failed" |
| 9121 | |
| 9122 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9123 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 9124 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9125 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9126 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9127 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9128 | 0 \ |
| 9129 | -c "session hash for extended master secret"\ |
| 9130 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9131 | -S "SSL - The handshake negotiation failed" \ |
| 9132 | -S "SSL - Unknown identity received" \ |
| 9133 | -S "SSL - Verification of the message MAC failed" |
| 9134 | |
| 9135 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9136 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 9137 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9138 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9139 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9140 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9141 | 0 \ |
| 9142 | -c "session hash for extended master secret"\ |
| 9143 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 9144 | -S "SSL - The handshake negotiation failed" \ |
| 9145 | -S "SSL - Unknown identity received" \ |
| 9146 | -S "SSL - Verification of the message MAC failed" |
| 9147 | |
| 9148 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9149 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 9150 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 9151 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9152 | psk_identity=def psk=beef" \ |
| 9153 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9154 | -C "session hash for extended master secret"\ |
| 9155 | -S "session hash for extended master secret"\ |
| 9156 | -S "SSL - The handshake negotiation failed" \ |
| 9157 | -S "SSL - Unknown identity received" \ |
| 9158 | -S "SSL - Verification of the message MAC failed" |
| 9159 | |
| 9160 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9161 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 9162 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 9163 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9164 | psk_identity=def psk=beef" \ |
| 9165 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9166 | -C "session hash for extended master secret"\ |
| 9167 | -S "session hash for extended master secret"\ |
| 9168 | -S "SSL - The handshake negotiation failed" \ |
| 9169 | -S "SSL - Unknown identity received" \ |
| 9170 | -S "SSL - Verification of the message MAC failed" |
| 9171 | |
| 9172 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9173 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 9174 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9175 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 9176 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 9177 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9178 | 0 \ |
| 9179 | -c "session hash for extended master secret"\ |
| 9180 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9181 | -S "SSL - The handshake negotiation failed" \ |
| 9182 | -S "SSL - Unknown identity received" \ |
| 9183 | -S "SSL - Verification of the message MAC failed" |
| 9184 | |
| 9185 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9186 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9187 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9188 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9189 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9190 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9191 | 0 \ |
| 9192 | -c "session hash for extended master secret"\ |
| 9193 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9194 | -S "SSL - The handshake negotiation failed" \ |
| 9195 | -S "SSL - Unknown identity received" \ |
| 9196 | -S "SSL - Verification of the message MAC failed" |
| 9197 | |
| 9198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9199 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9200 | "$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] | 9201 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9202 | psk_identity=def psk=beef" \ |
| 9203 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9204 | -C "session hash for extended master secret"\ |
| 9205 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9206 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9207 | -S "SSL - Unknown identity received" \ |
| 9208 | -S "SSL - Verification of the message MAC failed" |
| 9209 | |
| 9210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9211 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9212 | "$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] | 9213 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9214 | psk_identity=def psk=beef" \ |
| 9215 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9216 | -C "session hash for extended master secret"\ |
| 9217 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9218 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9219 | -S "SSL - Unknown identity received" \ |
| 9220 | -S "SSL - Verification of the message MAC failed" |
| 9221 | |
| 9222 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9223 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9224 | "$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] | 9225 | "$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] | 9226 | psk_identity=def psk=beef" \ |
| 9227 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9228 | -C "session hash for extended master secret"\ |
| 9229 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9230 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9231 | -S "SSL - Unknown identity received" \ |
| 9232 | -S "SSL - Verification of the message MAC failed" |
| 9233 | |
| 9234 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9235 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9236 | "$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] | 9237 | "$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] | 9238 | psk_identity=def psk=beef" \ |
| 9239 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9240 | -C "session hash for extended master secret"\ |
| 9241 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9242 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9243 | -S "SSL - Unknown identity received" \ |
| 9244 | -S "SSL - Verification of the message MAC failed" |
| 9245 | |
| 9246 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9247 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9248 | "$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] | 9249 | "$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] | 9250 | psk_identity=def psk=beef" \ |
| 9251 | 1 \ |
| 9252 | -s "SSL - Verification of the message MAC failed" |
| 9253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9254 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9255 | "$P_SRV" \ |
| 9256 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9257 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9258 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9259 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9260 | -S "SSL - Unknown identity received" \ |
| 9261 | -S "SSL - Verification of the message MAC failed" |
| 9262 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9263 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9264 | "$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] | 9265 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9266 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9267 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9268 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9269 | -s "SSL - Unknown identity received" \ |
| 9270 | -S "SSL - Verification of the message MAC failed" |
| 9271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9272 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9273 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9274 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9275 | psk_identity=abc psk=dead" \ |
| 9276 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9277 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9278 | -S "SSL - Unknown identity received" \ |
| 9279 | -S "SSL - Verification of the message MAC failed" |
| 9280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9281 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9282 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9283 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9284 | psk_identity=def psk=beef" \ |
| 9285 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9286 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9287 | -S "SSL - Unknown identity received" \ |
| 9288 | -S "SSL - Verification of the message MAC failed" |
| 9289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9290 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9291 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9292 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9293 | psk_identity=ghi psk=beef" \ |
| 9294 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9295 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9296 | -s "SSL - Unknown identity received" \ |
| 9297 | -S "SSL - Verification of the message MAC failed" |
| 9298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9299 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9300 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9301 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9302 | psk_identity=abc psk=beef" \ |
| 9303 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9304 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9305 | -S "SSL - Unknown identity received" \ |
| 9306 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9307 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9308 | # Tests for EC J-PAKE |
| 9309 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9310 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9312 | run_test "ECJPAKE: client not configured" \ |
| 9313 | "$P_SRV debug_level=3" \ |
| 9314 | "$P_CLI debug_level=3" \ |
| 9315 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9316 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9317 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9318 | -S "found ecjpake kkpp extension" \ |
| 9319 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9320 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9321 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9322 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9323 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9324 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9325 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9326 | run_test "ECJPAKE: server not configured" \ |
| 9327 | "$P_SRV debug_level=3" \ |
| 9328 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9329 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9330 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9331 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9332 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9333 | -s "found ecjpake kkpp extension" \ |
| 9334 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9335 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9336 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9337 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9338 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9339 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9340 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9341 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9342 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9343 | run_test "ECJPAKE: working, TLS" \ |
| 9344 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9345 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9346 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9347 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9348 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9349 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9350 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9351 | -s "found ecjpake kkpp extension" \ |
| 9352 | -S "skip ecjpake kkpp extension" \ |
| 9353 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9354 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9355 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9356 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9357 | -S "SSL - Verification of the message MAC failed" |
| 9358 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9359 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9360 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9361 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9362 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9363 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9364 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9365 | 0 \ |
| 9366 | -c "add ciphersuite: c0ff" \ |
| 9367 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9368 | -c "using opaque password" \ |
| 9369 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9370 | -C "re-using cached ecjpake parameters" \ |
| 9371 | -s "found ecjpake kkpp extension" \ |
| 9372 | -S "skip ecjpake kkpp extension" \ |
| 9373 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9374 | -s "server hello, ecjpake kkpp extension" \ |
| 9375 | -c "found ecjpake_kkpp extension" \ |
| 9376 | -S "SSL - The handshake negotiation failed" \ |
| 9377 | -S "SSL - Verification of the message MAC failed" |
| 9378 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9379 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9380 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9381 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9382 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9383 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9384 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9385 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9386 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9387 | 0 \ |
| 9388 | -c "add ciphersuite: c0ff" \ |
| 9389 | -c "adding ecjpake_kkpp extension" \ |
| 9390 | -c "using opaque password" \ |
| 9391 | -S "using opaque password" \ |
| 9392 | -C "re-using cached ecjpake parameters" \ |
| 9393 | -s "found ecjpake kkpp extension" \ |
| 9394 | -S "skip ecjpake kkpp extension" \ |
| 9395 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9396 | -s "server hello, ecjpake kkpp extension" \ |
| 9397 | -c "found ecjpake_kkpp extension" \ |
| 9398 | -S "SSL - The handshake negotiation failed" \ |
| 9399 | -S "SSL - Verification of the message MAC failed" |
| 9400 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9401 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9402 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9403 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9404 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9405 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9406 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9407 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9408 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9409 | 0 \ |
| 9410 | -c "add ciphersuite: c0ff" \ |
| 9411 | -c "adding ecjpake_kkpp extension" \ |
| 9412 | -C "using opaque password" \ |
| 9413 | -s "using opaque password" \ |
| 9414 | -C "re-using cached ecjpake parameters" \ |
| 9415 | -s "found ecjpake kkpp extension" \ |
| 9416 | -S "skip ecjpake kkpp extension" \ |
| 9417 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9418 | -s "server hello, ecjpake kkpp extension" \ |
| 9419 | -c "found ecjpake_kkpp extension" \ |
| 9420 | -S "SSL - The handshake negotiation failed" \ |
| 9421 | -S "SSL - Verification of the message MAC failed" |
| 9422 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9423 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9424 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9425 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9426 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9427 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9428 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9429 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9430 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9431 | -s "SSL - Verification of the message MAC failed" |
| 9432 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9433 | server_needs_more_time 1 |
| 9434 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9435 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9436 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9437 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9438 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9439 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9440 | 1 \ |
| 9441 | -c "using opaque password" \ |
| 9442 | -s "using opaque password" \ |
| 9443 | -C "re-using cached ecjpake parameters" \ |
| 9444 | -s "SSL - Verification of the message MAC failed" |
| 9445 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9446 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9447 | run_test "ECJPAKE: working, DTLS" \ |
| 9448 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9449 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9450 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9451 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9452 | -c "re-using cached ecjpake parameters" \ |
| 9453 | -S "SSL - Verification of the message MAC failed" |
| 9454 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9455 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9456 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9457 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9458 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9459 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9460 | 0 \ |
| 9461 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9462 | -S "SSL - Verification of the message MAC failed" |
| 9463 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9464 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9465 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9466 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9467 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9468 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9469 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9470 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9471 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9472 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9473 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9474 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9475 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9476 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9477 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9478 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9479 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9480 | 0 |
| 9481 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9482 | # Test for ClientHello without extensions |
| 9483 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9484 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9485 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9486 | requires_gnutls |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9487 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9488 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9489 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9490 | 0 \ |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9491 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9492 | -S "Ciphersuite is .*-EC.*" \ |
| 9493 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9494 | |
Gilles Peskine | f287691 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9495 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9496 | requires_gnutls |
| 9497 | run_test "ClientHello without extensions: PSK" \ |
| 9498 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9499 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9500 | 0 \ |
| 9501 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9502 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9503 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9504 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9505 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9506 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9507 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9509 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9510 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9511 | "$P_CLI request_size=100" \ |
| 9512 | 0 \ |
| 9513 | -s "Read from client: 100 bytes read$" |
| 9514 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9516 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9517 | "$P_SRV buffer_size=100" \ |
| 9518 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9519 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9520 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9521 | |
| 9522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9523 | requires_max_content_len 200 |
| 9524 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9525 | "$P_SRV buffer_size=100" \ |
| 9526 | "$P_CLI request_size=200" \ |
| 9527 | 0 \ |
| 9528 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9529 | |
| 9530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9531 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9532 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9533 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9534 | 0 \ |
| 9535 | -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] | 9536 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9537 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9538 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9539 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9540 | "$P_SRV force_version=tls12" \ |
| 9541 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9543 | 0 \ |
| 9544 | -s "Read from client: 1 bytes read" |
| 9545 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9546 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9547 | "$P_SRV force_version=tls12" \ |
| 9548 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9549 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 9550 | 0 \ |
| 9551 | -s "Read from client: 1 bytes read" |
| 9552 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9553 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9554 | "$P_SRV force_version=tls12" \ |
| 9555 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9556 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9557 | 0 \ |
| 9558 | -s "Read from client: 1 bytes read" |
| 9559 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9560 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9561 | "$P_SRV force_version=tls12" \ |
| 9562 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9563 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9564 | 0 \ |
| 9565 | -s "Read from client: 1 bytes read" |
| 9566 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9567 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9568 | "$P_SRV force_version=tls12" \ |
| 9569 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9570 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9571 | 0 \ |
| 9572 | -s "Read from client: 1 bytes read" |
| 9573 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9574 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9575 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9576 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9577 | "$P_CLI request_size=1 \ |
| 9578 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9579 | 0 \ |
| 9580 | -s "Read from client: 1 bytes read" |
| 9581 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9582 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9583 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9584 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9585 | "$P_CLI request_size=1 \ |
| 9586 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9587 | 0 \ |
| 9588 | -s "Read from client: 1 bytes read" |
| 9589 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9590 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9591 | |
| 9592 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9593 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9594 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9595 | "$P_CLI dtls=1 request_size=1 \ |
| 9596 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9597 | 0 \ |
| 9598 | -s "Read from client: 1 bytes read" |
| 9599 | |
| 9600 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9601 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9602 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9603 | "$P_CLI dtls=1 request_size=1 \ |
| 9604 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9605 | 0 \ |
| 9606 | -s "Read from client: 1 bytes read" |
| 9607 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9608 | # Tests for small server packets |
| 9609 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9610 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9611 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9612 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9613 | 0 \ |
| 9614 | -c "Read from server: 1 bytes read" |
| 9615 | |
| 9616 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9617 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9618 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9619 | 0 \ |
| 9620 | -c "Read from server: 1 bytes read" |
| 9621 | |
| 9622 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9623 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9624 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9625 | 0 \ |
| 9626 | -c "Read from server: 1 bytes read" |
| 9627 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9628 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9629 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9630 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9631 | 0 \ |
| 9632 | -c "Read from server: 1 bytes read" |
| 9633 | |
| 9634 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9635 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9636 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9637 | 0 \ |
| 9638 | -c "Read from server: 1 bytes read" |
| 9639 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9640 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9641 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9642 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9643 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9644 | 0 \ |
| 9645 | -c "Read from server: 1 bytes read" |
| 9646 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9647 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9648 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9649 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9650 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9651 | 0 \ |
| 9652 | -c "Read from server: 1 bytes read" |
| 9653 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9654 | # Tests for small server packets in DTLS |
| 9655 | |
| 9656 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9657 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9658 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9659 | "$P_CLI dtls=1 \ |
| 9660 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9661 | 0 \ |
| 9662 | -c "Read from server: 1 bytes read" |
| 9663 | |
| 9664 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9665 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9666 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9667 | "$P_CLI dtls=1 \ |
| 9668 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9669 | 0 \ |
| 9670 | -c "Read from server: 1 bytes read" |
| 9671 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9672 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9673 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9674 | # How many fragments do we expect to write $1 bytes? |
| 9675 | fragments_for_write() { |
| 9676 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9677 | } |
| 9678 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9679 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9680 | "$P_SRV force_version=tls12" \ |
| 9681 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9682 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9683 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9684 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9685 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9686 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9687 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9688 | "$P_SRV force_version=tls12" \ |
| 9689 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9690 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9691 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9692 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9693 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9694 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9695 | "$P_SRV force_version=tls12" \ |
| 9696 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9697 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9698 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9699 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9700 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9701 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9702 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9703 | "$P_SRV force_version=tls12" \ |
| 9704 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9705 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9706 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9707 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9708 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9709 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9710 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9711 | "$P_SRV force_version=tls12" \ |
| 9712 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9713 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9714 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9715 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9716 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9717 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9718 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9719 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9720 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9721 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9722 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9723 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9724 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9725 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9726 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9727 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9728 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9729 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9730 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9731 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9732 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9733 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9734 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9735 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9736 | # 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] | 9737 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9738 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9739 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9740 | 0 \ |
| 9741 | -c "Read from server: 16384 bytes read" |
| 9742 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9743 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9744 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9745 | "$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9746 | 0 \ |
| 9747 | -s "16384 bytes written in 1 fragments" \ |
| 9748 | -c "Read from server: 16384 bytes read" |
| 9749 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9750 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9751 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9752 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9753 | 0 \ |
| 9754 | -c "Read from server: 16384 bytes read" |
| 9755 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9756 | 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] | 9757 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9758 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9759 | 0 \ |
| 9760 | -s "16384 bytes written in 1 fragments" \ |
| 9761 | -c "Read from server: 16384 bytes read" |
| 9762 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9763 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9764 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9765 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9766 | 0 \ |
| 9767 | -c "Read from server: 16384 bytes read" |
| 9768 | |
| 9769 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9770 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9771 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9772 | 0 \ |
| 9773 | -c "Read from server: 16384 bytes read" |
| 9774 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9775 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9776 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9777 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9778 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9779 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9780 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9781 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9782 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9783 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9784 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9785 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9786 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9787 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9788 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9789 | # Tests for restartable ECC |
| 9790 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9791 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9792 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9793 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9794 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9795 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9796 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9797 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9798 | 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] | 9799 | debug_level=1" \ |
| 9800 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9801 | -C "x509_verify_cert.*4b00" \ |
| 9802 | -C "mbedtls_pk_verify.*4b00" \ |
| 9803 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9804 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9805 | |
| 9806 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9807 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9808 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9809 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9810 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9811 | 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] | 9812 | debug_level=1 ec_max_ops=0" \ |
| 9813 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9814 | -C "x509_verify_cert.*4b00" \ |
| 9815 | -C "mbedtls_pk_verify.*4b00" \ |
| 9816 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9817 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9818 | |
| 9819 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9820 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9821 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9822 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9823 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9824 | 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] | 9825 | debug_level=1 ec_max_ops=65535" \ |
| 9826 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9827 | -C "x509_verify_cert.*4b00" \ |
| 9828 | -C "mbedtls_pk_verify.*4b00" \ |
| 9829 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9830 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9831 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9832 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9833 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9834 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9835 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9836 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9837 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9838 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9839 | 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] | 9840 | debug_level=1 ec_max_ops=1000" \ |
| 9841 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9842 | -c "x509_verify_cert.*4b00" \ |
| 9843 | -c "mbedtls_pk_verify.*4b00" \ |
| 9844 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9845 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9846 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9847 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9848 | # everything except ECDH (where TLS calls PSA directly). |
| 9849 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9850 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9851 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9852 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9853 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9854 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9855 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9856 | debug_level=1 ec_max_ops=1000" \ |
| 9857 | 0 \ |
| 9858 | -c "x509_verify_cert.*4b00" \ |
| 9859 | -c "mbedtls_pk_verify.*4b00" \ |
| 9860 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9861 | -c "mbedtls_pk_sign.*4b00" |
| 9862 | |
| 9863 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9864 | # 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] | 9865 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9866 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9867 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9868 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9869 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9870 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9871 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9872 | 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] | 9873 | debug_level=1 ec_max_ops=1000" \ |
| 9874 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9875 | -c "x509_verify_cert.*4b00" \ |
| 9876 | -C "mbedtls_pk_verify.*4b00" \ |
| 9877 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9878 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9879 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9880 | -c "! mbedtls_ssl_handshake returned" \ |
| 9881 | -c "X509 - Certificate verification failed" |
| 9882 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9883 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9885 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9886 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9887 | 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] | 9888 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9889 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9890 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9891 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9892 | 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] | 9893 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9894 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9895 | -c "x509_verify_cert.*4b00" \ |
| 9896 | -c "mbedtls_pk_verify.*4b00" \ |
| 9897 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9898 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9899 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9900 | -C "! mbedtls_ssl_handshake returned" \ |
| 9901 | -C "X509 - Certificate verification failed" |
| 9902 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9903 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9904 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9905 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9906 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9907 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9908 | 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] | 9909 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9910 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9911 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9912 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9913 | 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] | 9914 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9915 | 0 \ |
| 9916 | -c "x509_verify_cert.*4b00" \ |
| 9917 | -c "mbedtls_pk_verify.*4b00" \ |
| 9918 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9919 | -c "mbedtls_pk_sign.*4b00" \ |
| 9920 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9921 | -C "! mbedtls_ssl_handshake returned" \ |
| 9922 | -C "X509 - Certificate verification failed" |
| 9923 | |
| 9924 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9925 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9926 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9927 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9928 | 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] | 9929 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9930 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9931 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9932 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9933 | 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] | 9934 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9935 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9936 | -C "x509_verify_cert.*4b00" \ |
| 9937 | -c "mbedtls_pk_verify.*4b00" \ |
| 9938 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9939 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9940 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9941 | -C "! mbedtls_ssl_handshake returned" \ |
| 9942 | -C "X509 - Certificate verification failed" |
| 9943 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9944 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9945 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9946 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9947 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9948 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9949 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9950 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9951 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9952 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9953 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9954 | 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] | 9955 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9956 | 0 \ |
| 9957 | -C "x509_verify_cert.*4b00" \ |
| 9958 | -c "mbedtls_pk_verify.*4b00" \ |
| 9959 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9960 | -c "mbedtls_pk_sign.*4b00" \ |
| 9961 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9962 | -C "! mbedtls_ssl_handshake returned" \ |
| 9963 | -C "X509 - Certificate verification failed" |
| 9964 | |
| 9965 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9966 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9967 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9968 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9969 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9970 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9971 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9972 | 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] | 9973 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9974 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9975 | -c "x509_verify_cert.*4b00" \ |
| 9976 | -c "mbedtls_pk_verify.*4b00" \ |
| 9977 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9978 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9979 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9980 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9981 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9982 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9983 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9984 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9985 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9986 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9987 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9988 | 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] | 9989 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9990 | 0 \ |
| 9991 | -c "x509_verify_cert.*4b00" \ |
| 9992 | -c "mbedtls_pk_verify.*4b00" \ |
| 9993 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9994 | -c "mbedtls_pk_sign.*4b00" |
| 9995 | |
| 9996 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9997 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9998 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9999 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 10000 | 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] | 10001 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10002 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10003 | debug_level=1 ec_max_ops=1000" \ |
| 10004 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 10005 | -c "x509_verify_cert.*4b00" \ |
| 10006 | -c "mbedtls_pk_verify.*4b00" \ |
| 10007 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 10008 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10009 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10010 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 10011 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 10012 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10013 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 10014 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 10015 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 10016 | 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] | 10017 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 10018 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10019 | debug_level=1 ec_max_ops=1000" \ |
| 10020 | 0 \ |
| 10021 | -c "x509_verify_cert.*4b00" \ |
| 10022 | -c "mbedtls_pk_verify.*4b00" \ |
| 10023 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 10024 | -C "mbedtls_pk_sign.*4b00" |
| 10025 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10026 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 10027 | # restartable behaviour at all (not even client auth). |
| 10028 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 10029 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10030 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 10031 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10032 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 10033 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 10034 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10035 | 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] | 10036 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10037 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 10038 | -C "x509_verify_cert.*4b00" \ |
| 10039 | -C "mbedtls_pk_verify.*4b00" \ |
| 10040 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 10041 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 10042 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10043 | # Tests of asynchronous private key support in SSL |
| 10044 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10045 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10046 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10047 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10048 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10049 | "$P_CLI" \ |
| 10050 | 0 \ |
| 10051 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10052 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10053 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10054 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10055 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10056 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10057 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10058 | "$P_CLI" \ |
| 10059 | 0 \ |
| 10060 | -s "Async sign callback: using key slot " \ |
| 10061 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10062 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10063 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10064 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10065 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10066 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 10067 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 10068 | "$P_CLI" \ |
| 10069 | 0 \ |
| 10070 | -s "Async sign callback: using key slot " \ |
| 10071 | -U "Async sign callback: using key slot " \ |
| 10072 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 10073 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10074 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10075 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10076 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 10077 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10078 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10079 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 10080 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10081 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 10082 | 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] | 10083 | "$P_CLI server_name=polarssl.example" \ |
| 10084 | 0 \ |
| 10085 | -s "Async sign callback: using key slot " \ |
| 10086 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10087 | -s "parse ServerName extension" \ |
| 10088 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 10089 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 10090 | |
| 10091 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10092 | run_test "SSL async private: decrypt, delay=0" \ |
| 10093 | "$P_SRV \ |
| 10094 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 10095 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10096 | 0 \ |
| 10097 | -s "Async decrypt callback: using key slot " \ |
| 10098 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10099 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10100 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10101 | run_test "SSL async private: decrypt, delay=1" \ |
| 10102 | "$P_SRV \ |
| 10103 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 10104 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10105 | 0 \ |
| 10106 | -s "Async decrypt callback: using key slot " \ |
| 10107 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10108 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10109 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10110 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10111 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10112 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10113 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10114 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10115 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10116 | 0 \ |
| 10117 | -s "Async decrypt callback: using key slot " \ |
| 10118 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10119 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10120 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10121 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10122 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10123 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10124 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10125 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 10126 | 0 \ |
| 10127 | -s "Async decrypt callback: using key slot " \ |
| 10128 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 10129 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10130 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10131 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10132 | run_test "SSL async private: sign callback not present" \ |
| 10133 | "$P_SRV \ |
| 10134 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10135 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10136 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10137 | 0 \ |
| 10138 | -S "Async sign callback" \ |
| 10139 | -s "! mbedtls_ssl_handshake returned" \ |
| 10140 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 10141 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 10142 | -s "Successful connection" |
| 10143 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10144 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10145 | run_test "SSL async private: decrypt callback not present" \ |
| 10146 | "$P_SRV debug_level=1 \ |
| 10147 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 10148 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 10149 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10150 | 0 \ |
| 10151 | -S "Async decrypt callback" \ |
| 10152 | -s "! mbedtls_ssl_handshake returned" \ |
| 10153 | -s "got no RSA private key" \ |
| 10154 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 10155 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10156 | |
| 10157 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10159 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10160 | "$P_SRV \ |
| 10161 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10162 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10163 | 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] | 10164 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10165 | 0 \ |
| 10166 | -s "Async sign callback: using key slot 0," \ |
| 10167 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10168 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10169 | |
| 10170 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10171 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10172 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10173 | "$P_SRV \ |
| 10174 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10175 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10176 | 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] | 10177 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10178 | 0 \ |
| 10179 | -s "Async sign callback: using key slot 0," \ |
| 10180 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10181 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10182 | |
| 10183 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10184 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 10185 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10186 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10187 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10188 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10189 | 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] | 10190 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10191 | 0 \ |
| 10192 | -s "Async sign callback: using key slot 1," \ |
| 10193 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10194 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10195 | |
| 10196 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10197 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10198 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10199 | "$P_SRV \ |
| 10200 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10201 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10202 | 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] | 10203 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10204 | 0 \ |
| 10205 | -s "Async sign callback: no key matches this certificate." |
| 10206 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10208 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10209 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10210 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10211 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10212 | "$P_CLI" \ |
| 10213 | 1 \ |
| 10214 | -s "Async sign callback: injected error" \ |
| 10215 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10216 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10217 | -s "! mbedtls_ssl_handshake returned" |
| 10218 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10220 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10221 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10222 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10223 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10224 | "$P_CLI" \ |
| 10225 | 1 \ |
| 10226 | -s "Async sign callback: using key slot " \ |
| 10227 | -S "Async resume" \ |
| 10228 | -s "Async cancel" |
| 10229 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10230 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10231 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10232 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10233 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10234 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10235 | "$P_CLI" \ |
| 10236 | 1 \ |
| 10237 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10238 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10239 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10240 | -s "! mbedtls_ssl_handshake returned" |
| 10241 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10242 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10243 | run_test "SSL async private: decrypt, error in start" \ |
| 10244 | "$P_SRV \ |
| 10245 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10246 | async_private_error=1" \ |
| 10247 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10248 | 1 \ |
| 10249 | -s "Async decrypt callback: injected error" \ |
| 10250 | -S "Async resume" \ |
| 10251 | -S "Async cancel" \ |
| 10252 | -s "! mbedtls_ssl_handshake returned" |
| 10253 | |
| 10254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10255 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10256 | "$P_SRV \ |
| 10257 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10258 | async_private_error=2" \ |
| 10259 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10260 | 1 \ |
| 10261 | -s "Async decrypt callback: using key slot " \ |
| 10262 | -S "Async resume" \ |
| 10263 | -s "Async cancel" |
| 10264 | |
| 10265 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10266 | run_test "SSL async private: decrypt, error in resume" \ |
| 10267 | "$P_SRV \ |
| 10268 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10269 | async_private_error=3" \ |
| 10270 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10271 | 1 \ |
| 10272 | -s "Async decrypt callback: using key slot " \ |
| 10273 | -s "Async resume callback: decrypt done but injected error" \ |
| 10274 | -S "Async cancel" \ |
| 10275 | -s "! mbedtls_ssl_handshake returned" |
| 10276 | |
| 10277 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10278 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10279 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10280 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10281 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10282 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10283 | 0 \ |
| 10284 | -s "Async cancel" \ |
| 10285 | -s "! mbedtls_ssl_handshake returned" \ |
| 10286 | -s "Async resume" \ |
| 10287 | -s "Successful connection" |
| 10288 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10290 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10291 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10292 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10293 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10294 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10295 | 0 \ |
| 10296 | -s "! mbedtls_ssl_handshake returned" \ |
| 10297 | -s "Async resume" \ |
| 10298 | -s "Successful connection" |
| 10299 | |
| 10300 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10301 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10302 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10303 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10304 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10305 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10306 | 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] | 10307 | "$P_SRV \ |
| 10308 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10309 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10310 | 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] | 10311 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10312 | [ \$? -eq 1 ] && |
| 10313 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10314 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10315 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10316 | -S "Async resume" \ |
| 10317 | -s "Async cancel" \ |
| 10318 | -s "! mbedtls_ssl_handshake returned" \ |
| 10319 | -s "Async sign callback: no key matches this certificate." \ |
| 10320 | -s "Successful connection" |
| 10321 | |
| 10322 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10323 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10324 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10325 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10326 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10327 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10328 | 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] | 10329 | "$P_SRV \ |
| 10330 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10331 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10332 | 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] | 10333 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10334 | [ \$? -eq 1 ] && |
| 10335 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10336 | 0 \ |
| 10337 | -s "Async resume" \ |
| 10338 | -s "! mbedtls_ssl_handshake returned" \ |
| 10339 | -s "Async sign callback: no key matches this certificate." \ |
| 10340 | -s "Successful connection" |
| 10341 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10342 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10343 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10344 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10345 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10346 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10347 | exchanges=2 renegotiation=1" \ |
| 10348 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10349 | 0 \ |
| 10350 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10351 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10352 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10353 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10355 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10356 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10357 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10358 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10359 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10360 | 0 \ |
| 10361 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10362 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10363 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10364 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10365 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10366 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10367 | "$P_SRV \ |
| 10368 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10369 | exchanges=2 renegotiation=1" \ |
| 10370 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10371 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10372 | 0 \ |
| 10373 | -s "Async decrypt callback: using key slot " \ |
| 10374 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10375 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10376 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10377 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10378 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10379 | "$P_SRV \ |
| 10380 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10381 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10382 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10383 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10384 | 0 \ |
| 10385 | -s "Async decrypt callback: using key slot " \ |
| 10386 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10387 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10388 | # Tests for ECC extensions (rfc 4492) |
| 10389 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10390 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10391 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10392 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10393 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10394 | "$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10395 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10396 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10397 | -C "client hello, adding supported_point_formats extension" \ |
| 10398 | -S "found supported elliptic curves extension" \ |
| 10399 | -S "found supported point formats extension" |
| 10400 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10401 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10402 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10403 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10404 | "$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10405 | "$P_CLI debug_level=3" \ |
| 10406 | 0 \ |
| 10407 | -C "found supported_point_formats extension" \ |
| 10408 | -S "server hello, supported_point_formats extension" |
| 10409 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10410 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10411 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10412 | "$P_SRV debug_level=3" \ |
| 10413 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10414 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10415 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10416 | -c "client hello, adding supported_point_formats extension" \ |
| 10417 | -s "found supported elliptic curves extension" \ |
| 10418 | -s "found supported point formats extension" |
| 10419 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10420 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10421 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10422 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10423 | "$P_CLI debug_level=3" \ |
| 10424 | 0 \ |
| 10425 | -c "found supported_point_formats extension" \ |
| 10426 | -s "server hello, supported_point_formats extension" |
| 10427 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10428 | # Tests for DTLS HelloVerifyRequest |
| 10429 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10431 | run_test "DTLS cookie: enabled" \ |
| 10432 | "$P_SRV dtls=1 debug_level=2" \ |
| 10433 | "$P_CLI dtls=1 debug_level=2" \ |
| 10434 | 0 \ |
| 10435 | -s "cookie verification failed" \ |
| 10436 | -s "cookie verification passed" \ |
| 10437 | -S "cookie verification skipped" \ |
| 10438 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10439 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10440 | -S "SSL - The requested feature is not available" |
| 10441 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10443 | run_test "DTLS cookie: disabled" \ |
| 10444 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10445 | "$P_CLI dtls=1 debug_level=2" \ |
| 10446 | 0 \ |
| 10447 | -S "cookie verification failed" \ |
| 10448 | -S "cookie verification passed" \ |
| 10449 | -s "cookie verification skipped" \ |
| 10450 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10451 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10452 | -S "SSL - The requested feature is not available" |
| 10453 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10455 | run_test "DTLS cookie: default (failing)" \ |
| 10456 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10457 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10458 | 1 \ |
| 10459 | -s "cookie verification failed" \ |
| 10460 | -S "cookie verification passed" \ |
| 10461 | -S "cookie verification skipped" \ |
| 10462 | -C "received hello verify request" \ |
| 10463 | -S "hello verification requested" \ |
| 10464 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10465 | |
| 10466 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10468 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10469 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10470 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10471 | 0 \ |
| 10472 | -s "cookie verification failed" \ |
| 10473 | -s "cookie verification passed" \ |
| 10474 | -S "cookie verification skipped" \ |
| 10475 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10476 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10477 | -S "SSL - The requested feature is not available" |
| 10478 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10480 | run_test "DTLS cookie: enabled, nbio" \ |
| 10481 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10482 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10483 | 0 \ |
| 10484 | -s "cookie verification failed" \ |
| 10485 | -s "cookie verification passed" \ |
| 10486 | -S "cookie verification skipped" \ |
| 10487 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10488 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10489 | -S "SSL - The requested feature is not available" |
| 10490 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10491 | # Tests for client reconnecting from the same port with DTLS |
| 10492 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10493 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10495 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10496 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10497 | "$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] | 10498 | 0 \ |
| 10499 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10500 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10501 | -S "Client initiated reconnection from same port" |
| 10502 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10503 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10505 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10506 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10507 | "$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] | 10508 | 0 \ |
| 10509 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10510 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10511 | -s "Client initiated reconnection from same port" |
| 10512 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10513 | 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] | 10514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10515 | 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] | 10516 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10517 | "$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] | 10518 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10519 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10520 | -s "Client initiated reconnection from same port" |
| 10521 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10522 | 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] | 10523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10524 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10525 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10526 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10527 | 0 \ |
| 10528 | -S "The operation timed out" \ |
| 10529 | -s "Client initiated reconnection from same port" |
| 10530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10532 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10533 | "$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] | 10534 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10535 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10536 | -s "The operation timed out" \ |
| 10537 | -S "Client initiated reconnection from same port" |
| 10538 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10540 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10541 | -p "$P_PXY inject_clihlo=1" \ |
| 10542 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10543 | "$P_CLI dtls=1 exchanges=2" \ |
| 10544 | 0 \ |
| 10545 | -s "possible client reconnect from the same port" \ |
| 10546 | -S "Client initiated reconnection from same port" |
| 10547 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10548 | # Tests for various cases of client authentication with DTLS |
| 10549 | # (focused on handshake flows and message parsing) |
| 10550 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10552 | run_test "DTLS client auth: required" \ |
| 10553 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10554 | "$P_CLI dtls=1" \ |
| 10555 | 0 \ |
| 10556 | -s "Verifying peer X.509 certificate... ok" |
| 10557 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10559 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10560 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10561 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10562 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10563 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10566 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10567 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10568 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10569 | 0 \ |
| 10570 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10571 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10572 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10573 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10574 | "$P_SRV dtls=1 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 10575 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10576 | 1 \ |
| 10577 | -s "SSL - Verification of the message MAC failed" \ |
| 10578 | -c "SSL - A fatal alert message was received from our peer" |
| 10579 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10580 | # Tests for receiving fragmented handshake messages with DTLS |
| 10581 | |
| 10582 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10584 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10585 | "$G_SRV -u --mtu 2048 -a" \ |
| 10586 | "$P_CLI dtls=1 debug_level=2" \ |
| 10587 | 0 \ |
| 10588 | -C "found fragmented DTLS handshake message" \ |
| 10589 | -C "error" |
| 10590 | |
| 10591 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10593 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10594 | "$G_SRV -u --mtu 512" \ |
| 10595 | "$P_CLI dtls=1 debug_level=2" \ |
| 10596 | 0 \ |
| 10597 | -c "found fragmented DTLS handshake message" \ |
| 10598 | -C "error" |
| 10599 | |
| 10600 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10602 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10603 | "$G_SRV -u --mtu 128" \ |
| 10604 | "$P_CLI dtls=1 debug_level=2" \ |
| 10605 | 0 \ |
| 10606 | -c "found fragmented DTLS handshake message" \ |
| 10607 | -C "error" |
| 10608 | |
| 10609 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10611 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10612 | "$G_SRV -u --mtu 128" \ |
| 10613 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10614 | 0 \ |
| 10615 | -c "found fragmented DTLS handshake message" \ |
| 10616 | -C "error" |
| 10617 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10618 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10619 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10621 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10622 | "$G_SRV -u --mtu 256" \ |
| 10623 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10624 | 0 \ |
| 10625 | -c "found fragmented DTLS handshake message" \ |
| 10626 | -c "client hello, adding renegotiation extension" \ |
| 10627 | -c "found renegotiation extension" \ |
| 10628 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10629 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10630 | -C "error" \ |
| 10631 | -s "Extra-header:" |
| 10632 | |
| 10633 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10636 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10637 | "$G_SRV -u --mtu 256" \ |
| 10638 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10639 | 0 \ |
| 10640 | -c "found fragmented DTLS handshake message" \ |
| 10641 | -c "client hello, adding renegotiation extension" \ |
| 10642 | -c "found renegotiation extension" \ |
| 10643 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10644 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10645 | -C "error" \ |
| 10646 | -s "Extra-header:" |
| 10647 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10649 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10650 | "$O_SRV -dtls -mtu 2048" \ |
| 10651 | "$P_CLI dtls=1 debug_level=2" \ |
| 10652 | 0 \ |
| 10653 | -C "found fragmented DTLS handshake message" \ |
| 10654 | -C "error" |
| 10655 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10657 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10658 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10659 | "$P_CLI dtls=1 debug_level=2" \ |
| 10660 | 0 \ |
| 10661 | -c "found fragmented DTLS handshake message" \ |
| 10662 | -C "error" |
| 10663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10665 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10666 | "$O_SRV -dtls -mtu 256" \ |
| 10667 | "$P_CLI dtls=1 debug_level=2" \ |
| 10668 | 0 \ |
| 10669 | -c "found fragmented DTLS handshake message" \ |
| 10670 | -C "error" |
| 10671 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10673 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10674 | "$O_SRV -dtls -mtu 256" \ |
| 10675 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10676 | 0 \ |
| 10677 | -c "found fragmented DTLS handshake message" \ |
| 10678 | -C "error" |
| 10679 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10680 | # Tests for sending fragmented handshake messages with DTLS |
| 10681 | # |
| 10682 | # Use client auth when we need the client to send large messages, |
| 10683 | # and use large cert chains on both sides too (the long chains we have all use |
| 10684 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10685 | # Sizes reached (UDP payload): |
| 10686 | # - 2037B for server certificate |
| 10687 | # - 1542B for client certificate |
| 10688 | # - 1013B for newsessionticket |
| 10689 | # - all others below 512B |
| 10690 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10691 | |
| 10692 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10693 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10694 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10695 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10697 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10698 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10699 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10700 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10701 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10702 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10703 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10704 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10705 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10706 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10707 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10708 | 0 \ |
| 10709 | -S "found fragmented DTLS handshake message" \ |
| 10710 | -C "found fragmented DTLS handshake message" \ |
| 10711 | -C "error" |
| 10712 | |
| 10713 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10714 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10715 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10716 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10718 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10719 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10720 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10721 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10722 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10723 | max_frag_len=1024" \ |
| 10724 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10725 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10726 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10727 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10728 | max_frag_len=2048" \ |
| 10729 | 0 \ |
| 10730 | -S "found fragmented DTLS handshake message" \ |
| 10731 | -c "found fragmented DTLS handshake message" \ |
| 10732 | -C "error" |
| 10733 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10734 | # With the MFL extension, the server has no way of forcing |
| 10735 | # the client to not exceed a certain MTU; hence, the following |
| 10736 | # test can't be replicated with an MTU proxy such as the one |
| 10737 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10739 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10741 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10743 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10744 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10745 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10746 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10747 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10748 | max_frag_len=512" \ |
| 10749 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10750 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10751 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10752 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10753 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10754 | 0 \ |
| 10755 | -S "found fragmented DTLS handshake message" \ |
| 10756 | -c "found fragmented DTLS handshake message" \ |
| 10757 | -C "error" |
| 10758 | |
| 10759 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10760 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10761 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10762 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10764 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10765 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10766 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10767 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10768 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10769 | max_frag_len=2048" \ |
| 10770 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10771 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10772 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10773 | hs_timeout=2500-60000 \ |
| 10774 | max_frag_len=1024" \ |
| 10775 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10776 | -S "found fragmented DTLS handshake message" \ |
| 10777 | -c "found fragmented DTLS handshake message" \ |
| 10778 | -C "error" |
| 10779 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10780 | # While not required by the standard defining the MFL extension |
| 10781 | # (according to which it only applies to records, not to datagrams), |
| 10782 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10783 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10784 | # to the peer. |
| 10785 | # The next test checks that no datagrams significantly larger than the |
| 10786 | # negotiated MFL are sent. |
| 10787 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10788 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10789 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10790 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10792 | 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] | 10793 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10794 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10795 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10796 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10797 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10798 | max_frag_len=2048" \ |
| 10799 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10800 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10801 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10802 | hs_timeout=2500-60000 \ |
| 10803 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10804 | 0 \ |
| 10805 | -S "found fragmented DTLS handshake message" \ |
| 10806 | -c "found fragmented DTLS handshake message" \ |
| 10807 | -C "error" |
| 10808 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10810 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10811 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10812 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10814 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10815 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10816 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10817 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10818 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10819 | max_frag_len=2048" \ |
| 10820 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10821 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10822 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10823 | hs_timeout=2500-60000 \ |
| 10824 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10825 | 0 \ |
| 10826 | -s "found fragmented DTLS handshake message" \ |
| 10827 | -c "found fragmented DTLS handshake message" \ |
| 10828 | -C "error" |
| 10829 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10830 | # While not required by the standard defining the MFL extension |
| 10831 | # (according to which it only applies to records, not to datagrams), |
| 10832 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10833 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10834 | # to the peer. |
| 10835 | # The next test checks that no datagrams significantly larger than the |
| 10836 | # negotiated MFL are sent. |
| 10837 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10838 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10839 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10840 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10842 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10843 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10844 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10845 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10846 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10847 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10848 | max_frag_len=2048" \ |
| 10849 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10850 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10851 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10852 | hs_timeout=2500-60000 \ |
| 10853 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10854 | 0 \ |
| 10855 | -s "found fragmented DTLS handshake message" \ |
| 10856 | -c "found fragmented DTLS handshake message" \ |
| 10857 | -C "error" |
| 10858 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10859 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10860 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10861 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10863 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10864 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10865 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10866 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10867 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10868 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10869 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10870 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10871 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10872 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10873 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10874 | 0 \ |
| 10875 | -S "found fragmented DTLS handshake message" \ |
| 10876 | -C "found fragmented DTLS handshake message" \ |
| 10877 | -C "error" |
| 10878 | |
| 10879 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10880 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10881 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10883 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10884 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10885 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10886 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10887 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10888 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10889 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10890 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10891 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10892 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10893 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10894 | 0 \ |
| 10895 | -s "found fragmented DTLS handshake message" \ |
| 10896 | -C "found fragmented DTLS handshake message" \ |
| 10897 | -C "error" |
| 10898 | |
| 10899 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10900 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10901 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10903 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10904 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10905 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10906 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10907 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10908 | mtu=512" \ |
| 10909 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10910 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10911 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10912 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10913 | mtu=2048" \ |
| 10914 | 0 \ |
| 10915 | -S "found fragmented DTLS handshake message" \ |
| 10916 | -c "found fragmented DTLS handshake message" \ |
| 10917 | -C "error" |
| 10918 | |
| 10919 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10920 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10921 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10923 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10924 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10925 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10926 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10927 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10928 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10929 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10930 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10931 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10932 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10933 | hs_timeout=2500-60000 \ |
| 10934 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10935 | 0 \ |
| 10936 | -s "found fragmented DTLS handshake message" \ |
| 10937 | -c "found fragmented DTLS handshake message" \ |
| 10938 | -C "error" |
| 10939 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10940 | # 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] | 10941 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10942 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10943 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10944 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10945 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10946 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10947 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10948 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10949 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10950 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10951 | mtu=512" \ |
| 10952 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10953 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10954 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10955 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10956 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10957 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10958 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10959 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10960 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10961 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10962 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10963 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10964 | # 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] | 10965 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10966 | # retransmissions, but in some cases (like both the server and client using |
| 10967 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10968 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10969 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10970 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10971 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10972 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10973 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10974 | -p "$P_PXY mtu=508" \ |
| 10975 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10976 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10977 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10978 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10979 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10980 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10981 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10982 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10983 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10984 | 0 \ |
| 10985 | -s "found fragmented DTLS handshake message" \ |
| 10986 | -c "found fragmented DTLS handshake message" \ |
| 10987 | -C "error" |
| 10988 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10989 | # 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] | 10990 | only_with_valgrind |
| 10991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10992 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10993 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10994 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10995 | -p "$P_PXY mtu=508" \ |
| 10996 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10997 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10998 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10999 | hs_timeout=250-10000" \ |
| 11000 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11001 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11002 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11003 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 11004 | hs_timeout=250-10000" \ |
| 11005 | 0 \ |
| 11006 | -s "found fragmented DTLS handshake message" \ |
| 11007 | -c "found fragmented DTLS handshake message" \ |
| 11008 | -C "error" |
| 11009 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11010 | # 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] | 11011 | # OTOH the client might resend if the server is to slow to reset after sending |
| 11012 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11013 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11014 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11015 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11016 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11018 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11019 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11020 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11021 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11022 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11023 | hs_timeout=10000-60000 \ |
| 11024 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11025 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11026 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11027 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11028 | hs_timeout=10000-60000 \ |
| 11029 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11030 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11031 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11032 | -s "found fragmented DTLS handshake message" \ |
| 11033 | -c "found fragmented DTLS handshake message" \ |
| 11034 | -C "error" |
| 11035 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11036 | # 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] | 11037 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 11038 | # OTOH the client might resend if the server is to slow to reset after sending |
| 11039 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11040 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11041 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11042 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11043 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11044 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11045 | -p "$P_PXY mtu=512" \ |
| 11046 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11047 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11048 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11049 | hs_timeout=10000-60000 \ |
| 11050 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11051 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11052 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11053 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11054 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11055 | hs_timeout=10000-60000 \ |
| 11056 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11057 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11058 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11059 | -s "found fragmented DTLS handshake message" \ |
| 11060 | -c "found fragmented DTLS handshake message" \ |
| 11061 | -C "error" |
| 11062 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11063 | not_with_valgrind # spurious autoreduction due to timeout |
| 11064 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11065 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11066 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11068 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11069 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11070 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11071 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11072 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11073 | hs_timeout=10000-60000 \ |
| 11074 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11075 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11076 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11077 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11078 | hs_timeout=10000-60000 \ |
| 11079 | mtu=1024 nbio=2" \ |
| 11080 | 0 \ |
| 11081 | -S "autoreduction" \ |
| 11082 | -s "found fragmented DTLS handshake message" \ |
| 11083 | -c "found fragmented DTLS handshake message" \ |
| 11084 | -C "error" |
| 11085 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11086 | # 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] | 11087 | not_with_valgrind # spurious autoreduction due to timeout |
| 11088 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11089 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11090 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11091 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 11092 | -p "$P_PXY mtu=512" \ |
| 11093 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11094 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11095 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11096 | hs_timeout=10000-60000 \ |
| 11097 | mtu=512 nbio=2" \ |
| 11098 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11099 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11100 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11101 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 11102 | hs_timeout=10000-60000 \ |
| 11103 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11104 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11105 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11106 | -s "found fragmented DTLS handshake message" \ |
| 11107 | -c "found fragmented DTLS handshake message" \ |
| 11108 | -C "error" |
| 11109 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11110 | # 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] | 11111 | # This ensures things still work after session_reset(). |
| 11112 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11113 | # Since we don't support reading fragmented ClientHello yet, |
| 11114 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 11115 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11116 | # An autoreduction on the client-side might happen if the server is |
| 11117 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 11118 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11119 | # resumed listening, which would result in a spurious autoreduction. |
| 11120 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11121 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11122 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11123 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11124 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 11125 | -p "$P_PXY mtu=1450" \ |
| 11126 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11127 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11128 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11129 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11130 | mtu=1450" \ |
| 11131 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11132 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11133 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11134 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11135 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 11136 | 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] | 11137 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11138 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 11139 | -s "found fragmented DTLS handshake message" \ |
| 11140 | -c "found fragmented DTLS handshake message" \ |
| 11141 | -C "error" |
| 11142 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11143 | # An autoreduction on the client-side might happen if the server is |
| 11144 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11145 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11146 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11147 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11148 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11149 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11150 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11151 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 11152 | -p "$P_PXY mtu=512" \ |
| 11153 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11154 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11155 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11156 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11157 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11158 | mtu=512" \ |
| 11159 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11160 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11161 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11162 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 11163 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11164 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11165 | mtu=512" \ |
| 11166 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11167 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11168 | -s "found fragmented DTLS handshake message" \ |
| 11169 | -c "found fragmented DTLS handshake message" \ |
| 11170 | -C "error" |
| 11171 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11172 | # An autoreduction on the client-side might happen if the server is |
| 11173 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11174 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11175 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11176 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11177 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11178 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11179 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11180 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 11181 | -p "$P_PXY mtu=512" \ |
| 11182 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11183 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11184 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11185 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11186 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11187 | mtu=512" \ |
| 11188 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11189 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11190 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11191 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11192 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11193 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11194 | mtu=512" \ |
| 11195 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11196 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11197 | -s "found fragmented DTLS handshake message" \ |
| 11198 | -c "found fragmented DTLS handshake message" \ |
| 11199 | -C "error" |
| 11200 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11201 | # An autoreduction on the client-side might happen if the server is |
| 11202 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11203 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11205 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11206 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11207 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11208 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11209 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11210 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11211 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11212 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11213 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11214 | exchanges=2 renegotiation=1 \ |
| 11215 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11216 | hs_timeout=10000-60000 \ |
| 11217 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11218 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11219 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11220 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11221 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11222 | hs_timeout=10000-60000 \ |
| 11223 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11224 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11225 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11226 | -s "found fragmented DTLS handshake message" \ |
| 11227 | -c "found fragmented DTLS handshake message" \ |
| 11228 | -C "error" |
| 11229 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11230 | # An autoreduction on the client-side might happen if the server is |
| 11231 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11232 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11233 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11234 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11235 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11237 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11238 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11239 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11240 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11241 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11242 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11243 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11244 | exchanges=2 renegotiation=1 \ |
| 11245 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11246 | hs_timeout=10000-60000 \ |
| 11247 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11248 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11249 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11250 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11251 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11252 | hs_timeout=10000-60000 \ |
| 11253 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11254 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11255 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11256 | -s "found fragmented DTLS handshake message" \ |
| 11257 | -c "found fragmented DTLS handshake message" \ |
| 11258 | -C "error" |
| 11259 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11260 | # An autoreduction on the client-side might happen if the server is |
| 11261 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11262 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11263 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11264 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11265 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11267 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11268 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11269 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11270 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11271 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11272 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11273 | exchanges=2 renegotiation=1 \ |
| 11274 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11275 | hs_timeout=10000-60000 \ |
| 11276 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11277 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11278 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11279 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11280 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11281 | hs_timeout=10000-60000 \ |
| 11282 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11283 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11284 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11285 | -s "found fragmented DTLS handshake message" \ |
| 11286 | -c "found fragmented DTLS handshake message" \ |
| 11287 | -C "error" |
| 11288 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11289 | # 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] | 11290 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11291 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11292 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11293 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11294 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11295 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11296 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11297 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11298 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11299 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11300 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11301 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11302 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11303 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11304 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11305 | 0 \ |
| 11306 | -s "found fragmented DTLS handshake message" \ |
| 11307 | -c "found fragmented DTLS handshake message" \ |
| 11308 | -C "error" |
| 11309 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11310 | # 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] | 11311 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11312 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11313 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11314 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11315 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11316 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11317 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11318 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11319 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11320 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11321 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11322 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11323 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11324 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11325 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11326 | 0 \ |
| 11327 | -s "found fragmented DTLS handshake message" \ |
| 11328 | -c "found fragmented DTLS handshake message" \ |
| 11329 | -C "error" |
| 11330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11331 | # interop tests for DTLS fragmentating with reliable connection |
| 11332 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11333 | # here and below we just want to test that the we fragment in a way that |
| 11334 | # pleases other implementations, so we don't need the peer to fragment |
| 11335 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11336 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11337 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11338 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11339 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11340 | "$G_SRV -u" \ |
| 11341 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11342 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11343 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11344 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11345 | 0 \ |
| 11346 | -c "fragmenting handshake message" \ |
| 11347 | -C "error" |
| 11348 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11349 | # We use --insecure for the GnuTLS client because it expects |
| 11350 | # the hostname / IP it connects to to be the name used in the |
| 11351 | # certificate obtained from the server. Here, however, it |
| 11352 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11353 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11354 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11355 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11357 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11358 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11359 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11360 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11361 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11362 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11363 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11364 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11365 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11366 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11367 | 0 \ |
| 11368 | -s "fragmenting handshake message" |
| 11369 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11370 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11371 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11372 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11373 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11374 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11375 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11376 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11377 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11378 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11379 | 0 \ |
| 11380 | -c "fragmenting handshake message" \ |
| 11381 | -C "error" |
| 11382 | |
| 11383 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11384 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11385 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11386 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11387 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11388 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11389 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11390 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11391 | "$O_CLI -dtls1_2" \ |
| 11392 | 0 \ |
| 11393 | -s "fragmenting handshake message" |
| 11394 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11395 | # interop tests for DTLS fragmentating with unreliable connection |
| 11396 | # |
| 11397 | # again we just want to test that the we fragment in a way that |
| 11398 | # pleases other implementations, so we don't need the peer to fragment |
| 11399 | requires_gnutls_next |
| 11400 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11401 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11402 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11403 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11404 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11405 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11406 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11407 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11408 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11409 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11410 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11411 | 0 \ |
| 11412 | -c "fragmenting handshake message" \ |
| 11413 | -C "error" |
| 11414 | |
| 11415 | requires_gnutls_next |
| 11416 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11417 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11418 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11419 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11420 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11421 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11422 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11423 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11424 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11425 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11426 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11427 | 0 \ |
| 11428 | -s "fragmenting handshake message" |
| 11429 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11430 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11431 | ## 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] | 11432 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11433 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11434 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11435 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11436 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11437 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11438 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11439 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11440 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11441 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11442 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11443 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11444 | 0 \ |
| 11445 | -c "fragmenting handshake message" \ |
| 11446 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11447 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11448 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11449 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11450 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11451 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11452 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11453 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11454 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11455 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11456 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11457 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11458 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11459 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11460 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11461 | "$O_CLI -dtls1_2" \ |
| 11462 | 0 \ |
| 11463 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11464 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11465 | # Tests for DTLS-SRTP (RFC 5764) |
| 11466 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11468 | run_test "DTLS-SRTP all profiles supported" \ |
| 11469 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11470 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11471 | 0 \ |
| 11472 | -s "found use_srtp extension" \ |
| 11473 | -s "found srtp profile" \ |
| 11474 | -s "selected srtp profile" \ |
| 11475 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11476 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11477 | -c "client hello, adding use_srtp extension" \ |
| 11478 | -c "found use_srtp extension" \ |
| 11479 | -c "found srtp profile" \ |
| 11480 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11481 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11482 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11483 | -C "error" |
| 11484 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11485 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11486 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11488 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11489 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11490 | "$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] | 11491 | 0 \ |
| 11492 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11493 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11494 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11495 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11496 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11497 | -c "client hello, adding use_srtp extension" \ |
| 11498 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11499 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11500 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11501 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11502 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11503 | -C "error" |
| 11504 | |
| 11505 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11507 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11508 | "$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] | 11509 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11510 | 0 \ |
| 11511 | -s "found use_srtp extension" \ |
| 11512 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11513 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11514 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11515 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11516 | -c "client hello, adding use_srtp extension" \ |
| 11517 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11518 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11519 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11520 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11521 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11522 | -C "error" |
| 11523 | |
| 11524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11526 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11527 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11528 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11529 | 0 \ |
| 11530 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11531 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11532 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11533 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11534 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11535 | -c "client hello, adding use_srtp extension" \ |
| 11536 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11537 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11538 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11539 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11540 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11541 | -C "error" |
| 11542 | |
| 11543 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11545 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11546 | "$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] | 11547 | "$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] | 11548 | 0 \ |
| 11549 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11550 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11551 | -S "selected srtp profile" \ |
| 11552 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11553 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11554 | -c "client hello, adding use_srtp extension" \ |
| 11555 | -C "found use_srtp extension" \ |
| 11556 | -C "found srtp profile" \ |
| 11557 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11558 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11559 | -C "error" |
| 11560 | |
| 11561 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11563 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11564 | "$P_SRV dtls=1 debug_level=3" \ |
| 11565 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11566 | 0 \ |
| 11567 | -s "found use_srtp extension" \ |
| 11568 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11569 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11570 | -c "client hello, adding use_srtp extension" \ |
| 11571 | -C "found use_srtp extension" \ |
| 11572 | -C "found srtp profile" \ |
| 11573 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11574 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11575 | -C "error" |
| 11576 | |
| 11577 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11579 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11580 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11581 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11582 | 0 \ |
| 11583 | -s "found use_srtp extension" \ |
| 11584 | -s "found srtp profile" \ |
| 11585 | -s "selected srtp profile" \ |
| 11586 | -s "server hello, adding use_srtp extension" \ |
| 11587 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11588 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11589 | -c "client hello, adding use_srtp extension" \ |
| 11590 | -c "found use_srtp extension" \ |
| 11591 | -c "found srtp profile" \ |
| 11592 | -c "selected srtp profile" \ |
| 11593 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11594 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11595 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11596 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11597 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11598 | -C "error" |
| 11599 | |
| 11600 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11602 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11603 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11604 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11605 | 0 \ |
| 11606 | -s "found use_srtp extension" \ |
| 11607 | -s "found srtp profile" \ |
| 11608 | -s "selected srtp profile" \ |
| 11609 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11610 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11611 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11612 | -S "dumping 'using mki' (8 bytes)" \ |
| 11613 | -c "client hello, adding use_srtp extension" \ |
| 11614 | -c "found use_srtp extension" \ |
| 11615 | -c "found srtp profile" \ |
| 11616 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11617 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11618 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11619 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11620 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11621 | -C "dumping 'received mki' (8 bytes)" \ |
| 11622 | -C "error" |
| 11623 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11624 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11626 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11627 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11628 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11629 | 0 \ |
| 11630 | -s "found use_srtp extension" \ |
| 11631 | -s "found srtp profile" \ |
| 11632 | -s "selected srtp profile" \ |
| 11633 | -s "server hello, adding use_srtp extension" \ |
| 11634 | -s "DTLS-SRTP key material is"\ |
| 11635 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11636 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11637 | |
| 11638 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11640 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11641 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11642 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11643 | 0 \ |
| 11644 | -s "found use_srtp extension" \ |
| 11645 | -s "found srtp profile" \ |
| 11646 | -s "selected srtp profile" \ |
| 11647 | -s "server hello, adding use_srtp extension" \ |
| 11648 | -s "DTLS-SRTP key material is"\ |
| 11649 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11650 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11651 | |
| 11652 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11654 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11655 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11656 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11657 | 0 \ |
| 11658 | -s "found use_srtp extension" \ |
| 11659 | -s "found srtp profile" \ |
| 11660 | -s "selected srtp profile" \ |
| 11661 | -s "server hello, adding use_srtp extension" \ |
| 11662 | -s "DTLS-SRTP key material is"\ |
| 11663 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11664 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11665 | |
| 11666 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11668 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11669 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11670 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11671 | 0 \ |
| 11672 | -s "found use_srtp extension" \ |
| 11673 | -s "found srtp profile" \ |
| 11674 | -s "selected srtp profile" \ |
| 11675 | -s "server hello, adding use_srtp extension" \ |
| 11676 | -s "DTLS-SRTP key material is"\ |
| 11677 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11678 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11679 | |
| 11680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11682 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11683 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11684 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11685 | 0 \ |
| 11686 | -s "found use_srtp extension" \ |
| 11687 | -s "found srtp profile" \ |
| 11688 | -s "selected srtp profile" \ |
| 11689 | -s "server hello, adding use_srtp extension" \ |
| 11690 | -s "DTLS-SRTP key material is"\ |
| 11691 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11692 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11693 | |
| 11694 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11696 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11697 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11698 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11699 | 0 \ |
| 11700 | -s "found use_srtp extension" \ |
| 11701 | -s "found srtp profile" \ |
| 11702 | -S "selected srtp profile" \ |
| 11703 | -S "server hello, adding use_srtp extension" \ |
| 11704 | -S "DTLS-SRTP key material is"\ |
| 11705 | -C "SRTP Extension negotiated, profile" |
| 11706 | |
| 11707 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11709 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11710 | "$P_SRV dtls=1 debug_level=3" \ |
| 11711 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11712 | 0 \ |
| 11713 | -s "found use_srtp extension" \ |
| 11714 | -S "server hello, adding use_srtp extension" \ |
| 11715 | -S "DTLS-SRTP key material is"\ |
| 11716 | -C "SRTP Extension negotiated, profile" |
| 11717 | |
| 11718 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11720 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11721 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11722 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11723 | 0 \ |
| 11724 | -c "client hello, adding use_srtp extension" \ |
| 11725 | -c "found use_srtp extension" \ |
| 11726 | -c "found srtp profile" \ |
| 11727 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11728 | -c "DTLS-SRTP key material is"\ |
| 11729 | -C "error" |
| 11730 | |
| 11731 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11733 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11734 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11735 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11736 | 0 \ |
| 11737 | -c "client hello, adding use_srtp extension" \ |
| 11738 | -c "found use_srtp extension" \ |
| 11739 | -c "found srtp profile" \ |
| 11740 | -c "selected srtp profile" \ |
| 11741 | -c "DTLS-SRTP key material is"\ |
| 11742 | -C "error" |
| 11743 | |
| 11744 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11746 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11747 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11748 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11749 | 0 \ |
| 11750 | -c "client hello, adding use_srtp extension" \ |
| 11751 | -c "found use_srtp extension" \ |
| 11752 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11753 | -c "selected srtp profile" \ |
| 11754 | -c "DTLS-SRTP key material is"\ |
| 11755 | -C "error" |
| 11756 | |
| 11757 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11759 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11760 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11761 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11762 | 0 \ |
| 11763 | -c "client hello, adding use_srtp extension" \ |
| 11764 | -c "found use_srtp extension" \ |
| 11765 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11766 | -c "selected srtp profile" \ |
| 11767 | -c "DTLS-SRTP key material is"\ |
| 11768 | -C "error" |
| 11769 | |
| 11770 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11771 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11772 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11773 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11774 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11775 | 0 \ |
| 11776 | -c "client hello, adding use_srtp extension" \ |
| 11777 | -c "found use_srtp extension" \ |
| 11778 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11779 | -c "selected srtp profile" \ |
| 11780 | -c "DTLS-SRTP key material is"\ |
| 11781 | -C "error" |
| 11782 | |
| 11783 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11785 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11786 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11787 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11788 | 0 \ |
| 11789 | -c "client hello, adding use_srtp extension" \ |
| 11790 | -C "found use_srtp extension" \ |
| 11791 | -C "found srtp profile" \ |
| 11792 | -C "selected srtp profile" \ |
| 11793 | -C "DTLS-SRTP key material is"\ |
| 11794 | -C "error" |
| 11795 | |
| 11796 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11798 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11799 | "$O_SRV -dtls" \ |
| 11800 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11801 | 0 \ |
| 11802 | -c "client hello, adding use_srtp extension" \ |
| 11803 | -C "found use_srtp extension" \ |
| 11804 | -C "found srtp profile" \ |
| 11805 | -C "selected srtp profile" \ |
| 11806 | -C "DTLS-SRTP key material is"\ |
| 11807 | -C "error" |
| 11808 | |
| 11809 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11811 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11812 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11813 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11814 | 0 \ |
| 11815 | -c "client hello, adding use_srtp extension" \ |
| 11816 | -c "found use_srtp extension" \ |
| 11817 | -c "found srtp profile" \ |
| 11818 | -c "selected srtp profile" \ |
| 11819 | -c "DTLS-SRTP key material is"\ |
| 11820 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11821 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11822 | -C "dumping 'received mki' (8 bytes)" \ |
| 11823 | -C "error" |
| 11824 | |
| 11825 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11826 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11828 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11829 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11830 | "$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] | 11831 | 0 \ |
| 11832 | -s "found use_srtp extension" \ |
| 11833 | -s "found srtp profile" \ |
| 11834 | -s "selected srtp profile" \ |
| 11835 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11836 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11837 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11838 | |
| 11839 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11840 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11842 | 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] | 11843 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11844 | "$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] | 11845 | 0 \ |
| 11846 | -s "found use_srtp extension" \ |
| 11847 | -s "found srtp profile" \ |
| 11848 | -s "selected srtp profile" \ |
| 11849 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11850 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11851 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11852 | |
| 11853 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11854 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11856 | 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] | 11857 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11858 | "$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] | 11859 | 0 \ |
| 11860 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11861 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11862 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11863 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11864 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11865 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11866 | |
| 11867 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11868 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11870 | 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] | 11871 | "$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] | 11872 | "$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] | 11873 | 0 \ |
| 11874 | -s "found use_srtp extension" \ |
| 11875 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11876 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11877 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11878 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11879 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11880 | |
| 11881 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11882 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11884 | 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] | 11885 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11886 | "$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] | 11887 | 0 \ |
| 11888 | -s "found use_srtp extension" \ |
| 11889 | -s "found srtp profile" \ |
| 11890 | -s "selected srtp profile" \ |
| 11891 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11892 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11893 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11894 | |
| 11895 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11896 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11898 | 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] | 11899 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11900 | "$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] | 11901 | 0 \ |
| 11902 | -s "found use_srtp extension" \ |
| 11903 | -s "found srtp profile" \ |
| 11904 | -S "selected srtp profile" \ |
| 11905 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11906 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11907 | -C "SRTP profile:" |
| 11908 | |
| 11909 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11910 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11912 | 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] | 11913 | "$P_SRV dtls=1 debug_level=3" \ |
| 11914 | "$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] | 11915 | 0 \ |
| 11916 | -s "found use_srtp extension" \ |
| 11917 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11918 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11919 | -C "SRTP profile:" |
| 11920 | |
| 11921 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11922 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11924 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11925 | "$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" \ |
| 11926 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11927 | 0 \ |
| 11928 | -c "client hello, adding use_srtp extension" \ |
| 11929 | -c "found use_srtp extension" \ |
| 11930 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11931 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11932 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11933 | -C "error" |
| 11934 | |
| 11935 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11936 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11938 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11939 | "$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" \ |
| 11940 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11941 | 0 \ |
| 11942 | -c "client hello, adding use_srtp extension" \ |
| 11943 | -c "found use_srtp extension" \ |
| 11944 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11945 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11946 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11947 | -C "error" |
| 11948 | |
| 11949 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11950 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11951 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11952 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11953 | "$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" \ |
| 11954 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11955 | 0 \ |
| 11956 | -c "client hello, adding use_srtp extension" \ |
| 11957 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11958 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11959 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11960 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11961 | -C "error" |
| 11962 | |
| 11963 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11964 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11966 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11967 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11968 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11969 | 0 \ |
| 11970 | -c "client hello, adding use_srtp extension" \ |
| 11971 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11972 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11973 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11974 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11975 | -C "error" |
| 11976 | |
| 11977 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11978 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11980 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11981 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11982 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11983 | 0 \ |
| 11984 | -c "client hello, adding use_srtp extension" \ |
| 11985 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11986 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11987 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11988 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11989 | -C "error" |
| 11990 | |
| 11991 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11992 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11994 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11995 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11996 | "$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] | 11997 | 0 \ |
| 11998 | -c "client hello, adding use_srtp extension" \ |
| 11999 | -C "found use_srtp extension" \ |
| 12000 | -C "found srtp profile" \ |
| 12001 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 12002 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12003 | -C "error" |
| 12004 | |
| 12005 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 12006 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12008 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 12009 | "$G_SRV -u" \ |
| 12010 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 12011 | 0 \ |
| 12012 | -c "client hello, adding use_srtp extension" \ |
| 12013 | -C "found use_srtp extension" \ |
| 12014 | -C "found srtp profile" \ |
| 12015 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 12016 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12017 | -C "error" |
| 12018 | |
| 12019 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 12020 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12022 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 12023 | "$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" \ |
| 12024 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 12025 | 0 \ |
| 12026 | -c "client hello, adding use_srtp extension" \ |
| 12027 | -c "found use_srtp extension" \ |
| 12028 | -c "found srtp profile" \ |
| 12029 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 12030 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 12031 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 12032 | -c "dumping 'sending mki' (8 bytes)" \ |
| 12033 | -c "dumping 'received mki' (8 bytes)" \ |
| 12034 | -C "error" |
| 12035 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12036 | # Tests for specific things with "unreliable" UDP connection |
| 12037 | |
| 12038 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 12040 | run_test "DTLS proxy: reference" \ |
| 12041 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12042 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 12043 | "$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] | 12044 | 0 \ |
| 12045 | -C "replayed record" \ |
| 12046 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 12047 | -C "Buffer record from epoch" \ |
| 12048 | -S "Buffer record from epoch" \ |
| 12049 | -C "ssl_buffer_message" \ |
| 12050 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 12051 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12052 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12053 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12054 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 12055 | -c "HTTP/1.0 200 OK" |
| 12056 | |
| 12057 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12059 | run_test "DTLS proxy: duplicate every packet" \ |
| 12060 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 12061 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 12062 | "$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] | 12063 | 0 \ |
| 12064 | -c "replayed record" \ |
| 12065 | -s "replayed record" \ |
| 12066 | -c "record from another epoch" \ |
| 12067 | -s "record from another epoch" \ |
| 12068 | -S "resend" \ |
| 12069 | -s "Extra-header:" \ |
| 12070 | -c "HTTP/1.0 200 OK" |
| 12071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 12073 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 12074 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12075 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 12076 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12077 | 0 \ |
| 12078 | -c "replayed record" \ |
| 12079 | -S "replayed record" \ |
| 12080 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12081 | -s "record from another epoch" \ |
| 12082 | -c "resend" \ |
| 12083 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12084 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12085 | -c "HTTP/1.0 200 OK" |
| 12086 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12088 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 12089 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12090 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12091 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12092 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12093 | -c "next record in same datagram" \ |
| 12094 | -s "next record in same datagram" |
| 12095 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12097 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 12098 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12099 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 12100 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12101 | 0 \ |
| 12102 | -c "next record in same datagram" \ |
| 12103 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12104 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 12106 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 12107 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12108 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 12109 | "$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] | 12110 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12111 | -c "discarding invalid record (mac)" \ |
| 12112 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12113 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12114 | -c "HTTP/1.0 200 OK" \ |
| 12115 | -S "too many records with bad MAC" \ |
| 12116 | -S "Verification of the message MAC failed" |
| 12117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12119 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 12120 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12121 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 12122 | "$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] | 12123 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12124 | -C "discarding invalid record (mac)" \ |
| 12125 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12126 | -S "Extra-header:" \ |
| 12127 | -C "HTTP/1.0 200 OK" \ |
| 12128 | -s "too many records with bad MAC" \ |
| 12129 | -s "Verification of the message MAC failed" |
| 12130 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12132 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 12133 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12134 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 12135 | "$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] | 12136 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12137 | -c "discarding invalid record (mac)" \ |
| 12138 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12139 | -s "Extra-header:" \ |
| 12140 | -c "HTTP/1.0 200 OK" \ |
| 12141 | -S "too many records with bad MAC" \ |
| 12142 | -S "Verification of the message MAC failed" |
| 12143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12145 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 12146 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 12147 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 12148 | "$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] | 12149 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 12150 | -c "discarding invalid record (mac)" \ |
| 12151 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 12152 | -s "Extra-header:" \ |
| 12153 | -c "HTTP/1.0 200 OK" \ |
| 12154 | -s "too many records with bad MAC" \ |
| 12155 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12158 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 12159 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 12160 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 12161 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12162 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 12163 | -c "record from another epoch" \ |
| 12164 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12165 | -s "Extra-header:" \ |
| 12166 | -c "HTTP/1.0 200 OK" |
| 12167 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12168 | # Tests for reordering support with DTLS |
| 12169 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12170 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12172 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 12173 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12174 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12175 | hs_timeout=2500-60000" \ |
| 12176 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12177 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12178 | 0 \ |
| 12179 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12180 | -c "Next handshake message has been buffered - load"\ |
| 12181 | -S "Buffering HS message" \ |
| 12182 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12183 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12184 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12185 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12186 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12187 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12188 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12190 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12191 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12192 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12193 | hs_timeout=2500-60000" \ |
| 12194 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12195 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12196 | 0 \ |
| 12197 | -c "Buffering HS message" \ |
| 12198 | -c "found fragmented DTLS handshake message"\ |
| 12199 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12200 | -c "Next handshake message has been buffered - load"\ |
| 12201 | -S "Buffering HS message" \ |
| 12202 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12203 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12204 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12205 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12206 | -S "Remember CCS message" |
| 12207 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12208 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12209 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12210 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12211 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12212 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12213 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12215 | 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] | 12216 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12217 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12218 | hs_timeout=2500-60000" \ |
| 12219 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12220 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12221 | 0 \ |
| 12222 | -c "Buffering HS message" \ |
| 12223 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12224 | -C "attempt to make space by freeing buffered messages" \ |
| 12225 | -S "Buffering HS message" \ |
| 12226 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12227 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12228 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12229 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12230 | -S "Remember CCS message" |
| 12231 | |
| 12232 | # The size constraints ensure that the delayed certificate message can't |
| 12233 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12234 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12235 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12236 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12237 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12239 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12240 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12241 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12242 | hs_timeout=2500-60000" \ |
| 12243 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12244 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12245 | 0 \ |
| 12246 | -c "Buffering HS message" \ |
| 12247 | -c "attempt to make space by freeing buffered future messages" \ |
| 12248 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12249 | -S "Buffering HS message" \ |
| 12250 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12251 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12252 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12253 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12254 | -S "Remember CCS message" |
| 12255 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12256 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12258 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12259 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12260 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12261 | hs_timeout=2500-60000" \ |
| 12262 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12263 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12264 | 0 \ |
| 12265 | -C "Buffering HS message" \ |
| 12266 | -C "Next handshake message has been buffered - load"\ |
| 12267 | -s "Buffering HS message" \ |
| 12268 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12269 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12270 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12271 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12272 | -S "Remember CCS message" |
| 12273 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12274 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12276 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12277 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12278 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12279 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12280 | hs_timeout=2500-60000" \ |
| 12281 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12282 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12283 | 0 \ |
| 12284 | -C "Buffering HS message" \ |
| 12285 | -C "Next handshake message has been buffered - load"\ |
| 12286 | -S "Buffering HS message" \ |
| 12287 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12288 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12289 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12290 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12291 | -S "Remember CCS message" |
| 12292 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12293 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12295 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12296 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12297 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12298 | hs_timeout=2500-60000" \ |
| 12299 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12300 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12301 | 0 \ |
| 12302 | -C "Buffering HS message" \ |
| 12303 | -C "Next handshake message has been buffered - load"\ |
| 12304 | -S "Buffering HS message" \ |
| 12305 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12306 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12307 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12308 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12309 | -s "Remember CCS message" |
| 12310 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12312 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12313 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12314 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12315 | hs_timeout=2500-60000" \ |
| 12316 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12317 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12318 | 0 \ |
| 12319 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12320 | -s "Found buffered record from current epoch - load" \ |
| 12321 | -c "Buffer record from epoch 1" \ |
| 12322 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12323 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12324 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12325 | # from the server are delayed, so that the encrypted Finished message |
| 12326 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12327 | # in afterwards, the encrypted Finished message must be freed in order |
| 12328 | # to make space for the NewSessionTicket to be reassembled. |
| 12329 | # This works only in very particular circumstances: |
| 12330 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12331 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12332 | # the encrypted Finished message. |
| 12333 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12334 | # needs to be fragmented. |
| 12335 | # - All messages sent by the server must be small enough to be either sent |
| 12336 | # without fragmentation or be reassembled within the bounds of |
| 12337 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12338 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12339 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12340 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12341 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12342 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12343 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12344 | "$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] | 12345 | 0 \ |
| 12346 | -s "Buffer record from epoch 1" \ |
| 12347 | -s "Found buffered record from current epoch - load" \ |
| 12348 | -c "Buffer record from epoch 1" \ |
| 12349 | -C "Found buffered record from current epoch - load" \ |
| 12350 | -c "Enough space available after freeing future epoch record" |
| 12351 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12352 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12353 | |
| 12354 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12355 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12356 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Gilles Peskine | 4c1347c | 2024-09-07 19:50:46 +0200 | [diff] [blame] | 12357 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12358 | psk=73776f726466697368" \ |
| 12359 | "$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] | 12360 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12361 | 0 \ |
| 12362 | -s "Extra-header:" \ |
| 12363 | -c "HTTP/1.0 200 OK" |
| 12364 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12365 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12366 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12367 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12368 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12369 | "$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] | 12370 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12371 | 0 \ |
| 12372 | -s "Extra-header:" \ |
| 12373 | -c "HTTP/1.0 200 OK" |
| 12374 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12375 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12377 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12378 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12379 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12380 | "$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] | 12381 | 0 \ |
| 12382 | -s "Extra-header:" \ |
| 12383 | -c "HTTP/1.0 200 OK" |
| 12384 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12385 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12387 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12388 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12389 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12390 | "$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] | 12391 | 0 \ |
| 12392 | -s "Extra-header:" \ |
| 12393 | -c "HTTP/1.0 200 OK" |
| 12394 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12395 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12397 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12398 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12399 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12400 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12401 | "$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] | 12402 | 0 \ |
| 12403 | -s "Extra-header:" \ |
| 12404 | -c "HTTP/1.0 200 OK" |
| 12405 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12406 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12408 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12409 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12410 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12411 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12412 | "$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] | 12413 | 0 \ |
| 12414 | -s "Extra-header:" \ |
| 12415 | -c "HTTP/1.0 200 OK" |
| 12416 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12417 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12419 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12420 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12421 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12422 | "$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] | 12423 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12424 | "$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] | 12425 | 0 \ |
| 12426 | -s "Extra-header:" \ |
| 12427 | -c "HTTP/1.0 200 OK" |
| 12428 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12429 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12430 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12431 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12432 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12433 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12434 | psk=73776f726466697368 debug_level=3" \ |
| 12435 | "$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] | 12436 | 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] | 12437 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12438 | 0 \ |
| 12439 | -s "a session has been resumed" \ |
| 12440 | -c "a session has been resumed" \ |
| 12441 | -s "Extra-header:" \ |
| 12442 | -c "HTTP/1.0 200 OK" |
| 12443 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12444 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12445 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12446 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12447 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12448 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12449 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12450 | "$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] | 12451 | 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] | 12452 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12453 | 0 \ |
| 12454 | -s "a session has been resumed" \ |
| 12455 | -c "a session has been resumed" \ |
| 12456 | -s "Extra-header:" \ |
| 12457 | -c "HTTP/1.0 200 OK" |
| 12458 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12459 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12461 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12462 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12463 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12464 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12465 | "$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] | 12466 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12467 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12468 | 0 \ |
| 12469 | -c "=> renegotiate" \ |
| 12470 | -s "=> renegotiate" \ |
| 12471 | -s "Extra-header:" \ |
| 12472 | -c "HTTP/1.0 200 OK" |
| 12473 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12474 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12476 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12477 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12478 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12479 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12480 | "$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] | 12481 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12482 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12483 | 0 \ |
| 12484 | -c "=> renegotiate" \ |
| 12485 | -s "=> renegotiate" \ |
| 12486 | -s "Extra-header:" \ |
| 12487 | -c "HTTP/1.0 200 OK" |
| 12488 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12489 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12491 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12492 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12493 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12494 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12495 | debug_level=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12496 | "$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] | 12497 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12498 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12499 | 0 \ |
| 12500 | -c "=> renegotiate" \ |
| 12501 | -s "=> renegotiate" \ |
| 12502 | -s "Extra-header:" \ |
| 12503 | -c "HTTP/1.0 200 OK" |
| 12504 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12505 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12506 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12507 | 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] | 12508 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12509 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12510 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12511 | debug_level=2 nbio=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12512 | "$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] | 12513 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12514 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12515 | 0 \ |
| 12516 | -c "=> renegotiate" \ |
| 12517 | -s "=> renegotiate" \ |
| 12518 | -s "Extra-header:" \ |
| 12519 | -c "HTTP/1.0 200 OK" |
| 12520 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12521 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12522 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12523 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12524 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12525 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12526 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12528 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12529 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12530 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12531 | "$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] | 12532 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12533 | -c "HTTP/1.0 200 OK" |
| 12534 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12535 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12536 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12537 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12539 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12540 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12541 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12542 | "$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] | 12543 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12544 | -c "HTTP/1.0 200 OK" |
| 12545 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12546 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12547 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12548 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12550 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12551 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12552 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12553 | "$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] | 12554 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12555 | -c "HTTP/1.0 200 OK" |
| 12556 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12557 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12558 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12559 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12561 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12562 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12563 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12564 | "$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] | 12565 | 0 \ |
| 12566 | -s "Extra-header:" \ |
| 12567 | -c "Extra-header:" |
| 12568 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12569 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12570 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12571 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12573 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12574 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12575 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12576 | "$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] | 12577 | 0 \ |
| 12578 | -s "Extra-header:" \ |
| 12579 | -c "Extra-header:" |
| 12580 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12581 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12582 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12583 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12585 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12586 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12587 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12588 | "$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] | 12589 | 0 \ |
| 12590 | -s "Extra-header:" \ |
| 12591 | -c "Extra-header:" |
| 12592 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12594 | run_test "export keys functionality" \ |
| 12595 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12596 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12597 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12598 | -c "EAP-TLS key material is:"\ |
| 12599 | -s "EAP-TLS key material is:"\ |
| 12600 | -c "EAP-TLS IV is:" \ |
| 12601 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12602 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12603 | # openssl feature tests: check if tls1.3 exists. |
| 12604 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12605 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12606 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12607 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12608 | 0 \ |
| 12609 | -c "TLS 1.3" \ |
| 12610 | -s "TLS 1.3" |
| 12611 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12612 | # 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] | 12613 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12614 | requires_gnutls_next_no_ticket |
| 12615 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12616 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12617 | "$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] | 12618 | "$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] | 12619 | 0 \ |
| 12620 | -s "Version: TLS1.3" \ |
| 12621 | -c "Version: TLS1.3" |
| 12622 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12623 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12625 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12626 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12627 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12628 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12629 | run_test "TLS 1.3: Default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12630 | "$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] | 12631 | "$P_CLI allow_sha1=0" \ |
| 12632 | 0 \ |
| 12633 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12634 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12635 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12636 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12637 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12640 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12641 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12642 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12643 | "$P_SRV" \ |
| 12644 | "( $P_CLI force_version=tls12; \ |
| 12645 | $P_CLI force_version=tls13 )" \ |
| 12646 | 0 \ |
| 12647 | -s "Protocol is TLSv1.2" \ |
| 12648 | -s "Protocol is TLSv1.3" \ |
| 12649 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12652 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12653 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12654 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12655 | "$P_SRV" \ |
| 12656 | "( $P_CLI force_version=tls13; \ |
| 12657 | $P_CLI force_version=tls12 )" \ |
| 12658 | 0 \ |
| 12659 | -s "Protocol is TLSv1.3" \ |
| 12660 | -s "Protocol is TLSv1.2" \ |
| 12661 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12662 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12663 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12664 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12665 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12666 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12667 | "$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] | 12668 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12669 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12670 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12671 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12672 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12673 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12674 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12675 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12676 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12677 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12678 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12679 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12680 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12681 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12682 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12683 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12684 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12685 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12686 | -c "=> parse certificate verify" \ |
| 12687 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12688 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12689 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12690 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12691 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12692 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12693 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12694 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12695 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12696 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12697 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12698 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12699 | "$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] | 12700 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12701 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12702 | -s "SERVER HELLO was queued" \ |
| 12703 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12704 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12705 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12706 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12707 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12708 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12709 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12710 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12711 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12712 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12713 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12714 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12715 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12716 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12717 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12718 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12719 | -c "=> parse certificate verify" \ |
| 12720 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12721 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12722 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12723 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12724 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12725 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12726 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12727 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12728 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12729 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12730 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12731 | run_test "TLS 1.3: alpn - openssl" \ |
| 12732 | "$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] | 12733 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12734 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12735 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12736 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12737 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12738 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12739 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12740 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12741 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12742 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12743 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12744 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12745 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12746 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12747 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12748 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12749 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12750 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12751 | -c "=> parse certificate verify" \ |
| 12752 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12753 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12754 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12755 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12756 | -c "HTTP/1.0 200 ok" \ |
| 12757 | -c "Application Layer Protocol is h2" |
| 12758 | |
| 12759 | requires_gnutls_tls1_3 |
| 12760 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12761 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12762 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12763 | requires_config_enabled MBEDTLS_SSL_ALPN |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12764 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12765 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12766 | "$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] | 12767 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12768 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12769 | -s "SERVER HELLO was queued" \ |
| 12770 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12771 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12772 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12773 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12774 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12775 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12776 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12777 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12778 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12779 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12780 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12781 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12782 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12783 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12784 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12785 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12786 | -c "=> parse certificate verify" \ |
| 12787 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12788 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12789 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12790 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12791 | -c "HTTP/1.0 200 OK" \ |
| 12792 | -c "Application Layer Protocol is h2" |
| 12793 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12794 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12795 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12796 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12797 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12798 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12799 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12800 | "$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] | 12801 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12802 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12803 | -s "found alpn extension" \ |
| 12804 | -s "server side, adding alpn extension" \ |
| 12805 | -s "Protocol is TLSv1.3" \ |
| 12806 | -s "HTTP/1.0 200 OK" \ |
| 12807 | -s "Application Layer Protocol is h2" |
| 12808 | |
| 12809 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12810 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12811 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12812 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12813 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12814 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12815 | "$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] | 12816 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12817 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12818 | -s "found alpn extension" \ |
| 12819 | -s "server side, adding alpn extension" \ |
| 12820 | -s "Protocol is TLSv1.3" \ |
| 12821 | -s "HTTP/1.0 200 OK" \ |
| 12822 | -s "Application Layer Protocol is h2" |
| 12823 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12824 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12825 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12826 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12827 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12828 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12829 | "$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] | 12830 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12831 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12832 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12833 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12834 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12835 | -c "HTTP/1.0 200 ok" \ |
| 12836 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12837 | |
| 12838 | requires_gnutls_tls1_3 |
| 12839 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12840 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12841 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12842 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12843 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12844 | "$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] | 12845 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12846 | 0 \ |
| 12847 | -c "got a certificate request" \ |
| 12848 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12849 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12850 | -c "HTTP/1.0 200 OK" \ |
| 12851 | -c "Protocol is TLSv1.3" |
| 12852 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12853 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12854 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12855 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12856 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12857 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12858 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12859 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12860 | "$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] | 12861 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12862 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12863 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12864 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12865 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12866 | |
| 12867 | requires_gnutls_tls1_3 |
| 12868 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12869 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12870 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12871 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12872 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12873 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12874 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12875 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12876 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12877 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12878 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12879 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12880 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12881 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12882 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12883 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12884 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12885 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12886 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12887 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12888 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12889 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12890 | 0 \ |
| 12891 | -c "got a certificate request" \ |
| 12892 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12893 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12894 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12895 | |
| 12896 | requires_gnutls_tls1_3 |
| 12897 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12898 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12899 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12900 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12901 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12902 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12903 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12904 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12905 | 0 \ |
| 12906 | -c "got a certificate request" \ |
| 12907 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12908 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12909 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12910 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12911 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12912 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12913 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12914 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12915 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12916 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12917 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12918 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12919 | 0 \ |
| 12920 | -c "got a certificate request" \ |
| 12921 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12922 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12923 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12924 | |
| 12925 | requires_gnutls_tls1_3 |
| 12926 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12927 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12928 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12929 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12930 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12931 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12932 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12933 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12934 | 0 \ |
| 12935 | -c "got a certificate request" \ |
| 12936 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12937 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12938 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12939 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12940 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12941 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12942 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12943 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12944 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12945 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12946 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12947 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12948 | 0 \ |
| 12949 | -c "got a certificate request" \ |
| 12950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12952 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12953 | |
| 12954 | requires_gnutls_tls1_3 |
| 12955 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12956 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12957 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12958 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12959 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12960 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12961 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12962 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12963 | 0 \ |
| 12964 | -c "got a certificate request" \ |
| 12965 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12966 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12967 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12968 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12969 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12970 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12971 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12972 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12973 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12974 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12975 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12976 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12977 | 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] | 12978 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12979 | -c "got a certificate request" \ |
| 12980 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12981 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12982 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12983 | |
| 12984 | requires_gnutls_tls1_3 |
| 12985 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12986 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12987 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12988 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 12989 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12990 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12991 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12992 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12993 | 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] | 12994 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12995 | -c "got a certificate request" \ |
| 12996 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12997 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12998 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12999 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13000 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13001 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13002 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13003 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13004 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13005 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 13006 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13007 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13008 | 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] | 13009 | 0 \ |
| 13010 | -c "got a certificate request" \ |
| 13011 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13012 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13013 | -c "Protocol is TLSv1.3" |
| 13014 | |
| 13015 | requires_gnutls_tls1_3 |
| 13016 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13017 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13018 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13019 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13020 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13021 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 13022 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13023 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13024 | 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] | 13025 | 0 \ |
| 13026 | -c "got a certificate request" \ |
| 13027 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13028 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13029 | -c "Protocol is TLSv1.3" |
| 13030 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13031 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13032 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13033 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13034 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13035 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13036 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 13037 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13038 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13039 | 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] | 13040 | 0 \ |
| 13041 | -c "got a certificate request" \ |
| 13042 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13043 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13044 | -c "Protocol is TLSv1.3" |
| 13045 | |
| 13046 | requires_gnutls_tls1_3 |
| 13047 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13049 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13050 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13051 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13052 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 13053 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13054 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13055 | 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] | 13056 | 0 \ |
| 13057 | -c "got a certificate request" \ |
| 13058 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13059 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13060 | -c "Protocol is TLSv1.3" |
| 13061 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13062 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 13063 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13065 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13066 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 13067 | 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] | 13068 | "$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] | 13069 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13070 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13071 | 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] | 13072 | 1 \ |
| 13073 | -c "got a certificate request" \ |
| 13074 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13075 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13076 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13077 | |
| 13078 | requires_gnutls_tls1_3 |
| 13079 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13080 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13081 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13082 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13083 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 13084 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 13085 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13086 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13087 | 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] | 13088 | 1 \ |
| 13089 | -c "got a certificate request" \ |
| 13090 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13091 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13092 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 13093 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13094 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13095 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13096 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13097 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13098 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13099 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13100 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 13101 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13102 | "$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] | 13103 | 0 \ |
| 13104 | -c "got a certificate request" \ |
| 13105 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13106 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13107 | -c "Protocol is TLSv1.3" |
| 13108 | |
| 13109 | requires_gnutls_tls1_3 |
| 13110 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13111 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13112 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13113 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13114 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13115 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 13116 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13117 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 13118 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13119 | 0 \ |
| 13120 | -c "got a certificate request" \ |
| 13121 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13122 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13123 | -c "Protocol is TLSv1.3" |
| 13124 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13125 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13127 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13128 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13129 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13130 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 13131 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13132 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13133 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13134 | 0 \ |
| 13135 | -c "got a certificate request" \ |
| 13136 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13137 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13138 | -c "Protocol is TLSv1.3" |
| 13139 | |
| 13140 | requires_gnutls_tls1_3 |
| 13141 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13142 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13143 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13144 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13145 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13146 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 13147 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13148 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 13149 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13150 | 0 \ |
| 13151 | -c "got a certificate request" \ |
| 13152 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13153 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13154 | -c "Protocol is TLSv1.3" |
| 13155 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13156 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13157 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13158 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13159 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13160 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13161 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 13162 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13163 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13164 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13165 | 0 \ |
| 13166 | -c "got a certificate request" \ |
| 13167 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13168 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13169 | -c "Protocol is TLSv1.3" |
| 13170 | |
| 13171 | requires_gnutls_tls1_3 |
| 13172 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13173 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13174 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13176 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13177 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13178 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13179 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13180 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13181 | 0 \ |
| 13182 | -c "got a certificate request" \ |
| 13183 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13184 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13185 | -c "Protocol is TLSv1.3" |
| 13186 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13187 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13188 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13189 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13190 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13191 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13192 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13193 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13194 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13195 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13196 | 0 \ |
| 13197 | -c "got a certificate request" \ |
| 13198 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13199 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13200 | -c "Protocol is TLSv1.3" |
| 13201 | |
| 13202 | requires_gnutls_tls1_3 |
| 13203 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13204 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13205 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13206 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13207 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13208 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13209 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13210 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13211 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13212 | 0 \ |
| 13213 | -c "got a certificate request" \ |
| 13214 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13215 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13216 | -c "Protocol is TLSv1.3" |
| 13217 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13218 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13219 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13220 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13221 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13222 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13223 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13224 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13225 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13226 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13227 | 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] | 13228 | 0 \ |
| 13229 | -c "got a certificate request" \ |
| 13230 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13231 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13232 | -c "Protocol is TLSv1.3" |
| 13233 | |
| 13234 | requires_gnutls_tls1_3 |
| 13235 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13236 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13237 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13238 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13239 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13240 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13241 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13242 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13243 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13244 | 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] | 13245 | 0 \ |
| 13246 | -c "got a certificate request" \ |
| 13247 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13248 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13249 | -c "Protocol is TLSv1.3" |
| 13250 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13251 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13252 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13253 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13254 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13255 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13256 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13257 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13258 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13259 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13260 | 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] | 13261 | 0 \ |
| 13262 | -c "got a certificate request" \ |
| 13263 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13264 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13265 | -c "Protocol is TLSv1.3" |
| 13266 | |
| 13267 | requires_gnutls_tls1_3 |
| 13268 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13269 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13270 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13271 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13273 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13274 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13275 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13276 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13277 | 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] | 13278 | 0 \ |
| 13279 | -c "got a certificate request" \ |
| 13280 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13281 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13282 | -c "Protocol is TLSv1.3" |
| 13283 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13284 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13285 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13286 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13287 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13288 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13289 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13290 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13291 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13292 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13293 | 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] | 13294 | 0 \ |
| 13295 | -c "got a certificate request" \ |
| 13296 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13297 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13298 | -c "Protocol is TLSv1.3" |
| 13299 | |
| 13300 | requires_gnutls_tls1_3 |
| 13301 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13302 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13303 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13304 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13305 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13306 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13307 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13308 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13309 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13310 | 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] | 13311 | 0 \ |
| 13312 | -c "got a certificate request" \ |
| 13313 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13314 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13315 | -c "Protocol is TLSv1.3" |
| 13316 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13317 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13320 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13321 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13322 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13323 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13324 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13325 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13326 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13327 | 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] | 13328 | 1 \ |
| 13329 | -c "got a certificate request" \ |
| 13330 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13331 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13332 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13333 | |
| 13334 | requires_gnutls_tls1_3 |
| 13335 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13336 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13337 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13338 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13339 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13340 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13341 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13342 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13343 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13344 | 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] | 13345 | 1 \ |
| 13346 | -c "got a certificate request" \ |
| 13347 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13348 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13349 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13350 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13351 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13352 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13353 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13354 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13355 | 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] | 13356 | "$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] | 13357 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13358 | 0 \ |
| 13359 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13360 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13361 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13362 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13363 | -c "HTTP/1.0 200 ok" |
| 13364 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13365 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13366 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13367 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13368 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13369 | 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] | 13370 | "$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] | 13371 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13372 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13373 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13374 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13375 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13376 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13377 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13378 | |
| 13379 | requires_gnutls_tls1_3 |
| 13380 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13381 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13382 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13383 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13384 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13385 | 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] | 13386 | "$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] | 13387 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13388 | 0 \ |
| 13389 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13390 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13391 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13392 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13393 | -c "HTTP/1.0 200 OK" |
| 13394 | |
| 13395 | requires_gnutls_tls1_3 |
| 13396 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13397 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13398 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13399 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13400 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13401 | 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] | 13402 | "$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] | 13403 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13404 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13405 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13406 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13407 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13408 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13409 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13410 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13411 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13412 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13413 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13415 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13416 | "$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] | 13417 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13418 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13419 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13420 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13421 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13422 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13423 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13424 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13425 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13426 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13427 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13428 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13429 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13430 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13431 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13432 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13433 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13434 | "$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] | 13435 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13436 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13437 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13438 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13439 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13440 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13441 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13442 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13443 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13444 | -s "=> parse client hello" \ |
| 13445 | -s "<= parse client hello" |
| 13446 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13447 | requires_gnutls_tls1_3 |
| 13448 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13449 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13451 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13452 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13453 | "$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] | 13454 | "$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] | 13455 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13456 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13457 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13458 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13459 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13460 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13461 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13462 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13463 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13464 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13465 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13466 | requires_gnutls_tls1_3 |
| 13467 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13468 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13469 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13470 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13471 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13472 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13473 | "$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] | 13474 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13475 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13476 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13477 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13478 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13479 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13480 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13481 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13482 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13483 | -s "=> parse client hello" \ |
| 13484 | -s "<= parse client hello" |
| 13485 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13486 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13487 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13488 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13489 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13490 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13491 | "$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] | 13492 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13493 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13494 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13495 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13496 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13497 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13498 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13499 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13500 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13501 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13502 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13503 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13504 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13505 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13506 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13507 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13508 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13509 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13510 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13511 | "$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] | 13512 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13513 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13514 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13515 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13516 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13517 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13518 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13519 | -s "=> parse client hello" \ |
| 13520 | -s "<= parse client hello" |
| 13521 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13522 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13523 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13524 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13525 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13526 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13527 | "$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] | 13528 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13529 | 1 \ |
| 13530 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13531 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13532 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13533 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13534 | -s "=> write certificate request" \ |
| 13535 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13536 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13537 | -s "=> parse client hello" \ |
| 13538 | -s "<= parse client hello" |
| 13539 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13540 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13541 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13542 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13543 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13544 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13545 | "$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] | 13546 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13547 | 0 \ |
| 13548 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13549 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13550 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13551 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13552 | -s "=> write certificate request" \ |
| 13553 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13554 | -s "=> parse client hello" \ |
| 13555 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13556 | |
| 13557 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13558 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13559 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13560 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13561 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13562 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13563 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13564 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13565 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13566 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13567 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13568 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13569 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13570 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13571 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13572 | -s "=> write hello retry request" \ |
| 13573 | -s "<= write hello retry request" |
| 13574 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13575 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13576 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13577 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13578 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13579 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13580 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13581 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13582 | 1 \ |
| 13583 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13584 | -s "No certificate available." |
| 13585 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13586 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13587 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13588 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13589 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13590 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13591 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13592 | 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,-,-,-" \ |
| 13593 | "$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] | 13594 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13595 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13596 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13597 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13598 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13599 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13600 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13601 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13602 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13603 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13604 | 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,-,-,-" \ |
| 13605 | "$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] | 13606 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13607 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13608 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13609 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13610 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13611 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13612 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13613 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13614 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13615 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13616 | 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,-,-,-" \ |
| 13617 | "$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] | 13618 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13619 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13620 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13621 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13622 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13623 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13624 | TEST_SUITE_NAME=${i##*/} |
| 13625 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13626 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13627 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13628 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13629 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13630 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13631 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13633 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13634 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13635 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13636 | 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] | 13637 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13638 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13639 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13640 | -s "Protocol is TLSv1.3" \ |
| 13641 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13642 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13643 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13644 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13645 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13646 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13647 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13648 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13649 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13650 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13651 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13652 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13653 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13654 | -s "Protocol is TLSv1.3" \ |
| 13655 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13656 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13657 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13658 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13659 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13660 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13661 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13662 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13663 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13664 | 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] | 13665 | "$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] | 13666 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13667 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13668 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13669 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13670 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13671 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13672 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13673 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13674 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13675 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13676 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13677 | 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] | 13678 | "$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] | 13679 | "$P_CLI debug_level=4" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13680 | 0 \ |
| 13681 | -c "Protocol is TLSv1.3" \ |
| 13682 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13683 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13684 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13685 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13686 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13687 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13689 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13690 | "$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] | 13691 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13692 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13693 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13694 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13695 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13696 | requires_gnutls_tls1_3 |
| 13697 | requires_gnutls_next_no_ticket |
| 13698 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13699 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13700 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13701 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13702 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13703 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13704 | "$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] | 13705 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13706 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13707 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13708 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13709 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13710 | |
| 13711 | requires_gnutls_tls1_3 |
| 13712 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13713 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13714 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13715 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13716 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13717 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13718 | "$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] | 13719 | "$P_CLI debug_level=4" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13720 | 0 \ |
| 13721 | -c "Protocol is TLSv1.3" \ |
| 13722 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13723 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13724 | requires_gnutls_tls1_3 |
| 13725 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13726 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13727 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13728 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13729 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13730 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13731 | "$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] | 13732 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13733 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13734 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13735 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13736 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13737 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13738 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13740 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13741 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13742 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13743 | "$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] | 13744 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13745 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13746 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13747 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13748 | -C "14 03 03 00 01" |
| 13749 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13750 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13751 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13752 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13753 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13754 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13755 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13756 | "$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] | 13757 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13758 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13759 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13760 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13761 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13762 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13763 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13764 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13765 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13766 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13767 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13768 | "$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] | 13769 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13770 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13771 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13772 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13773 | -c "14 03 03 00 01" |
| 13774 | |
| 13775 | requires_gnutls_tls1_3 |
| 13776 | requires_gnutls_next_no_ticket |
| 13777 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13778 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13779 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13780 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13781 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13782 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13783 | "$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] | 13784 | "$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] | 13785 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13786 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13787 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13788 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13789 | |
| 13790 | requires_gnutls_tls1_3 |
| 13791 | requires_gnutls_next_no_ticket |
| 13792 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13793 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13794 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13795 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13796 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13797 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13798 | "$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] | 13799 | "$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] | 13800 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13801 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13802 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13803 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13804 | -c "discarding change cipher spec in TLS1.3" |
| 13805 | |
| 13806 | requires_gnutls_tls1_3 |
| 13807 | requires_gnutls_next_no_ticket |
| 13808 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13809 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13810 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13811 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13812 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13813 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13814 | "$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] | 13815 | "$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] | 13816 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13817 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13818 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13819 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13820 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13821 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13822 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13823 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13824 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13825 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13826 | 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] | 13827 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13828 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13829 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13830 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13831 | -c "Protocol is TLSv1.3" \ |
| 13832 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13833 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13834 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13835 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13836 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13837 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13838 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13839 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13840 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13841 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13842 | 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] | 13843 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13844 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13845 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13846 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13847 | -c "Protocol is TLSv1.3" \ |
| 13848 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13849 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13850 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13851 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13852 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13853 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13854 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13855 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13856 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13857 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13858 | "$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] | 13859 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13860 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13861 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13862 | -c "received HelloRetryRequest message" \ |
| 13863 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13864 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13865 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13866 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13867 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13870 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13871 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13872 | "$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] | 13873 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13874 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13875 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13876 | -c "Protocol is TLSv1.3" \ |
| 13877 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13878 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13879 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13880 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13881 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13882 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13883 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13884 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13885 | "$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] | 13886 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13887 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13888 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13889 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13890 | |
| 13891 | requires_gnutls_tls1_3 |
| 13892 | requires_gnutls_next_no_ticket |
| 13893 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13894 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13895 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13896 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13897 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13898 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13899 | "$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] | 13900 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13901 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13902 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13903 | -c "received HelloRetryRequest message" \ |
| 13904 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13905 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13906 | |
| 13907 | requires_gnutls_tls1_3 |
| 13908 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13909 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13910 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13911 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13912 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13913 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13914 | "$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] | 13915 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13916 | 0 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13917 | -c "received HelloRetryRequest message" \ |
Gilles Peskine | fc3accd | 2024-09-13 13:46:37 +0200 | [diff] [blame] | 13918 | -c "Protocol is TLSv1.3" \ |
| 13919 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13920 | |
| 13921 | requires_gnutls_tls1_3 |
| 13922 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13923 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13924 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13925 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13926 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13927 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13928 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13929 | "$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] | 13930 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13931 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13932 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13933 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13934 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13935 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13936 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13937 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13938 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13939 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13940 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13941 | "$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] | 13942 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13943 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13944 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13945 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13946 | -C "14 03 03 00 01" |
| 13947 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13948 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13949 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13950 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13951 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13952 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13953 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13954 | "$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] | 13955 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13956 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13957 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13958 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13959 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13960 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13961 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13962 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13963 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13964 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13965 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13966 | "$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] | 13967 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13968 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13969 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13970 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13971 | -c "14 03 03 00 01" |
| 13972 | |
| 13973 | requires_gnutls_tls1_3 |
| 13974 | requires_gnutls_next_no_ticket |
| 13975 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13976 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13978 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13979 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13980 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13981 | "$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] | 13982 | "$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] | 13983 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13984 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13985 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13986 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13987 | |
| 13988 | requires_gnutls_tls1_3 |
| 13989 | requires_gnutls_next_no_ticket |
| 13990 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13991 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13992 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13993 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 13994 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13995 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13996 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13997 | "$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] | 13998 | "$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] | 13999 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 14000 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 14001 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 14002 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 14003 | -c "discarding change cipher spec in TLS1.3" |
| 14004 | |
| 14005 | requires_gnutls_tls1_3 |
| 14006 | requires_gnutls_next_no_ticket |
| 14007 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 14008 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14009 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 14010 | requires_config_enabled PSA_WANT_ALG_ECDH |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14011 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14012 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 14013 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14014 | "$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] | 14015 | "$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] | 14016 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 14017 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 14018 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 14019 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 14020 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14021 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14022 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14023 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14024 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14025 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14026 | "$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] | 14027 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14028 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14029 | "$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] | 14030 | 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] | 14031 | 0 \ |
| 14032 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14033 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14034 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14035 | |
| 14036 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14037 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14038 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14039 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14040 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14041 | "$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] | 14042 | -d 4 |
| 14043 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14044 | "$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] | 14045 | 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] | 14046 | 0 \ |
| 14047 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14048 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14049 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14050 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14051 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14052 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14053 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14054 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14055 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14056 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14057 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14058 | 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] | 14059 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14060 | "$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] | 14061 | 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] | 14062 | 0 \ |
| 14063 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14064 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 14065 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14066 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 14067 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14068 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14069 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14070 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14071 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14072 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14073 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14074 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14075 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14076 | 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] | 14077 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14078 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14079 | -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] | 14080 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 14081 | 0 \ |
| 14082 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14083 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14084 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14085 | |
| 14086 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14087 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14088 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14089 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14090 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14091 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14092 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14093 | 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] | 14094 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14095 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14096 | --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] | 14097 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 14098 | 0 \ |
| 14099 | -c "Negotiated version: 3.4" \ |
| 14100 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14101 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14102 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 14103 | |
| 14104 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14105 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14106 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14107 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14108 | 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] | 14109 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14110 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14111 | 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] | 14112 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14113 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14114 | --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] | 14115 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 14116 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14117 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14118 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14119 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14120 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14121 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14122 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14123 | 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] | 14124 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14125 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14126 | 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] | 14127 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14128 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 14129 | -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] | 14130 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 14131 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14132 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14133 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14134 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14135 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14136 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14137 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14138 | 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] | 14139 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14140 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14141 | 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] | 14142 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14143 | "$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] | 14144 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14145 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14146 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14147 | |
| 14148 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14149 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14150 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14151 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14152 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14153 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14154 | 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] | 14155 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14156 | "$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] | 14157 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14158 | 1 \ |
| 14159 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14160 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14161 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14162 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14163 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14164 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14165 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14166 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14167 | 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] | 14168 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14169 | "$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] | 14170 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14171 | 1 \ |
| 14172 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14173 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14174 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14175 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14176 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14177 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14178 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14179 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14180 | 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] | 14181 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14182 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14183 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14184 | 1 \ |
| 14185 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14186 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14187 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14188 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14189 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14190 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14191 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14192 | "$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] | 14193 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14194 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14195 | "$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] | 14196 | 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] | 14197 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14198 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14199 | |
| 14200 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14201 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14202 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14203 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14204 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14205 | "$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] | 14206 | -d 4 |
| 14207 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14208 | "$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] | 14209 | 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] | 14210 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14211 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14212 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14214 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14215 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Gilles Peskine | 365296a | 2024-09-13 14:15:46 +0200 | [diff] [blame] | 14216 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14217 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14218 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14219 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14220 | 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] | 14221 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14222 | "$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] | 14223 | 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] | 14224 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14225 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14226 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14227 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14229 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14231 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14232 | "$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] | 14233 | -msg -tls1_2 |
| 14234 | -Verify 10 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14235 | "$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] | 14236 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14237 | min_version=tls12 max_version=tls13 " \ |
| 14238 | 0 \ |
| 14239 | -c "Protocol is TLSv1.2" \ |
| 14240 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14241 | |
| 14242 | |
| 14243 | requires_gnutls_tls1_3 |
| 14244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14245 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14246 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14247 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14248 | "$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] | 14249 | -d 4 |
| 14250 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14251 | "$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] | 14252 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14253 | min_version=tls12 max_version=tls13 " \ |
| 14254 | 0 \ |
| 14255 | -c "Protocol is TLSv1.2" \ |
| 14256 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14257 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14258 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14259 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14260 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14261 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14262 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14263 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14264 | requires_gnutls_tls1_3 |
| 14265 | requires_gnutls_next_no_ticket |
| 14266 | requires_gnutls_next_disable_tls13_compat |
| 14267 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14268 | "$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" \ |
| 14269 | "$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] | 14270 | 0 \ |
| 14271 | -s "Protocol is TLSv1.3" \ |
| 14272 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14273 | -s "received signature algorithm: 0x804" \ |
| 14274 | -s "got named group: ffdhe3072(0101)" \ |
| 14275 | -s "Certificate verification was skipped" \ |
| 14276 | -C "received HelloRetryRequest message" |
| 14277 | |
| 14278 | |
| 14279 | requires_gnutls_tls1_3 |
| 14280 | requires_gnutls_next_no_ticket |
| 14281 | requires_gnutls_next_disable_tls13_compat |
| 14282 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14283 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14284 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14285 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14286 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14287 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14288 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14289 | "$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" \ |
| 14290 | "$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] | 14291 | 0 \ |
| 14292 | -c "HTTP/1.0 200 OK" \ |
| 14293 | -c "Protocol is TLSv1.3" \ |
| 14294 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14295 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14296 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14297 | -c "Verifying peer X.509 certificate... ok" \ |
| 14298 | -C "received HelloRetryRequest message" |
| 14299 | |
| 14300 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14301 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14302 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14303 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14304 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14305 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14306 | requires_gnutls_tls1_3 |
| 14307 | requires_gnutls_next_no_ticket |
| 14308 | requires_gnutls_next_disable_tls13_compat |
| 14309 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14310 | "$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" \ |
| 14311 | "$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] | 14312 | 0 \ |
| 14313 | -s "Protocol is TLSv1.3" \ |
| 14314 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14315 | -s "received signature algorithm: 0x804" \ |
| 14316 | -s "got named group: ffdhe4096(0102)" \ |
| 14317 | -s "Certificate verification was skipped" \ |
| 14318 | -C "received HelloRetryRequest message" |
| 14319 | |
| 14320 | |
| 14321 | requires_gnutls_tls1_3 |
| 14322 | requires_gnutls_next_no_ticket |
| 14323 | requires_gnutls_next_disable_tls13_compat |
| 14324 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14325 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14326 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14327 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14328 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14329 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14330 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14331 | "$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" \ |
| 14332 | "$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] | 14333 | 0 \ |
| 14334 | -c "HTTP/1.0 200 OK" \ |
| 14335 | -c "Protocol is TLSv1.3" \ |
| 14336 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14337 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14338 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14339 | -c "Verifying peer X.509 certificate... ok" \ |
| 14340 | -C "received HelloRetryRequest message" |
| 14341 | |
| 14342 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14343 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14344 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14345 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14346 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14347 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14348 | requires_gnutls_tls1_3 |
| 14349 | requires_gnutls_next_no_ticket |
| 14350 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 6bdebfe | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 14351 | # Tests using FFDH with a large prime take a long time to run with a memory |
| 14352 | # sanitizer. GnuTLS <=3.8.1 has a hard-coded timeout and gives up after |
| 14353 | # 30s (since 3.8.1, it can be configured with --timeout). We've observed |
| 14354 | # 8192-bit FFDH test cases failing intermittently on heavily loaded CI |
| 14355 | # executors (https://github.com/Mbed-TLS/mbedtls/issues/9742), |
| 14356 | # when using MSan. As a workaround, skip them. |
| 14357 | # Also skip 6144-bit FFDH to have a bit of safety margin. |
| 14358 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14359 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14360 | "$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" \ |
| 14361 | "$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] | 14362 | 0 \ |
| 14363 | -s "Protocol is TLSv1.3" \ |
| 14364 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14365 | -s "received signature algorithm: 0x804" \ |
| 14366 | -s "got named group: ffdhe6144(0103)" \ |
| 14367 | -s "Certificate verification was skipped" \ |
| 14368 | -C "received HelloRetryRequest message" |
| 14369 | |
| 14370 | requires_gnutls_tls1_3 |
| 14371 | requires_gnutls_next_no_ticket |
| 14372 | requires_gnutls_next_disable_tls13_compat |
| 14373 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14374 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14375 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14376 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14377 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14378 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Gilles Peskine | 6bdebfe | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 14379 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14380 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14381 | "$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" \ |
| 14382 | "$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] | 14383 | 0 \ |
| 14384 | -c "HTTP/1.0 200 OK" \ |
| 14385 | -c "Protocol is TLSv1.3" \ |
| 14386 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14387 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14388 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14389 | -c "Verifying peer X.509 certificate... ok" \ |
| 14390 | -C "received HelloRetryRequest message" |
| 14391 | |
| 14392 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14393 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14394 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14395 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14396 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14397 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14398 | requires_gnutls_tls1_3 |
| 14399 | requires_gnutls_next_no_ticket |
| 14400 | requires_gnutls_next_disable_tls13_compat |
Gilles Peskine | 6bdebfe | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 14401 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14402 | client_needs_more_time 4 |
| 14403 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14404 | "$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" \ |
| 14405 | "$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] | 14406 | 0 \ |
| 14407 | -s "Protocol is TLSv1.3" \ |
| 14408 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14409 | -s "received signature algorithm: 0x804" \ |
| 14410 | -s "got named group: ffdhe8192(0104)" \ |
| 14411 | -s "Certificate verification was skipped" \ |
| 14412 | -C "received HelloRetryRequest message" |
| 14413 | |
| 14414 | requires_gnutls_tls1_3 |
| 14415 | requires_gnutls_next_no_ticket |
| 14416 | requires_gnutls_next_disable_tls13_compat |
| 14417 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14418 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14419 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14420 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14421 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14422 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Gilles Peskine | 6bdebfe | 2024-10-31 18:52:40 +0100 | [diff] [blame] | 14423 | not_with_msan_or_valgrind |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14424 | client_needs_more_time 4 |
| 14425 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14426 | "$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" \ |
| 14427 | "$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] | 14428 | 0 \ |
| 14429 | -c "HTTP/1.0 200 OK" \ |
| 14430 | -c "Protocol is TLSv1.3" \ |
| 14431 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14432 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14433 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14434 | -c "Verifying peer X.509 certificate... ok" \ |
| 14435 | -C "received HelloRetryRequest message" |
| 14436 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14438 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14439 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14440 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14441 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14442 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 14443 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14444 | "$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] | 14445 | 0 \ |
| 14446 | -C "received HelloRetryRequest message" \ |
| 14447 | -c "Selected key exchange mode: psk$" \ |
| 14448 | -c "HTTP/1.0 200 OK" |
| 14449 | |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14450 | # Legacy_compression_methods testing |
| 14451 | |
| 14452 | requires_gnutls |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14453 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Waleed Elmelegy | 38c8757 | 2024-07-15 17:25:04 +0000 | [diff] [blame] | 14455 | run_test "TLS 1.2 ClientHello indicating support for deflate compression method" \ |
| 14456 | "$P_SRV debug_level=3" \ |
| 14457 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+COMP-DEFLATE localhost" \ |
| 14458 | 0 \ |
| 14459 | -c "Handshake was completed" \ |
| 14460 | -s "dumping .client hello, compression. (2 bytes)" |
Waleed Elmelegy | 790f3b1 | 2024-07-04 16:38:04 +0000 | [diff] [blame] | 14461 | |
Waleed Elmelegy | 29581ce | 2025-01-24 17:39:58 +0000 | [diff] [blame] | 14462 | # Handshake defragmentation testing |
Minos Galanakis | e6dbf49 | 2025-02-18 17:28:27 +0000 | [diff] [blame] | 14463 | |
Gilles Peskine | 8ef2e74 | 2025-03-01 14:26:51 +0100 | [diff] [blame] | 14464 | # Most test cases are in opt-testcases/handshake-generated.sh |
Minos Galanakis | 79693bf | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 14465 | |
Minos Galanakis | 79693bf | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 14466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 79693bf | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 14467 | requires_certificate_authentication |
Minos Galanakis | 1e6438d | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 14468 | run_test "Handshake defragmentation on server: len=32, TLS 1.2 ClientHello (unsupported)" \ |
Minos Galanakis | 79693bf | 2025-02-18 17:41:18 +0000 | [diff] [blame] | 14469 | "$P_SRV debug_level=4 force_version=tls12 auth_mode=required" \ |
| 14470 | "$O_NEXT_CLI -tls1_2 -split_send_frag 32 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 14471 | 1 \ |
| 14472 | -s "The SSL configuration is tls12 only" \ |
| 14473 | -s "bad client hello message" \ |
| 14474 | -s "SSL - A message could not be parsed due to a syntactic error" |
| 14475 | |
Minos Galanakis | 44c1c5f | 2025-03-11 14:06:38 +0000 | [diff] [blame] | 14476 | # Test server-side buffer resizing with fragmented handshake on TLS1.2 |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 1e6438d | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 14478 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 14479 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 14480 | requires_max_content_len 1025 |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14481 | run_test "Handshake defragmentation on server: len=256, buffer resizing with MFL=1024" \ |
Minos Galanakis | 1e6438d | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 14482 | "$P_SRV debug_level=4 auth_mode=required" \ |
| 14483 | "$O_NEXT_CLI -tls1_2 -split_send_frag 256 -maxfraglen 1024 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
| 14484 | 0 \ |
| 14485 | -s "Reallocating in_buf" \ |
| 14486 | -s "Reallocating out_buf" \ |
| 14487 | -s "reassembled record" \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14488 | -s "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 14489 | -s "Prepare: waiting for more handshake fragments 256/" \ |
| 14490 | -s "Consume: waiting for more handshake fragments 256/" |
Minos Galanakis | 1e6438d | 2025-02-12 16:20:01 +0000 | [diff] [blame] | 14491 | |
Minos Galanakis | 44c1c5f | 2025-03-11 14:06:38 +0000 | [diff] [blame] | 14492 | # Test client-initiated renegotiation with fragmented handshake on TLS1.2 |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | c4595a4 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 14494 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14495 | run_test "Handshake defragmentation on server: len=512, client-initiated renegotation" \ |
Minos Galanakis | c4595a4 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 14496 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
| 14497 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 512 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -connect 127.0.0.1:+$SRV_PORT" \ |
| 14498 | 0 \ |
| 14499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 14500 | -s "found renegotiation extension" \ |
| 14501 | -s "server hello, secure renegotiation extension" \ |
| 14502 | -s "=> renegotiate" \ |
| 14503 | -S "write hello request" \ |
| 14504 | -s "reassembled record" \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14505 | -s "initial handshake fragment: 512, 0\\.\\.512 of [0-9]\\+" \ |
| 14506 | -s "Prepare: waiting for more handshake fragments 512/" \ |
| 14507 | -s "Consume: waiting for more handshake fragments 512/" \ |
Minos Galanakis | c4595a4 | 2025-02-12 18:23:09 +0000 | [diff] [blame] | 14508 | |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14511 | run_test "Handshake defragmentation on server: len=256, client-initiated renegotation" \ |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14512 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
| 14513 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 256 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -connect 127.0.0.1:+$SRV_PORT" \ |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14514 | 0 \ |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14515 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 14516 | -s "found renegotiation extension" \ |
| 14517 | -s "server hello, secure renegotiation extension" \ |
| 14518 | -s "=> renegotiate" \ |
| 14519 | -S "write hello request" \ |
| 14520 | -s "reassembled record" \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14521 | -s "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 14522 | -s "Prepare: waiting for more handshake fragments 256/" \ |
| 14523 | -s "Consume: waiting for more handshake fragments 256/" \ |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14524 | |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14528 | run_test "Handshake defragmentation on server: len=128, client-initiated renegotation" \ |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14529 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
| 14530 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 128 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -connect 127.0.0.1:+$SRV_PORT" \ |
| 14531 | 0 \ |
| 14532 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 14533 | -s "found renegotiation extension" \ |
| 14534 | -s "server hello, secure renegotiation extension" \ |
| 14535 | -s "=> renegotiate" \ |
| 14536 | -S "write hello request" \ |
| 14537 | -s "reassembled record" \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14538 | -s "initial handshake fragment: 128, 0\\.\\.128 of [0-9]\\+" \ |
| 14539 | -s "Prepare: waiting for more handshake fragments 128/" \ |
| 14540 | -s "Consume: waiting for more handshake fragments 128/" \ |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14541 | |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14545 | run_test "Handshake defragmentation on server: len=4, client-initiated renegotation" \ |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14546 | "$P_SRV debug_level=4 exchanges=2 renegotiation=1 auth_mode=required" \ |
| 14547 | "$O_NEXT_CLI_RENEGOTIATE -tls1_2 -split_send_frag 4 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -connect 127.0.0.1:+$SRV_PORT" \ |
| 14548 | 0 \ |
| 14549 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 14550 | -s "found renegotiation extension" \ |
| 14551 | -s "server hello, secure renegotiation extension" \ |
| 14552 | -s "=> renegotiate" \ |
| 14553 | -S "write hello request" \ |
| 14554 | -s "reassembled record" \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14555 | -s "initial handshake fragment: 4, 0\\.\\.4 of [0-9]\\+" \ |
| 14556 | -s "Prepare: waiting for more handshake fragments 4/" \ |
| 14557 | -s "Consume: waiting for more handshake fragments 4/" \ |
Minos Galanakis | 9d78547 | 2025-03-11 14:19:48 +0000 | [diff] [blame] | 14558 | |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14559 | # Test server-initiated renegotiation with fragmented handshake on TLS1.2 |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14561 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14562 | run_test "Handshake defragmentation on client: len=512, server-initiated renegotation" \ |
Minos Galanakis | 2a1eacc | 2025-03-11 17:24:04 +0000 | [diff] [blame^] | 14563 | "$O_NEXT_SRV -tls1_2 -split_send_frag 512 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14564 | "$P_CLI debug_level=3 renegotiation=1 request_page=/reneg" \ |
| 14565 | 0 \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14566 | -c "initial handshake fragment: 512, 0\\.\\.512 of [0-9]\\+" \ |
| 14567 | -c "Prepare: waiting for more handshake fragments 512/" \ |
| 14568 | -c "Consume: waiting for more handshake fragments 512/" \ |
Minos Galanakis | a37a936 | 2025-03-06 15:09:39 +0000 | [diff] [blame] | 14569 | -c "client hello, adding renegotiation extension" \ |
| 14570 | -c "found renegotiation extension" \ |
| 14571 | -c "=> renegotiate" |
| 14572 | |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14573 | |
| 14574 | # Note: The /reneg endpoint serves as a directive for OpenSSL's s_server |
| 14575 | # to initiate a handshake renegotiation. |
| 14576 | # Note: Adjusting the renegotiation delay beyond the library's default value |
| 14577 | # of 16 is necessary, as it sets the maximum record depth to match it. |
| 14578 | # Splitting messages during the renegotiation process requires a deeper |
| 14579 | # stack to accommodate the increased processing complexity. |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14581 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Minos Galanakis | 620e8c2 | 2025-03-11 17:08:01 +0000 | [diff] [blame] | 14582 | run_test "Handshake defragmentation on client: len=256, server-initiated renegotation" \ |
Minos Galanakis | 2a1eacc | 2025-03-11 17:24:04 +0000 | [diff] [blame^] | 14583 | "$O_NEXT_SRV -tls1_2 -split_send_frag 256 -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" \ |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14584 | "$P_CLI debug_level=3 renegotiation=1 renego_delay=32 request_page=/reneg" \ |
| 14585 | 0 \ |
Minos Galanakis | 135aed5 | 2025-03-11 17:00:45 +0000 | [diff] [blame] | 14586 | -c "initial handshake fragment: 256, 0\\.\\.256 of [0-9]\\+" \ |
| 14587 | -c "Prepare: waiting for more handshake fragments 256/" \ |
| 14588 | -c "Consume: waiting for more handshake fragments 256/" \ |
Minos Galanakis | 9d1aa08 | 2025-03-11 14:17:25 +0000 | [diff] [blame] | 14589 | -c "client hello, adding renegotiation extension" \ |
| 14590 | -c "found renegotiation extension" \ |
| 14591 | -c "=> renegotiate" |
| 14592 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14593 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14595 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14596 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14597 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14598 | requires_max_content_len 16384 |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14599 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14600 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14601 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 14602 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14603 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14604 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14605 | echo "------------------------------------------------------------------------" |
| 14606 | |
| 14607 | if [ $FAILS = 0 ]; then |
| 14608 | printf "PASSED" |
| 14609 | else |
| 14610 | printf "FAILED" |
| 14611 | fi |
| 14612 | PASSES=$(( $TESTS - $FAILS )) |
| 14613 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14614 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14615 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14616 | cat <<EOF |
| 14617 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14618 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14619 | EOF |
| 14620 | if [ $FAILS -eq 0 ]; then |
| 14621 | FAILS=1 |
| 14622 | fi |
| 14623 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14624 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14625 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14626 | if [ $FAILS -gt 255 ]; then |
| 14627 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14628 | # (so 256 would be 0, or success, etc) |
| 14629 | FAILS=255 |
| 14630 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14631 | exit $FAILS |