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 |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 49 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 54 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 55 | # To help the migration, error out if the old variable is set, |
| 56 | # but only if it has a different value than the new one. |
| 57 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 58 | # the variable is set, we can now check its value |
| 59 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 60 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 61 | exit 125 |
| 62 | fi |
| 63 | fi |
| 64 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 65 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 66 | 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] | 67 | echo "default" |
| 68 | else |
| 69 | echo "unknown" |
| 70 | fi |
| 71 | } |
| 72 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 73 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 74 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 75 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 76 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 77 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 78 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 79 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 80 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 81 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 82 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 83 | |
| 84 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 85 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 86 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 87 | else |
| 88 | O_LEGACY_SRV=false |
| 89 | O_LEGACY_CLI=false |
| 90 | fi |
| 91 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 92 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 93 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 94 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 95 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 96 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 97 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 98 | else |
| 99 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 100 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 101 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 102 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 103 | O_NEXT_CLI=false |
| 104 | fi |
| 105 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 106 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 107 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 108 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 109 | else |
| 110 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 111 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 112 | fi |
| 113 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 114 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 115 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 116 | 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] | 117 | else |
| 118 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 119 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 120 | fi |
| 121 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 122 | TESTS=0 |
| 123 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 124 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 125 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 126 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 127 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 128 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 129 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 130 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 132 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 133 | RUN_TEST_NUMBER='' |
| 134 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 135 | PRESERVE_LOGS=0 |
| 136 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 137 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 138 | # port which is this plus 10000. Each port number may be independently |
| 139 | # overridden by a command line option. |
| 140 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 141 | PXY_PORT=$((SRV_PORT + 10000)) |
| 142 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 143 | print_usage() { |
| 144 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 145 | printf " -h|--help\tPrint this help.\n" |
| 146 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 147 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 148 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | 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] | 150 | 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] | 151 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 152 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 153 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 154 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 155 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 156 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | get_options() { |
| 160 | while [ $# -gt 0 ]; do |
| 161 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 162 | -f|--filter) |
| 163 | shift; FILTER=$1 |
| 164 | ;; |
| 165 | -e|--exclude) |
| 166 | shift; EXCLUDE=$1 |
| 167 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | -m|--memcheck) |
| 169 | MEMCHECK=1 |
| 170 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 171 | -n|--number) |
| 172 | shift; RUN_TEST_NUMBER=$1 |
| 173 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 174 | -s|--show-numbers) |
| 175 | SHOW_TEST_NUMBER=1 |
| 176 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 177 | -p|--preserve-logs) |
| 178 | PRESERVE_LOGS=1 |
| 179 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 180 | --port) |
| 181 | shift; SRV_PORT=$1 |
| 182 | ;; |
| 183 | --proxy-port) |
| 184 | shift; PXY_PORT=$1 |
| 185 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 186 | --seed) |
| 187 | shift; SEED="$1" |
| 188 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 189 | -h|--help) |
| 190 | print_usage |
| 191 | exit 0 |
| 192 | ;; |
| 193 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 194 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 195 | print_usage |
| 196 | exit 1 |
| 197 | ;; |
| 198 | esac |
| 199 | shift |
| 200 | done |
| 201 | } |
| 202 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 203 | # Make the outcome file path relative to the original directory, not |
| 204 | # to .../tests |
| 205 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 206 | [!/]*) |
| 207 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 208 | ;; |
| 209 | esac |
| 210 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 211 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 212 | # testing. Skip non-boolean options (with something other than spaces |
| 213 | # and a comment after "#define SYMBOL"). The variable contains a |
| 214 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 215 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 216 | # Skip next test; use this macro to skip tests which are legitimate |
| 217 | # in theory and expected to be re-introduced at some point, but |
| 218 | # aren't expected to succeed at the moment due to problems outside |
| 219 | # our control (such as bugs in other TLS implementations). |
| 220 | skip_next_test() { |
| 221 | SKIP_NEXT="YES" |
| 222 | } |
| 223 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 224 | # Check if the required configuration ($1) is enabled |
| 225 | is_config_enabled() |
| 226 | { |
| 227 | case $CONFIGS_ENABLED in |
| 228 | *" $1"[\ =]*) return 0;; |
| 229 | *) return 1;; |
| 230 | esac |
| 231 | } |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # 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] | 234 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 235 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 236 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 237 | *) SKIP_NEXT="YES";; |
| 238 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 239 | } |
| 240 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 241 | # 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] | 242 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 243 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 244 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 245 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 246 | } |
| 247 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 248 | requires_all_configs_enabled() { |
| 249 | if ! $P_QUERY -all $* |
| 250 | then |
| 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
| 255 | requires_all_configs_disabled() { |
| 256 | if $P_QUERY -any $* |
| 257 | then |
| 258 | SKIP_NEXT="YES" |
| 259 | fi |
| 260 | } |
| 261 | |
| 262 | requires_any_configs_enabled() { |
| 263 | if ! $P_QUERY -any $* |
| 264 | then |
| 265 | SKIP_NEXT="YES" |
| 266 | fi |
| 267 | } |
| 268 | |
| 269 | requires_any_configs_disabled() { |
| 270 | if $P_QUERY -all $* |
| 271 | then |
| 272 | SKIP_NEXT="YES" |
| 273 | fi |
| 274 | } |
| 275 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 276 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 277 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 278 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 279 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 280 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 281 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 282 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 283 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 284 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 285 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 286 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 287 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 288 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 289 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 290 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 291 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 292 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 293 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 294 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 295 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 296 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 297 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 298 | then |
| 299 | SKIP_NEXT="YES" |
| 300 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 301 | } |
| 302 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 303 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 304 | # This function uses the query_config command line option to query the |
| 305 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 306 | # program. The command will always return a success value if the |
| 307 | # configuration is defined and the value will be printed to stdout. |
| 308 | # |
| 309 | # Note that if the configuration is not defined or is defined to nothing, |
| 310 | # the output of this function will be an empty string. |
| 311 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 315 | VAL="$( get_config_value_or_default "$1" )" |
| 316 | if [ -z "$VAL" ]; then |
| 317 | # Should never happen |
| 318 | echo "Mbed TLS configuration $1 is not defined" |
| 319 | exit 1 |
| 320 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 321 | SKIP_NEXT="YES" |
| 322 | fi |
| 323 | } |
| 324 | |
| 325 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 326 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 327 | if [ -z "$VAL" ]; then |
| 328 | # Should never happen |
| 329 | echo "Mbed TLS configuration $1 is not defined" |
| 330 | exit 1 |
| 331 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 332 | SKIP_NEXT="YES" |
| 333 | fi |
| 334 | } |
| 335 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 336 | requires_config_value_equals() { |
| 337 | VAL=$( get_config_value_or_default "$1" ) |
| 338 | if [ -z "$VAL" ]; then |
| 339 | # Should never happen |
| 340 | echo "Mbed TLS configuration $1 is not defined" |
| 341 | exit 1 |
| 342 | elif [ "$VAL" -ne "$2" ]; then |
| 343 | SKIP_NEXT="YES" |
| 344 | fi |
| 345 | } |
| 346 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 347 | # Require Mbed TLS to support the given protocol version. |
| 348 | # |
| 349 | # Inputs: |
| 350 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 351 | requires_protocol_version() { |
| 352 | # Support for DTLS is detected separately in detect_dtls(). |
| 353 | case "$1" in |
| 354 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 355 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 356 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 357 | esac |
| 358 | } |
| 359 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 360 | # Space-separated list of ciphersuites supported by this build of |
| 361 | # Mbed TLS. |
| 362 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 363 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 364 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 365 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 366 | case $P_CIPHERSUITES in |
| 367 | *" $1 "*) :;; |
| 368 | *) SKIP_NEXT="YES";; |
| 369 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 370 | } |
| 371 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 372 | # Automatically detect required features based on command line parameters. |
| 373 | # Parameters are: |
| 374 | # - $1 = command line (call to a TLS client or server program) |
| 375 | # - $2 = client/server |
| 376 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 377 | # - $4 = Use an external tool without ECDH support |
| 378 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 379 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 380 | CMD_LINE=$1 |
| 381 | ROLE=$2 |
| 382 | TLS_VERSION=$3 |
| 383 | EXT_WO_ECDH=$4 |
| 384 | TEST_OPTIONS=${5:-} |
| 385 | |
| 386 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 387 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 388 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 389 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 390 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 391 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 392 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 393 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 394 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 395 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 396 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 397 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 398 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 399 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 400 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 401 | *[-_\ =]tickets=[^0]*) |
| 402 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 403 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 404 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 405 | *[-_\ =]alpn=*) |
| 406 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 407 | esac |
| 408 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 409 | case "$CMD_LINE" in |
Valerio Setti | ccfad9a | 2023-03-08 10:25:05 +0100 | [diff] [blame] | 410 | *server5*|\ |
Valerio Setti | 80318d2 | 2023-03-13 12:26:42 +0100 | [diff] [blame] | 411 | *server7*|\ |
| 412 | *dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 413 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 414 | # In case of TLS13 the support for ECDSA is enough |
| 415 | requires_pk_alg "ECDSA" |
| 416 | else |
| 417 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 418 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 419 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 420 | # key exchange is required. However gnutls also does not |
| 421 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 422 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 423 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 424 | else |
| 425 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 426 | fi |
| 427 | elif [ "$ROLE" = "client" ]; then |
| 428 | # On the client side it is enough to have any certificate |
| 429 | # based authentication together with support for ECDSA. |
| 430 | # Of course the GnuTLS limitation mentioned above applies |
| 431 | # also here. |
| 432 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 433 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 434 | else |
| 435 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 436 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 437 | requires_pk_alg "ECDSA" |
| 438 | fi |
| 439 | fi |
| 440 | ;; |
| 441 | esac |
| 442 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 443 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 444 | } |
| 445 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 446 | requires_certificate_authentication () { |
| 447 | if [ "$PSK_ONLY" = "YES" ]; then |
| 448 | SKIP_NEXT="YES" |
| 449 | fi |
| 450 | } |
| 451 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 452 | adapt_cmd_for_psk () { |
| 453 | case "$2" in |
| 454 | *openssl*) s='-psk abc123 -nocert';; |
| 455 | *gnutls-*) s='--pskkey=abc123';; |
| 456 | *) s='psk=abc123';; |
| 457 | esac |
| 458 | eval $1='"$2 $s"' |
| 459 | unset s |
| 460 | } |
| 461 | |
| 462 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 463 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 464 | # |
| 465 | # If not running in a PSK-only build, do nothing. |
| 466 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 467 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 468 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 469 | # a pre-shared key, do nothing. |
| 470 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 471 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 472 | # |
| 473 | # Inputs: |
| 474 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 475 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 476 | # * "$@": options passed to run_test. |
| 477 | # |
| 478 | # Outputs: |
| 479 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 480 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 481 | maybe_adapt_for_psk() { |
| 482 | if [ "$PSK_ONLY" != "YES" ]; then |
| 483 | return |
| 484 | fi |
| 485 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 486 | return |
| 487 | fi |
| 488 | case "$CLI_CMD $SRV_CMD" in |
| 489 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 490 | return;; |
| 491 | *force_ciphersuite*) |
| 492 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 493 | # PSK cipher suite could be substituted, but we're not ready for |
| 494 | # that yet. |
| 495 | SKIP_NEXT="YES" |
| 496 | return;; |
| 497 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 498 | # The test case involves certificates. PSK won't do. |
| 499 | SKIP_NEXT="YES" |
| 500 | return;; |
| 501 | esac |
| 502 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 503 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 504 | } |
| 505 | |
| 506 | case " $CONFIGS_ENABLED " in |
| 507 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 508 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 509 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 510 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 511 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 512 | *) PSK_ONLY="NO";; |
| 513 | esac |
| 514 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 515 | HAS_ALG_SHA_1="NO" |
| 516 | HAS_ALG_SHA_224="NO" |
| 517 | HAS_ALG_SHA_256="NO" |
| 518 | HAS_ALG_SHA_384="NO" |
| 519 | HAS_ALG_SHA_512="NO" |
| 520 | |
| 521 | check_for_hash_alg() |
| 522 | { |
| 523 | CURR_ALG="INVALID"; |
| 524 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 525 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 526 | USE_PSA="YES"; |
| 527 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 528 | if [ $USE_PSA = "YES" ]; then |
| 529 | CURR_ALG=PSA_WANT_ALG_${1} |
| 530 | else |
| 531 | CURR_ALG=MBEDTLS_${1}_C |
| 532 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 533 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 534 | fi |
| 535 | |
| 536 | case $CONFIGS_ENABLED in |
| 537 | *" $CURR_ALG"[\ =]*) |
| 538 | return 0 |
| 539 | ;; |
| 540 | *) :;; |
| 541 | esac |
| 542 | return 1 |
| 543 | } |
| 544 | |
| 545 | populate_enabled_hash_algs() |
| 546 | { |
| 547 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 548 | if check_for_hash_alg "$hash_alg"; then |
| 549 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 550 | eval ${hash_alg_variable}=YES |
| 551 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 552 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | # skip next test if the given hash alg is not supported |
| 556 | requires_hash_alg() { |
| 557 | HASH_DEFINE="Invalid" |
| 558 | HAS_HASH_ALG="NO" |
| 559 | case $1 in |
| 560 | SHA_1):;; |
| 561 | SHA_224):;; |
| 562 | SHA_256):;; |
| 563 | SHA_384):;; |
| 564 | SHA_512):;; |
| 565 | *) |
| 566 | echo "Unsupported hash alg - $1" |
| 567 | exit 1 |
| 568 | ;; |
| 569 | esac |
| 570 | |
| 571 | HASH_DEFINE=HAS_ALG_${1} |
| 572 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 573 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 574 | then |
| 575 | SKIP_NEXT="YES" |
| 576 | fi |
| 577 | } |
| 578 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 579 | # Skip next test if the given pk alg is not enabled |
| 580 | requires_pk_alg() { |
| 581 | case $1 in |
| 582 | ECDSA) |
| 583 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 584 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 585 | else |
| 586 | requires_config_enabled MBEDTLS_ECDSA_C |
| 587 | fi |
| 588 | ;; |
| 589 | *) |
| 590 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 591 | exit 1 |
| 592 | ;; |
| 593 | esac |
| 594 | } |
| 595 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 596 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 597 | requires_openssl_with_fallback_scsv() { |
| 598 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 599 | 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] | 600 | then |
| 601 | OPENSSL_HAS_FBSCSV="YES" |
| 602 | else |
| 603 | OPENSSL_HAS_FBSCSV="NO" |
| 604 | fi |
| 605 | fi |
| 606 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 607 | SKIP_NEXT="YES" |
| 608 | fi |
| 609 | } |
| 610 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 611 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 612 | requires_max_content_len() { |
| 613 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 614 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 615 | } |
| 616 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 617 | # skip next test if GnuTLS isn't available |
| 618 | requires_gnutls() { |
| 619 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 620 | 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] | 621 | GNUTLS_AVAILABLE="YES" |
| 622 | else |
| 623 | GNUTLS_AVAILABLE="NO" |
| 624 | fi |
| 625 | fi |
| 626 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 627 | SKIP_NEXT="YES" |
| 628 | fi |
| 629 | } |
| 630 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 631 | # skip next test if GnuTLS-next isn't available |
| 632 | requires_gnutls_next() { |
| 633 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 634 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 635 | GNUTLS_NEXT_AVAILABLE="YES" |
| 636 | else |
| 637 | GNUTLS_NEXT_AVAILABLE="NO" |
| 638 | fi |
| 639 | fi |
| 640 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 641 | SKIP_NEXT="YES" |
| 642 | fi |
| 643 | } |
| 644 | |
| 645 | # skip next test if OpenSSL-legacy isn't available |
| 646 | requires_openssl_legacy() { |
| 647 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 648 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 649 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 650 | else |
| 651 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 652 | fi |
| 653 | fi |
| 654 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 655 | SKIP_NEXT="YES" |
| 656 | fi |
| 657 | } |
| 658 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 659 | requires_openssl_next() { |
| 660 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 661 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 662 | OPENSSL_NEXT_AVAILABLE="YES" |
| 663 | else |
| 664 | OPENSSL_NEXT_AVAILABLE="NO" |
| 665 | fi |
| 666 | fi |
| 667 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 668 | SKIP_NEXT="YES" |
| 669 | fi |
| 670 | } |
| 671 | |
| 672 | # skip next test if tls1_3 is not available |
| 673 | requires_openssl_tls1_3() { |
| 674 | requires_openssl_next |
| 675 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 676 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 677 | fi |
| 678 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 679 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 680 | then |
| 681 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 682 | else |
| 683 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 684 | fi |
| 685 | fi |
| 686 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 687 | SKIP_NEXT="YES" |
| 688 | fi |
| 689 | } |
| 690 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame^] | 691 | # skip next test if openssl version is lower than 3.0 |
| 692 | requires_openssl_3_x() { |
| 693 | requires_openssl_next |
| 694 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 695 | OPENSSL_3_X_AVAILABLE="NO" |
| 696 | fi |
| 697 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
| 698 | if which $OPENSSL_NEXT 2>&1 | grep openssl-3 >/dev/null |
| 699 | then |
| 700 | OPENSSL_3_X_AVAILABLE="YES" |
| 701 | else |
| 702 | OPENSSL_3_X_AVAILABLE="NO" |
| 703 | fi |
| 704 | fi |
| 705 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 706 | SKIP_NEXT="YES" |
| 707 | fi |
| 708 | } |
| 709 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 710 | # skip next test if tls1_3 is not available |
| 711 | requires_gnutls_tls1_3() { |
| 712 | requires_gnutls_next |
| 713 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 714 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 715 | fi |
| 716 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 717 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 718 | then |
| 719 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 720 | else |
| 721 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 722 | fi |
| 723 | fi |
| 724 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 725 | SKIP_NEXT="YES" |
| 726 | fi |
| 727 | } |
| 728 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 729 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 730 | requires_gnutls_next_no_ticket() { |
| 731 | requires_gnutls_next |
| 732 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 733 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 734 | fi |
| 735 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 736 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 737 | then |
| 738 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 739 | else |
| 740 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 741 | fi |
| 742 | fi |
| 743 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 744 | SKIP_NEXT="YES" |
| 745 | fi |
| 746 | } |
| 747 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 748 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 749 | requires_gnutls_next_disable_tls13_compat() { |
| 750 | requires_gnutls_next |
| 751 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 752 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 753 | fi |
| 754 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 755 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 756 | then |
| 757 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 758 | else |
| 759 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 760 | fi |
| 761 | fi |
| 762 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 763 | SKIP_NEXT="YES" |
| 764 | fi |
| 765 | } |
| 766 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 767 | # skip next test if GnuTLS does not support the record size limit extension |
| 768 | requires_gnutls_record_size_limit() { |
| 769 | requires_gnutls_next |
| 770 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 771 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 772 | else |
| 773 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 774 | fi |
| 775 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 776 | SKIP_NEXT="YES" |
| 777 | fi |
| 778 | } |
| 779 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 780 | # skip next test if IPv6 isn't available on this host |
| 781 | requires_ipv6() { |
| 782 | if [ -z "${HAS_IPV6:-}" ]; then |
| 783 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 784 | SRV_PID=$! |
| 785 | sleep 1 |
| 786 | kill $SRV_PID >/dev/null 2>&1 |
| 787 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 788 | HAS_IPV6="NO" |
| 789 | else |
| 790 | HAS_IPV6="YES" |
| 791 | fi |
| 792 | rm -r $SRV_OUT |
| 793 | fi |
| 794 | |
| 795 | if [ "$HAS_IPV6" = "NO" ]; then |
| 796 | SKIP_NEXT="YES" |
| 797 | fi |
| 798 | } |
| 799 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 800 | # skip next test if it's i686 or uname is not available |
| 801 | requires_not_i686() { |
| 802 | if [ -z "${IS_I686:-}" ]; then |
| 803 | IS_I686="YES" |
| 804 | if which "uname" >/dev/null 2>&1; then |
| 805 | if [ -z "$(uname -a | grep i686)" ]; then |
| 806 | IS_I686="NO" |
| 807 | fi |
| 808 | fi |
| 809 | fi |
| 810 | if [ "$IS_I686" = "YES" ]; then |
| 811 | SKIP_NEXT="YES" |
| 812 | fi |
| 813 | } |
| 814 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 815 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 816 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 817 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 818 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 819 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 820 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 821 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 822 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 823 | fi |
| 824 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 825 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 826 | fi |
| 827 | |
| 828 | # skip the next test if the SSL output buffer is less than 16KB |
| 829 | requires_full_size_output_buffer() { |
| 830 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 831 | SKIP_NEXT="YES" |
| 832 | fi |
| 833 | } |
| 834 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 835 | # skip the next test if valgrind is in use |
| 836 | not_with_valgrind() { |
| 837 | if [ "$MEMCHECK" -gt 0 ]; then |
| 838 | SKIP_NEXT="YES" |
| 839 | fi |
| 840 | } |
| 841 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 842 | # skip the next test if valgrind is NOT in use |
| 843 | only_with_valgrind() { |
| 844 | if [ "$MEMCHECK" -eq 0 ]; then |
| 845 | SKIP_NEXT="YES" |
| 846 | fi |
| 847 | } |
| 848 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 849 | # 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] | 850 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 851 | CLI_DELAY_FACTOR=$1 |
| 852 | } |
| 853 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 854 | # wait for the given seconds after the client finished in the next test |
| 855 | server_needs_more_time() { |
| 856 | SRV_DELAY_SECONDS=$1 |
| 857 | } |
| 858 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 859 | # print_name <name> |
| 860 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 861 | TESTS=$(( $TESTS + 1 )) |
| 862 | LINE="" |
| 863 | |
| 864 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 865 | LINE="$TESTS " |
| 866 | fi |
| 867 | |
| 868 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 869 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 870 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 871 | for i in `seq 1 $LEN`; do printf '.'; done |
| 872 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 873 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 874 | } |
| 875 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 876 | # record_outcome <outcome> [<failure-reason>] |
| 877 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 878 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 879 | record_outcome() { |
| 880 | echo "$1" |
| 881 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 882 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 883 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 884 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 885 | "$1" "${2-}" \ |
| 886 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 887 | fi |
| 888 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 889 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 890 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 891 | # True if the presence of the given pattern in a log definitely indicates |
| 892 | # that the test has failed. False if the presence is inconclusive. |
| 893 | # |
| 894 | # Inputs: |
| 895 | # * $1: pattern found in the logs |
| 896 | # * $TIMES_LEFT: >0 if retrying is an option |
| 897 | # |
| 898 | # Outputs: |
| 899 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 900 | # unchanged otherwise. |
| 901 | # * Return value: 1 if the pattern is inconclusive, |
| 902 | # 0 if the failure is definitive. |
| 903 | log_pattern_presence_is_conclusive() { |
| 904 | # If we've run out of attempts, then don't retry no matter what. |
| 905 | if [ $TIMES_LEFT -eq 0 ]; then |
| 906 | return 0 |
| 907 | fi |
| 908 | case $1 in |
| 909 | "resend") |
| 910 | # An undesired resend may have been caused by the OS dropping or |
| 911 | # delaying a packet at an inopportune time. |
| 912 | outcome="RETRY(resend)" |
| 913 | return 1;; |
| 914 | esac |
| 915 | } |
| 916 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 917 | # fail <message> |
| 918 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 919 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 920 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 921 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 922 | mv $SRV_OUT o-srv-${TESTS}.log |
| 923 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 924 | if [ -n "$PXY_CMD" ]; then |
| 925 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 926 | fi |
| 927 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 928 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 929 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 930 | echo " ! server output:" |
| 931 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 932 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 933 | echo " ! client output:" |
| 934 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 935 | if [ -n "$PXY_CMD" ]; then |
| 936 | echo " ! ========================================================" |
| 937 | echo " ! proxy output:" |
| 938 | cat o-pxy-${TESTS}.log |
| 939 | fi |
| 940 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 941 | fi |
| 942 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 943 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 944 | } |
| 945 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 946 | # is_polar <cmd_line> |
| 947 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 948 | case "$1" in |
| 949 | *ssl_client2*) true;; |
| 950 | *ssl_server2*) true;; |
| 951 | *) false;; |
| 952 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 953 | } |
| 954 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 955 | # openssl s_server doesn't have -www with DTLS |
| 956 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 957 | case "$SRV_CMD" in |
| 958 | *s_server*-dtls*) |
| 959 | NEEDS_INPUT=1 |
| 960 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 961 | *) NEEDS_INPUT=0;; |
| 962 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 963 | } |
| 964 | |
| 965 | # provide input to commands that need it |
| 966 | provide_input() { |
| 967 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 968 | return |
| 969 | fi |
| 970 | |
| 971 | while true; do |
| 972 | echo "HTTP/1.0 200 OK" |
| 973 | sleep 1 |
| 974 | done |
| 975 | } |
| 976 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 977 | # has_mem_err <log_file_name> |
| 978 | has_mem_err() { |
| 979 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 980 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 981 | then |
| 982 | return 1 # false: does not have errors |
| 983 | else |
| 984 | return 0 # true: has errors |
| 985 | fi |
| 986 | } |
| 987 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 988 | # 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] | 989 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 990 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 991 | newline=' |
| 992 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 993 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 994 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 995 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 996 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 997 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 998 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 999 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1000 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1001 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1002 | # When we use a proxy, it will be listening on the same port we |
| 1003 | # 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] | 1004 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1005 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1006 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1007 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1008 | echo "$3 START TIMEOUT" |
| 1009 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1010 | break |
| 1011 | fi |
| 1012 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1013 | # OSes this may be a tight loop. |
| 1014 | sleep 0.1 2>/dev/null || true |
| 1015 | done |
| 1016 | } |
| 1017 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1018 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1019 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1020 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1021 | } |
| 1022 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1023 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1024 | # Wait for server process $2 to be listening on port $1. |
| 1025 | wait_server_start() { |
| 1026 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1027 | } |
| 1028 | |
| 1029 | # Wait for proxy process $2 to be listening on port $1. |
| 1030 | wait_proxy_start() { |
| 1031 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1032 | } |
| 1033 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1034 | # 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] | 1035 | # 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] | 1036 | # acceptable bounds |
| 1037 | check_server_hello_time() { |
| 1038 | # 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] | 1039 | 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] | 1040 | # Get the Unix timestamp for now |
| 1041 | CUR_TIME=$(date +'%s') |
| 1042 | THRESHOLD_IN_SECS=300 |
| 1043 | |
| 1044 | # Check if the ServerHello time was printed |
| 1045 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1046 | return 1 |
| 1047 | fi |
| 1048 | |
| 1049 | # Check the time in ServerHello is within acceptable bounds |
| 1050 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1051 | # The time in ServerHello is at least 5 minutes before now |
| 1052 | return 1 |
| 1053 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1054 | # 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] | 1055 | return 1 |
| 1056 | else |
| 1057 | return 0 |
| 1058 | fi |
| 1059 | } |
| 1060 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1061 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1062 | handshake_memory_get() { |
| 1063 | OUTPUT_VARIABLE="$1" |
| 1064 | OUTPUT_FILE="$2" |
| 1065 | |
| 1066 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1067 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1068 | |
| 1069 | # Check if memory usage was read |
| 1070 | if [ -z "$MEM_USAGE" ]; then |
| 1071 | echo "Error: Can not read the value of handshake memory usage" |
| 1072 | return 1 |
| 1073 | else |
| 1074 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1075 | return 0 |
| 1076 | fi |
| 1077 | } |
| 1078 | |
| 1079 | # Get handshake memory usage from server or client output and check if this value |
| 1080 | # is not higher than the maximum given by the first argument |
| 1081 | handshake_memory_check() { |
| 1082 | MAX_MEMORY="$1" |
| 1083 | OUTPUT_FILE="$2" |
| 1084 | |
| 1085 | # Get memory usage |
| 1086 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1087 | return 1 |
| 1088 | fi |
| 1089 | |
| 1090 | # Check if memory usage is below max value |
| 1091 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1092 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1093 | "but should be below $MAX_MEMORY bytes" |
| 1094 | return 1 |
| 1095 | else |
| 1096 | return 0 |
| 1097 | fi |
| 1098 | } |
| 1099 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1100 | # wait for client to terminate and set CLI_EXIT |
| 1101 | # must be called right after starting the client |
| 1102 | wait_client_done() { |
| 1103 | CLI_PID=$! |
| 1104 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1105 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1106 | CLI_DELAY_FACTOR=1 |
| 1107 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1108 | ( 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] | 1109 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1110 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1111 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1112 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1113 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1114 | CLI_EXIT=$? |
| 1115 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1116 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1117 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1118 | |
| 1119 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1120 | |
| 1121 | sleep $SRV_DELAY_SECONDS |
| 1122 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1123 | } |
| 1124 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1125 | # check if the given command uses dtls and sets global variable DTLS |
| 1126 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1127 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1128 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1129 | *) DTLS=0;; |
| 1130 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1131 | } |
| 1132 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1133 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1134 | is_gnutls() { |
| 1135 | case "$1" in |
| 1136 | *gnutls-cli*) |
| 1137 | CMD_IS_GNUTLS=1 |
| 1138 | ;; |
| 1139 | *gnutls-serv*) |
| 1140 | CMD_IS_GNUTLS=1 |
| 1141 | ;; |
| 1142 | *) |
| 1143 | CMD_IS_GNUTLS=0 |
| 1144 | ;; |
| 1145 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1146 | } |
| 1147 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1148 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1149 | # 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] | 1150 | # and client command lines, given as input, to verify if the current test |
| 1151 | # is using one of these tools. |
| 1152 | use_ext_tool_without_ecdh_support() { |
| 1153 | case "$1" in |
| 1154 | *$GNUTLS_SERV*|\ |
| 1155 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1156 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1157 | echo "yes" |
| 1158 | return;; |
| 1159 | esac |
| 1160 | case "$2" in |
| 1161 | *$GNUTLS_CLI*|\ |
| 1162 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1163 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1164 | echo "yes" |
| 1165 | return;; |
| 1166 | esac |
| 1167 | echo "no" |
| 1168 | } |
| 1169 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1170 | # Generate random psk_list argument for ssl_server2 |
| 1171 | get_srv_psk_list () |
| 1172 | { |
| 1173 | case $(( TESTS % 3 )) in |
| 1174 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1175 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1176 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1177 | esac |
| 1178 | } |
| 1179 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1180 | # Determine what calc_verify trace is to be expected, if any. |
| 1181 | # |
| 1182 | # calc_verify is only called for two things: to calculate the |
| 1183 | # extended master secret, and to process client authentication. |
| 1184 | # |
| 1185 | # Warning: the current implementation assumes that extended_ms is not |
| 1186 | # disabled on the client or on the server. |
| 1187 | # |
| 1188 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1189 | # * $1: the value of the server auth_mode parameter. |
| 1190 | # 'required' if client authentication is expected, |
| 1191 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1192 | # * $CONFIGS_ENABLED |
| 1193 | # |
| 1194 | # Outputs: |
| 1195 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1196 | set_maybe_calc_verify() { |
| 1197 | maybe_calc_verify= |
| 1198 | case $CONFIGS_ENABLED in |
| 1199 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1200 | *) |
| 1201 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1202 | ''|none) return;; |
| 1203 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1204 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1205 | esac |
| 1206 | esac |
| 1207 | case $CONFIGS_ENABLED in |
| 1208 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1209 | *) maybe_calc_verify="<= calc verify";; |
| 1210 | esac |
| 1211 | } |
| 1212 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1213 | # Compare file content |
| 1214 | # Usage: find_in_both pattern file1 file2 |
| 1215 | # extract from file1 the first line matching the pattern |
| 1216 | # check in file2 that the same line can be found |
| 1217 | find_in_both() { |
| 1218 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1219 | if [ -z "$srv_pattern" ]; then |
| 1220 | return 1; |
| 1221 | fi |
| 1222 | |
| 1223 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1224 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1225 | else |
| 1226 | return 1; |
| 1227 | fi |
| 1228 | } |
| 1229 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1230 | SKIP_HANDSHAKE_CHECK="NO" |
| 1231 | skip_handshake_stage_check() { |
| 1232 | SKIP_HANDSHAKE_CHECK="YES" |
| 1233 | } |
| 1234 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1235 | # Analyze the commands that will be used in a test. |
| 1236 | # |
| 1237 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1238 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1239 | # |
| 1240 | # Inputs: |
| 1241 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1242 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1243 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1244 | # |
| 1245 | # Outputs: |
| 1246 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1247 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1248 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1249 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 1250 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1251 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1252 | case " $SRV_CMD " in |
| 1253 | *' server_addr=::1 '*) |
| 1254 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1255 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1256 | fi |
| 1257 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1258 | # update CMD_IS_GNUTLS variable |
| 1259 | is_gnutls "$SRV_CMD" |
| 1260 | |
| 1261 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1262 | # set the default priority |
| 1263 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1264 | case "$SRV_CMD" in |
| 1265 | *--priority*) :;; |
| 1266 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1267 | esac |
| 1268 | fi |
| 1269 | |
| 1270 | # update CMD_IS_GNUTLS variable |
| 1271 | is_gnutls "$CLI_CMD" |
| 1272 | |
| 1273 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1274 | # set the default priority |
| 1275 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1276 | case "$CLI_CMD" in |
| 1277 | *--priority*) :;; |
| 1278 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1279 | esac |
| 1280 | fi |
| 1281 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1282 | # fix client port |
| 1283 | if [ -n "$PXY_CMD" ]; then |
| 1284 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1285 | else |
| 1286 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1287 | fi |
| 1288 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1289 | # prepend valgrind to our commands if active |
| 1290 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1291 | if is_polar "$SRV_CMD"; then |
| 1292 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1293 | fi |
| 1294 | if is_polar "$CLI_CMD"; then |
| 1295 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1296 | fi |
| 1297 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1298 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1299 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1300 | # Check for failure conditions after a test case. |
| 1301 | # |
| 1302 | # Inputs from run_test: |
| 1303 | # * positional parameters: test options (see run_test documentation) |
| 1304 | # * $CLI_EXIT: client return code |
| 1305 | # * $CLI_EXPECT: expected client return code |
| 1306 | # * $SRV_RET: server return code |
| 1307 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1308 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1309 | # |
| 1310 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1311 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1312 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1313 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1314 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1315 | if [ $TIMES_LEFT -gt 0 ] && |
| 1316 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1317 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1318 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1319 | return |
| 1320 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1321 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1322 | # 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] | 1323 | # (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] | 1324 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1325 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1326 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1327 | then |
| 1328 | if is_polar "$SRV_CMD"; then |
| 1329 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1330 | else |
| 1331 | fail "server or client failed to reach handshake stage" |
| 1332 | return |
| 1333 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1334 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1335 | if is_polar "$CLI_CMD"; then |
| 1336 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1337 | else |
| 1338 | fail "server or client failed to reach handshake stage" |
| 1339 | return |
| 1340 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1341 | fi |
| 1342 | fi |
| 1343 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1344 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1345 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1346 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1347 | # care anyway), in case e.g. the server reports a memory leak. |
| 1348 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1349 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1350 | return |
| 1351 | fi |
| 1352 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1353 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1354 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1355 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1356 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1357 | 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] | 1358 | return |
| 1359 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1360 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1361 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1362 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1363 | # 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] | 1364 | while [ $# -gt 0 ] |
| 1365 | do |
| 1366 | case $1 in |
| 1367 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1368 | 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] | 1369 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1370 | return |
| 1371 | fi |
| 1372 | ;; |
| 1373 | |
| 1374 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1375 | 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] | 1376 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1377 | return |
| 1378 | fi |
| 1379 | ;; |
| 1380 | |
| 1381 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1382 | 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] | 1383 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1384 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1385 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1386 | return |
| 1387 | fi |
| 1388 | ;; |
| 1389 | |
| 1390 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1391 | 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] | 1392 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1393 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1394 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1395 | return |
| 1396 | fi |
| 1397 | ;; |
| 1398 | |
| 1399 | # The filtering in the following two options (-u and -U) do the following |
| 1400 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1401 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1402 | # - keep one of each non-unique line |
| 1403 | # - count how many lines remain |
| 1404 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1405 | # if there were no duplicates. |
| 1406 | "-U") |
| 1407 | 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 |
| 1408 | fail "lines following pattern '$2' must be unique in Server output" |
| 1409 | return |
| 1410 | fi |
| 1411 | ;; |
| 1412 | |
| 1413 | "-u") |
| 1414 | 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 |
| 1415 | 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] | 1416 | return |
| 1417 | fi |
| 1418 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1419 | "-F") |
| 1420 | if ! $2 "$SRV_OUT"; then |
| 1421 | fail "function call to '$2' failed on Server output" |
| 1422 | return |
| 1423 | fi |
| 1424 | ;; |
| 1425 | "-f") |
| 1426 | if ! $2 "$CLI_OUT"; then |
| 1427 | fail "function call to '$2' failed on Client output" |
| 1428 | return |
| 1429 | fi |
| 1430 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1431 | "-g") |
| 1432 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1433 | fail "function call to '$2' failed on Server and Client output" |
| 1434 | return |
| 1435 | fi |
| 1436 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1437 | |
| 1438 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1439 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1440 | exit 1 |
| 1441 | esac |
| 1442 | shift 2 |
| 1443 | done |
| 1444 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1445 | # check valgrind's results |
| 1446 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1447 | 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] | 1448 | fail "Server has memory errors" |
| 1449 | return |
| 1450 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1451 | 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] | 1452 | fail "Client has memory errors" |
| 1453 | return |
| 1454 | fi |
| 1455 | fi |
| 1456 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1457 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1458 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1459 | } |
| 1460 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1461 | # Run the current test case: start the server and if applicable the proxy, run |
| 1462 | # the client, wait for all processes to finish or time out. |
| 1463 | # |
| 1464 | # Inputs: |
| 1465 | # * $NAME: test case name |
| 1466 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1467 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1468 | # |
| 1469 | # Outputs: |
| 1470 | # * $CLI_EXIT: client return code |
| 1471 | # * $SRV_RET: server return code |
| 1472 | do_run_test_once() { |
| 1473 | # run the commands |
| 1474 | if [ -n "$PXY_CMD" ]; then |
| 1475 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1476 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1477 | PXY_PID=$! |
| 1478 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1479 | fi |
| 1480 | |
| 1481 | check_osrv_dtls |
| 1482 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1483 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1484 | SRV_PID=$! |
| 1485 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1486 | |
| 1487 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1488 | # The client must be a subprocess of the script in order for killing it to |
| 1489 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1490 | # not at the end of the line: the latter approach will spawn eval as a |
| 1491 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1492 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1493 | wait_client_done |
| 1494 | |
| 1495 | sleep 0.05 |
| 1496 | |
| 1497 | # terminate the server (and the proxy) |
| 1498 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1499 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1500 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1501 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1502 | SRV_RET=$? |
| 1503 | |
| 1504 | if [ -n "$PXY_CMD" ]; then |
| 1505 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1506 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1507 | fi |
| 1508 | } |
| 1509 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1510 | # 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] | 1511 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1512 | # |
| 1513 | # Note: this function only provides some guess about TLS version by simply |
| 1514 | # looking at the server/client command lines. Even thought this works |
| 1515 | # for the sake of tests' filtering (especially in conjunction with the |
| 1516 | # detect_required_features() function), it does NOT guarantee that the |
| 1517 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1518 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1519 | # that we are going to use TLS 1.2 |
| 1520 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1521 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1522 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1523 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1524 | *tls12*) |
| 1525 | echo "TLS12" |
| 1526 | return;; |
| 1527 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1528 | echo "TLS13" |
| 1529 | return;; |
| 1530 | esac |
| 1531 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1532 | *tls12*) |
| 1533 | echo "TLS12" |
| 1534 | return;; |
| 1535 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1536 | echo "TLS13" |
| 1537 | return;; |
| 1538 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1539 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1540 | case $1 in |
| 1541 | tls1_2*) |
| 1542 | echo "TLS12" |
| 1543 | return;; |
| 1544 | *tls1_3) |
| 1545 | echo "TLS13" |
| 1546 | return;; |
| 1547 | esac |
| 1548 | case $2 in |
| 1549 | *tls1_2) |
| 1550 | echo "TLS12" |
| 1551 | return;; |
| 1552 | *tls1_3) |
| 1553 | echo "TLS13" |
| 1554 | return;; |
| 1555 | esac |
| 1556 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1557 | # is aimed to run a TLS 1.3 handshake. |
| 1558 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 |
| 1559 | then |
| 1560 | echo "TLS13" |
| 1561 | else |
| 1562 | echo "TLS12" |
| 1563 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1564 | } |
| 1565 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1566 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1567 | # Options: -s pattern pattern that must be present in server output |
| 1568 | # -c pattern pattern that must be present in client output |
| 1569 | # -u pattern lines after pattern must be unique in client output |
| 1570 | # -f call shell function on client output |
| 1571 | # -S pattern pattern that must be absent in server output |
| 1572 | # -C pattern pattern that must be absent in client output |
| 1573 | # -U pattern lines after pattern must be unique in server output |
| 1574 | # -F call shell function on server output |
| 1575 | # -g call shell function on server and client output |
| 1576 | run_test() { |
| 1577 | NAME="$1" |
| 1578 | shift 1 |
| 1579 | |
| 1580 | if is_excluded "$NAME"; then |
| 1581 | SKIP_NEXT="NO" |
| 1582 | # There was no request to run the test, so don't record its outcome. |
| 1583 | return |
| 1584 | fi |
| 1585 | |
| 1586 | print_name "$NAME" |
| 1587 | |
| 1588 | # Do we only run numbered tests? |
| 1589 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1590 | case ",$RUN_TEST_NUMBER," in |
| 1591 | *",$TESTS,"*) :;; |
| 1592 | *) SKIP_NEXT="YES";; |
| 1593 | esac |
| 1594 | fi |
| 1595 | |
| 1596 | # does this test use a proxy? |
| 1597 | if [ "X$1" = "X-p" ]; then |
| 1598 | PXY_CMD="$2" |
| 1599 | shift 2 |
| 1600 | else |
| 1601 | PXY_CMD="" |
| 1602 | fi |
| 1603 | |
| 1604 | # get commands and client output |
| 1605 | SRV_CMD="$1" |
| 1606 | CLI_CMD="$2" |
| 1607 | CLI_EXPECT="$3" |
| 1608 | shift 3 |
| 1609 | |
| 1610 | # Check if test uses files |
| 1611 | case "$SRV_CMD $CLI_CMD" in |
| 1612 | *data_files/*) |
| 1613 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1614 | esac |
| 1615 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1616 | # Check if the test uses DTLS. |
| 1617 | detect_dtls "$SRV_CMD" |
| 1618 | if [ "$DTLS" -eq 1 ]; then |
| 1619 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1620 | fi |
| 1621 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1622 | # If the client or server requires certain features that can be detected |
| 1623 | # from their command-line arguments, check that they're enabled. |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1624 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1625 | |
| 1626 | # Check if we are trying to use an external tool wich does not support ECDH |
| 1627 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1628 | |
| 1629 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1630 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1631 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1632 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1633 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1634 | |
| 1635 | # should we skip? |
| 1636 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1637 | SKIP_NEXT="NO" |
| 1638 | record_outcome "SKIP" |
| 1639 | SKIPS=$(( $SKIPS + 1 )) |
| 1640 | return |
| 1641 | fi |
| 1642 | |
| 1643 | analyze_test_commands "$@" |
| 1644 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1645 | # One regular run and two retries |
| 1646 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1647 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1648 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1649 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1650 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1651 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1652 | check_test_failure "$@" |
| 1653 | case $outcome in |
| 1654 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1655 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1656 | FAIL) return;; |
| 1657 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1658 | done |
| 1659 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1660 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1661 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1662 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1663 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1664 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1665 | if [ -n "$PXY_CMD" ]; then |
| 1666 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1667 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1668 | fi |
| 1669 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1670 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1671 | } |
| 1672 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1673 | run_test_psa() { |
| 1674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1675 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1676 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1677 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1678 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1679 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1680 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1681 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1682 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1683 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1684 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1685 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1686 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1687 | -S "error" \ |
| 1688 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1689 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1690 | } |
| 1691 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1692 | run_test_psa_force_curve() { |
| 1693 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1694 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1695 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1696 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1697 | "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1698 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1699 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1700 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1701 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1702 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1703 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1704 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1705 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1706 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1707 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1708 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1709 | } |
| 1710 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1711 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1712 | # a maximum fragment length. |
| 1713 | # first argument ($1) is MFL for SSL client |
| 1714 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1715 | run_test_memory_after_hanshake_with_mfl() |
| 1716 | { |
| 1717 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1718 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1719 | |
| 1720 | # Leave some margin for robustness |
| 1721 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1722 | |
| 1723 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1724 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1725 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1726 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1727 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1728 | 0 \ |
| 1729 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1730 | } |
| 1731 | |
| 1732 | |
| 1733 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1734 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1735 | run_tests_memory_after_hanshake() |
| 1736 | { |
| 1737 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1738 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1739 | |
| 1740 | # first test with default MFU is to get reference memory usage |
| 1741 | MEMORY_USAGE_MFL_16K=0 |
| 1742 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1743 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1744 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1745 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1746 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1747 | 0 \ |
| 1748 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1749 | |
| 1750 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1751 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1752 | |
| 1753 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1754 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1755 | |
| 1756 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1757 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1758 | |
| 1759 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1760 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1761 | } |
| 1762 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1763 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1764 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1765 | rm -f context_srv.txt |
| 1766 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1767 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1768 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1769 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1770 | 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] | 1771 | exit 1 |
| 1772 | } |
| 1773 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1774 | # |
| 1775 | # MAIN |
| 1776 | # |
| 1777 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1778 | get_options "$@" |
| 1779 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1780 | populate_enabled_hash_algs |
| 1781 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1782 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1783 | # patterns rather than regular expressions, use a case statement instead |
| 1784 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1785 | # detects simple cases: plain substring, everything, nothing. |
| 1786 | # |
| 1787 | # As an exception, the character '.' is treated as an ordinary character |
| 1788 | # if it is the only special character in the string. This is because it's |
| 1789 | # rare to need "any one character", but needing a literal '.' is common |
| 1790 | # (e.g. '-f "DTLS 1.2"'). |
| 1791 | need_grep= |
| 1792 | case "$FILTER" in |
| 1793 | '^$') simple_filter=;; |
| 1794 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1795 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1796 | need_grep=1;; |
| 1797 | *) # No regexp or shell-pattern special character |
| 1798 | simple_filter="*$FILTER*";; |
| 1799 | esac |
| 1800 | case "$EXCLUDE" in |
| 1801 | '^$') simple_exclude=;; |
| 1802 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1803 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1804 | need_grep=1;; |
| 1805 | *) # No regexp or shell-pattern special character |
| 1806 | simple_exclude="*$EXCLUDE*";; |
| 1807 | esac |
| 1808 | if [ -n "$need_grep" ]; then |
| 1809 | is_excluded () { |
| 1810 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1811 | } |
| 1812 | else |
| 1813 | is_excluded () { |
| 1814 | case "$1" in |
| 1815 | $simple_exclude) true;; |
| 1816 | $simple_filter) false;; |
| 1817 | *) true;; |
| 1818 | esac |
| 1819 | } |
| 1820 | fi |
| 1821 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1822 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1823 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1824 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1825 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1826 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1827 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1828 | exit 1 |
| 1829 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1830 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1831 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1832 | exit 1 |
| 1833 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1834 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1835 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1836 | exit 1 |
| 1837 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1838 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1839 | if which valgrind >/dev/null 2>&1; then :; else |
| 1840 | echo "Memcheck not possible. Valgrind not found" |
| 1841 | exit 1 |
| 1842 | fi |
| 1843 | fi |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1844 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1845 | echo "Command '$OPENSSL' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1846 | exit 1 |
| 1847 | fi |
| 1848 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1849 | # used by watchdog |
| 1850 | MAIN_PID="$$" |
| 1851 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1852 | # We use somewhat arbitrary delays for tests: |
| 1853 | # - how long do we wait for the server to start (when lsof not available)? |
| 1854 | # - how long do we allow for the client to finish? |
| 1855 | # (not to check performance, just to avoid waiting indefinitely) |
| 1856 | # Things are slower with valgrind, so give extra time here. |
| 1857 | # |
| 1858 | # Note: without lsof, there is a trade-off between the running time of this |
| 1859 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1860 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1861 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1862 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1863 | START_DELAY=6 |
| 1864 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1865 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1866 | START_DELAY=2 |
| 1867 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1868 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1869 | |
| 1870 | # some particular tests need more time: |
| 1871 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1872 | # - for the server, we sleep for a number of seconds after the client exits |
| 1873 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1874 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1875 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1876 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1877 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 1878 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1879 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1880 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1881 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1882 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 1883 | 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"}" |
Gilles Peskine | 96f5bae | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 1884 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1885 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1886 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1887 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1888 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1889 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1890 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1891 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1892 | fi |
| 1893 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1894 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1895 | # low-security ones. This covers not just cipher suites but also protocol |
| 1896 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1897 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1898 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1899 | # a way to discover it from -help, so check the openssl version. |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 1900 | case $($OPENSSL version) in |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1901 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1902 | *) |
| 1903 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1904 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1905 | ;; |
| 1906 | esac |
| 1907 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1908 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1909 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1910 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 1911 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1912 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1913 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1914 | fi |
| 1915 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1916 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1917 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1918 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1919 | fi |
| 1920 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1921 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1922 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1923 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1924 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1925 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1926 | # Allow SHA-1, because many of our test certificates use it |
| 1927 | P_SRV="$P_SRV allow_sha1=1" |
| 1928 | P_CLI="$P_CLI allow_sha1=1" |
| 1929 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1930 | # Also pick a unique name for intermediate files |
| 1931 | SRV_OUT="srv_out.$$" |
| 1932 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1933 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1934 | SESSION="session.$$" |
| 1935 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1936 | SKIP_NEXT="NO" |
| 1937 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1938 | trap cleanup INT TERM HUP |
| 1939 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1940 | # Basic test |
| 1941 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1942 | # Checks that: |
| 1943 | # - 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] | 1944 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1945 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1946 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1947 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1948 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1949 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1950 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1951 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1952 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1953 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1954 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1955 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1956 | -S "error" \ |
| 1957 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1958 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1960 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1961 | run_test "Default, DTLS" \ |
| 1962 | "$P_SRV dtls=1" \ |
| 1963 | "$P_CLI dtls=1" \ |
| 1964 | 0 \ |
| 1965 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1966 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1967 | |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1968 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 1969 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 1970 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 1971 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 1972 | # client then detects the downgrade indication and aborts the handshake even |
| 1973 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 1974 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 1975 | # implementation that are otherwise not exercised. |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1976 | requires_gnutls_tls1_3 |
| 1977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1978 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1981 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 1982 | run_test "Server selecting TLS 1.2 over TLS 1.3" \ |
| 1983 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 1984 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 1985 | 1 \ |
| 1986 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 1987 | |
| 1988 | requires_gnutls_tls1_3 |
| 1989 | requires_config_enabled MBEDTLS_DEBUG_C |
| 1990 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 1991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1992 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 1993 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 1994 | run_test "Server selecting TLS 1.2" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 1995 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 1996 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 1997 | 0 \ |
| 1998 | -s "Protocol is TLSv1.2" \ |
| 1999 | -c "HTTP/1.0 200 OK" |
| 2000 | |
| 2001 | requires_gnutls_tls1_3 |
| 2002 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2003 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2005 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 2006 | run_test "Server selecting TLS 1.3, over TLS 1.2 if supported" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2007 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2008 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:%DISABLE_TLS13_COMPAT_MODE" \ |
| 2009 | 0 \ |
| 2010 | -s "Protocol is TLSv1.3" \ |
| 2011 | -c "HTTP/1.0 200 OK" |
| 2012 | |
| 2013 | requires_gnutls_tls1_3 |
| 2014 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2015 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2017 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 2018 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 2019 | run_test "Server selecting TLS 1.3, over TLS 1.2 if supported - compat mode enabled" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2020 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2021 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" \ |
| 2022 | 0 \ |
| 2023 | -s "Protocol is TLSv1.3" \ |
| 2024 | -c "HTTP/1.0 200 OK" |
| 2025 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2026 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2027 | run_test "TLS client auth: required" \ |
| 2028 | "$P_SRV auth_mode=required" \ |
| 2029 | "$P_CLI" \ |
| 2030 | 0 \ |
| 2031 | -s "Verifying peer X.509 certificate... ok" |
| 2032 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2033 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2034 | "$P_SRV" \ |
| 2035 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2036 | 0 \ |
| 2037 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2038 | -c "Key size is 256" |
| 2039 | |
| 2040 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2041 | "$P_SRV" \ |
| 2042 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2043 | 0 \ |
| 2044 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2045 | -c "Key size is 128" |
| 2046 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2048 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2049 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2050 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2051 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 2052 | 0 |
| 2053 | |
| 2054 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2055 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2056 | run_test "TLS: password protected server key" \ |
| 2057 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2058 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2059 | 0 |
| 2060 | |
| 2061 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2063 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2064 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2065 | "$P_SRV force_version=tls12\ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2066 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 2067 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 2068 | "$P_CLI" \ |
| 2069 | 0 |
| 2070 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2071 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2072 | run_test "CA callback on client" \ |
| 2073 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2074 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2075 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2076 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2077 | -S "error" \ |
| 2078 | -C "error" |
| 2079 | |
| 2080 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2081 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2082 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2083 | run_test "CA callback on server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2084 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2085 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 2086 | key_file=data_files/server5.key" \ |
| 2087 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2088 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2089 | -s "Verifying peer X.509 certificate... ok" \ |
| 2090 | -S "error" \ |
| 2091 | -C "error" |
| 2092 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2093 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2095 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2097 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2098 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2099 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server5.crt \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2100 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2101 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2102 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2103 | 0 \ |
| 2104 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2105 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2106 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2107 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2108 | -S "error" \ |
| 2109 | -C "error" |
| 2110 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2111 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2113 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2115 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2116 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2117 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2118 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2119 | key_file=data_files/server2.key" \ |
| 2120 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2121 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2122 | 0 \ |
| 2123 | -c "key type: Opaque" \ |
| 2124 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2125 | -s "Verifying peer X.509 certificate... ok" \ |
| 2126 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2127 | -S "error" \ |
| 2128 | -C "error" |
| 2129 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2131 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2132 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2133 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2134 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2135 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2136 | key_file=data_files/server2.key" \ |
| 2137 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2138 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2139 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2140 | 0 \ |
| 2141 | -c "key type: Opaque" \ |
| 2142 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2143 | -s "Verifying peer X.509 certificate... ok" \ |
| 2144 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2145 | -S "error" \ |
| 2146 | -C "error" |
| 2147 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2148 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2149 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2150 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2152 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2153 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2154 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2155 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2156 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2157 | 0 \ |
| 2158 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2159 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2160 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2161 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2162 | -S "error" \ |
| 2163 | -C "error" |
| 2164 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2165 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2166 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2167 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2168 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2169 | "$P_SRV auth_mode=required key_opaque=1\ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 2170 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2171 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2172 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2173 | 0 \ |
| 2174 | -c "Verifying peer X.509 certificate... ok" \ |
| 2175 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2176 | -s "key types: Opaque, none" \ |
| 2177 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2178 | -S "error" \ |
| 2179 | -C "error" |
| 2180 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2181 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2182 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2183 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2184 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2185 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 2186 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 2187 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2188 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2189 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2190 | 1 \ |
| 2191 | -s "key types: Opaque, none" \ |
| 2192 | -s "error" \ |
| 2193 | -c "error" \ |
| 2194 | -c "Public key type mismatch" |
| 2195 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2197 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2198 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2199 | requires_config_enabled MBEDTLS_RSA_C |
| 2200 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2201 | requires_hash_alg SHA_256 |
| 2202 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 2203 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2204 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2205 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2206 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2207 | 1 \ |
| 2208 | -s "key types: Opaque, none" \ |
| 2209 | -s "error" \ |
| 2210 | -c "error" \ |
| 2211 | -c "Public key type mismatch" |
| 2212 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2214 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2216 | requires_hash_alg SHA_256 |
| 2217 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2218 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2219 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2220 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2221 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2222 | 1 \ |
| 2223 | -s "key types: Opaque, none" \ |
| 2224 | -s "got ciphersuites in common, but none of them usable" \ |
| 2225 | -s "error" \ |
| 2226 | -c "error" |
| 2227 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2229 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2232 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2233 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2234 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2235 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2236 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2237 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2238 | 1 \ |
| 2239 | -s "key types: Opaque, none" \ |
| 2240 | -s "got ciphersuites in common, but none of them usable" \ |
| 2241 | -s "error" \ |
| 2242 | -c "error" |
| 2243 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2244 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2245 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2246 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2248 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2249 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2250 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2251 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2252 | "$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] | 2253 | 1 \ |
| 2254 | -s "key types: Opaque, none" \ |
| 2255 | -s "got ciphersuites in common, but none of them usable" \ |
| 2256 | -s "error" \ |
| 2257 | -c "error" |
| 2258 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2260 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2262 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2263 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2264 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2265 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2266 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2267 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2268 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2269 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2270 | 0 \ |
| 2271 | -c "Verifying peer X.509 certificate... ok" \ |
| 2272 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2273 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2274 | -s "key types: Opaque, Opaque" \ |
| 2275 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2276 | -S "error" \ |
| 2277 | -C "error" |
| 2278 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2280 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2281 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2282 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2283 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2284 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2285 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2286 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2287 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2288 | "$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] | 2289 | 0 \ |
| 2290 | -c "Verifying peer X.509 certificate... ok" \ |
| 2291 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2292 | -c "CN=Polarssl Test EC CA" \ |
| 2293 | -s "key types: Opaque, Opaque" \ |
| 2294 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2295 | -S "error" \ |
| 2296 | -C "error" |
| 2297 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2299 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2300 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2301 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2302 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2303 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2304 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2305 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2306 | crt_file2=data_files/server2-sha256.crt \ |
| 2307 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2308 | "$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] | 2309 | 0 \ |
| 2310 | -c "Verifying peer X.509 certificate... ok" \ |
| 2311 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2312 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2313 | -s "key types: Opaque, Opaque" \ |
| 2314 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2315 | -S "error" \ |
| 2316 | -C "error" |
| 2317 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2319 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2320 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2322 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2323 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2324 | "$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] | 2325 | "$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] | 2326 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2327 | -c "key type: Opaque" \ |
| 2328 | -s "key types: Opaque, Opaque" \ |
| 2329 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2330 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2331 | |
| 2332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2333 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2334 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2336 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2337 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2338 | "$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] | 2339 | "$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] | 2340 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2341 | -c "key type: Opaque" \ |
| 2342 | -s "key types: Opaque, Opaque" \ |
| 2343 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2344 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2345 | |
| 2346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2347 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2348 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2349 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2350 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2351 | 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] | 2352 | "$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] | 2353 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2354 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2355 | -s "key types: Opaque, Opaque" \ |
| 2356 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2357 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2358 | -C "error" \ |
| 2359 | -S "error" \ |
| 2360 | |
| 2361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2363 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2364 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2365 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2366 | 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] | 2367 | "$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] | 2368 | "$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] | 2369 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2370 | -c "key type: Opaque" \ |
| 2371 | -s "key types: Opaque, Opaque" \ |
| 2372 | -C "error" \ |
| 2373 | -S "error" \ |
| 2374 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2375 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2377 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2379 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2380 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2381 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2382 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2383 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2384 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2385 | 0 \ |
| 2386 | -c "Verifying peer X.509 certificate... ok" \ |
| 2387 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2388 | -s "key types: Opaque, none" \ |
| 2389 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2390 | -S "error" \ |
| 2391 | -C "error" |
| 2392 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2394 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2396 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2397 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2398 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2399 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2400 | "$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] | 2401 | 0 \ |
| 2402 | -c "Verifying peer X.509 certificate... ok" \ |
| 2403 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2404 | -s "key types: Opaque, none" \ |
| 2405 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2406 | -S "error" \ |
| 2407 | -C "error" |
| 2408 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2410 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2411 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2412 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2413 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2414 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2415 | psk=abc123 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2416 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2417 | psk=abc123 psk_identity=foo" \ |
| 2418 | 0 \ |
| 2419 | -c "Verifying peer X.509 certificate... ok" \ |
| 2420 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2421 | -s "key types: Opaque, Opaque" \ |
| 2422 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2423 | -S "error" \ |
| 2424 | -C "error" |
| 2425 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2426 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2427 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2428 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2429 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2430 | run_test "Opaque key for server authentication: RSA-" \ |
| 2431 | "$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] | 2432 | "$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] | 2433 | 0 \ |
| 2434 | -c "Verifying peer X.509 certificate... ok" \ |
| 2435 | -c "Ciphersuite is TLS-RSA-" \ |
| 2436 | -s "key types: Opaque, Opaque" \ |
| 2437 | -s "Ciphersuite is TLS-RSA-" \ |
| 2438 | -S "error" \ |
| 2439 | -C "error" |
| 2440 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2442 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2444 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2445 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2446 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2447 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2448 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2449 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2450 | 1 \ |
| 2451 | -s "key types: Opaque, none" \ |
| 2452 | -s "got ciphersuites in common, but none of them usable" \ |
| 2453 | -s "error" \ |
| 2454 | -c "error" |
| 2455 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2456 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2457 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2459 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2460 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2462 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2463 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2464 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2465 | crt_file2=data_files/server4.crt \ |
| 2466 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2467 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2468 | 0 \ |
| 2469 | -c "Verifying peer X.509 certificate... ok" \ |
| 2470 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2471 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2472 | -s "key types: Opaque, Opaque" \ |
| 2473 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2474 | -S "error" \ |
| 2475 | -C "error" |
| 2476 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2478 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2479 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2480 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2481 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2482 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2483 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2484 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2485 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2486 | crt_file2=data_files/server4.crt \ |
| 2487 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2488 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2489 | 0 \ |
| 2490 | -c "Verifying peer X.509 certificate... ok" \ |
| 2491 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2492 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2493 | -s "key types: Opaque, Opaque" \ |
| 2494 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2495 | -S "error" \ |
| 2496 | -C "error" |
| 2497 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2498 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2500 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2502 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2503 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2504 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2505 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2506 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2507 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2508 | 0 \ |
| 2509 | -c "key type: Opaque" \ |
| 2510 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2511 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2512 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2513 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2514 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2515 | -S "error" \ |
| 2516 | -C "error" |
| 2517 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2518 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2520 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2522 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2524 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2525 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2526 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2527 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2528 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2529 | 0 \ |
| 2530 | -c "key type: Opaque" \ |
| 2531 | -c "Verifying peer X.509 certificate... ok" \ |
| 2532 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2533 | -s "key types: Opaque, none" \ |
| 2534 | -s "Verifying peer X.509 certificate... ok" \ |
| 2535 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2536 | -S "error" \ |
| 2537 | -C "error" |
| 2538 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2540 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2542 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2543 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2544 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2545 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2546 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2547 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2548 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2549 | 0 \ |
| 2550 | -c "key type: Opaque" \ |
| 2551 | -c "Verifying peer X.509 certificate... ok" \ |
| 2552 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2553 | -s "key types: Opaque, none" \ |
| 2554 | -s "Verifying peer X.509 certificate... ok" \ |
| 2555 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2556 | -S "error" \ |
| 2557 | -C "error" |
| 2558 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2559 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2560 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2561 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2562 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2563 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2564 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2565 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2566 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2567 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2568 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2569 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2570 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2571 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2572 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2573 | run_test_psa_force_curve "secp521r1" |
| 2574 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2575 | run_test_psa_force_curve "brainpoolP512r1" |
| 2576 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2577 | run_test_psa_force_curve "secp384r1" |
| 2578 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2579 | run_test_psa_force_curve "brainpoolP384r1" |
| 2580 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2581 | run_test_psa_force_curve "secp256r1" |
| 2582 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2583 | run_test_psa_force_curve "secp256k1" |
| 2584 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2585 | run_test_psa_force_curve "brainpoolP256r1" |
| 2586 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2587 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2588 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2589 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2590 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2591 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2592 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2593 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2594 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2596 | run_test_psa_force_curve "secp192r1" |
| 2597 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2598 | run_test_psa_force_curve "secp192k1" |
| 2599 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2600 | # Test current time in ServerHello |
| 2601 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2602 | run_test "ServerHello contains gmt_unix_time" \ |
| 2603 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2604 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2605 | 0 \ |
| 2606 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2607 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2608 | |
| 2609 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2610 | run_test "Unique IV in GCM" \ |
| 2611 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2612 | "$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] | 2613 | 0 \ |
| 2614 | -u "IV used" \ |
| 2615 | -U "IV used" |
| 2616 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2617 | # Test for correctness of sent single supported algorithm |
| 2618 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2619 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2620 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2622 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2623 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2624 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2625 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2626 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2627 | "$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] | 2628 | 0 \ |
| 2629 | -c "Supported Signature Algorithm found: 04 03" |
| 2630 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2632 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2633 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2634 | requires_hash_alg SHA_256 |
| 2635 | run_test "Single supported algorithm sending: openssl client" \ |
| 2636 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2637 | "$O_CLI -cert data_files/server6.crt \ |
| 2638 | -key data_files/server6.key" \ |
| 2639 | 0 |
| 2640 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2641 | # Tests for certificate verification callback |
| 2642 | run_test "Configuration-specific CRT verification callback" \ |
| 2643 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2644 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2645 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2646 | -S "error" \ |
| 2647 | -c "Verify requested for " \ |
| 2648 | -c "Use configuration-specific verification callback" \ |
| 2649 | -C "Use context-specific verification callback" \ |
| 2650 | -C "error" |
| 2651 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2652 | run_test "Context-specific CRT verification callback" \ |
| 2653 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2654 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2655 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2656 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2657 | -c "Verify requested for " \ |
| 2658 | -c "Use context-specific verification callback" \ |
| 2659 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2660 | -C "error" |
| 2661 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2662 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2663 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2664 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2665 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2666 | 1 \ |
| 2667 | -c "The certificate is signed with an unacceptable hash" |
| 2668 | |
| 2669 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2670 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2671 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2672 | 0 |
| 2673 | |
| 2674 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2675 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2676 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2677 | 0 |
| 2678 | |
| 2679 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2680 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2681 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2682 | 1 \ |
| 2683 | -s "The certificate is signed with an unacceptable hash" |
| 2684 | |
| 2685 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2686 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2687 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2688 | 0 |
| 2689 | |
| 2690 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2691 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2692 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2693 | 0 |
| 2694 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2695 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2697 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2698 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2699 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2700 | 0 \ |
| 2701 | -c "next record in same datagram" \ |
| 2702 | -s "next record in same datagram" |
| 2703 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2705 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2706 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2707 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2708 | 0 \ |
| 2709 | -s "next record in same datagram" \ |
| 2710 | -C "next record in same datagram" |
| 2711 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2713 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2714 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2715 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2716 | 0 \ |
| 2717 | -S "next record in same datagram" \ |
| 2718 | -c "next record in same datagram" |
| 2719 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2721 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2722 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2723 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2724 | 0 \ |
| 2725 | -S "next record in same datagram" \ |
| 2726 | -C "next record in same datagram" |
| 2727 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2728 | # Tests for Context serialization |
| 2729 | |
| 2730 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2731 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2732 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2733 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2734 | 0 \ |
| 2735 | -c "Deserializing connection..." \ |
| 2736 | -S "Deserializing connection..." |
| 2737 | |
| 2738 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2739 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2740 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2741 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2742 | 0 \ |
| 2743 | -c "Deserializing connection..." \ |
| 2744 | -S "Deserializing connection..." |
| 2745 | |
| 2746 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2747 | run_test "Context serialization, client serializes, GCM" \ |
| 2748 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2749 | "$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] | 2750 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2751 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2752 | -S "Deserializing connection..." |
| 2753 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2755 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2757 | run_test "Context serialization, client serializes, with CID" \ |
| 2758 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2759 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2760 | 0 \ |
| 2761 | -c "Deserializing connection..." \ |
| 2762 | -S "Deserializing connection..." |
| 2763 | |
| 2764 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2765 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2766 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2767 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2768 | 0 \ |
| 2769 | -C "Deserializing connection..." \ |
| 2770 | -s "Deserializing connection..." |
| 2771 | |
| 2772 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2773 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2774 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2775 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2776 | 0 \ |
| 2777 | -C "Deserializing connection..." \ |
| 2778 | -s "Deserializing connection..." |
| 2779 | |
| 2780 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2781 | run_test "Context serialization, server serializes, GCM" \ |
| 2782 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2783 | "$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] | 2784 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2785 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2786 | -s "Deserializing connection..." |
| 2787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2790 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2791 | run_test "Context serialization, server serializes, with CID" \ |
| 2792 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2793 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2794 | 0 \ |
| 2795 | -C "Deserializing connection..." \ |
| 2796 | -s "Deserializing connection..." |
| 2797 | |
| 2798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2799 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2800 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2801 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2802 | 0 \ |
| 2803 | -c "Deserializing connection..." \ |
| 2804 | -s "Deserializing connection..." |
| 2805 | |
| 2806 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2807 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2808 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2809 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2810 | 0 \ |
| 2811 | -c "Deserializing connection..." \ |
| 2812 | -s "Deserializing connection..." |
| 2813 | |
| 2814 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2815 | run_test "Context serialization, both serialize, GCM" \ |
| 2816 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2817 | "$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] | 2818 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2819 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2820 | -s "Deserializing connection..." |
| 2821 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2824 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2825 | run_test "Context serialization, both serialize, with CID" \ |
| 2826 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2827 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2828 | 0 \ |
| 2829 | -c "Deserializing connection..." \ |
| 2830 | -s "Deserializing connection..." |
| 2831 | |
| 2832 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2833 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2834 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2835 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2836 | 0 \ |
| 2837 | -c "Deserializing connection..." \ |
| 2838 | -S "Deserializing connection..." |
| 2839 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2841 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2842 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2843 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2844 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2845 | 0 \ |
| 2846 | -c "Deserializing connection..." \ |
| 2847 | -S "Deserializing connection..." |
| 2848 | |
| 2849 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2850 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2851 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2852 | "$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] | 2853 | 0 \ |
| 2854 | -c "Deserializing connection..." \ |
| 2855 | -S "Deserializing connection..." |
| 2856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2858 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2859 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2860 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2861 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2862 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2863 | 0 \ |
| 2864 | -c "Deserializing connection..." \ |
| 2865 | -S "Deserializing connection..." |
| 2866 | |
| 2867 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2868 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2869 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2870 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2871 | 0 \ |
| 2872 | -C "Deserializing connection..." \ |
| 2873 | -s "Deserializing connection..." |
| 2874 | |
| 2875 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2876 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2877 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2878 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2879 | 0 \ |
| 2880 | -C "Deserializing connection..." \ |
| 2881 | -s "Deserializing connection..." |
| 2882 | |
| 2883 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2884 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2885 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2886 | "$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] | 2887 | 0 \ |
| 2888 | -C "Deserializing connection..." \ |
| 2889 | -s "Deserializing connection..." |
| 2890 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2893 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2894 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2895 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2896 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2897 | 0 \ |
| 2898 | -C "Deserializing connection..." \ |
| 2899 | -s "Deserializing connection..." |
| 2900 | |
| 2901 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2902 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2903 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2904 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2905 | 0 \ |
| 2906 | -c "Deserializing connection..." \ |
| 2907 | -s "Deserializing connection..." |
| 2908 | |
| 2909 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2910 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2911 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2912 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2913 | 0 \ |
| 2914 | -c "Deserializing connection..." \ |
| 2915 | -s "Deserializing connection..." |
| 2916 | |
| 2917 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2918 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2919 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2920 | "$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] | 2921 | 0 \ |
| 2922 | -c "Deserializing connection..." \ |
| 2923 | -s "Deserializing connection..." |
| 2924 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2926 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2927 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2928 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2929 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2930 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2931 | 0 \ |
| 2932 | -c "Deserializing connection..." \ |
| 2933 | -s "Deserializing connection..." |
| 2934 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2936 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2937 | run_test "Saving the serialized context to a file" \ |
| 2938 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2939 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2940 | 0 \ |
| 2941 | -s "Save serialized context to a file... ok" \ |
| 2942 | -c "Save serialized context to a file... ok" |
| 2943 | rm -f context_srv.txt |
| 2944 | rm -f context_cli.txt |
| 2945 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2946 | # Tests for DTLS Connection ID extension |
| 2947 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2948 | # So far, the CID API isn't implemented, so we can't |
| 2949 | # grep for output witnessing its use. This needs to be |
| 2950 | # changed once the CID extension is implemented. |
| 2951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2953 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2954 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2955 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2956 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2957 | 0 \ |
| 2958 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2959 | -s "found CID extension" \ |
| 2960 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2961 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2962 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2963 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2964 | -C "found CID extension" \ |
| 2965 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2966 | -C "Copy CIDs into SSL transform" \ |
| 2967 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2968 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2971 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2972 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2973 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2974 | 0 \ |
| 2975 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2976 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2977 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2978 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2979 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2980 | -C "found CID extension" \ |
| 2981 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2982 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2983 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2984 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2987 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2988 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2989 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2990 | 0 \ |
| 2991 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2992 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2993 | -c "client hello, adding CID extension" \ |
| 2994 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2995 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2996 | -s "server hello, adding CID extension" \ |
| 2997 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2998 | -c "Use of CID extension negotiated" \ |
| 2999 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3000 | -c "Copy CIDs into SSL transform" \ |
| 3001 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3002 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3003 | -s "Use of Connection ID has been negotiated" \ |
| 3004 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3005 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3007 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3008 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3009 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3010 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3011 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3012 | 0 \ |
| 3013 | -c "Enable use of CID extension." \ |
| 3014 | -s "Enable use of CID extension." \ |
| 3015 | -c "client hello, adding CID extension" \ |
| 3016 | -s "found CID extension" \ |
| 3017 | -s "Use of CID extension negotiated" \ |
| 3018 | -s "server hello, adding CID extension" \ |
| 3019 | -c "found CID extension" \ |
| 3020 | -c "Use of CID extension negotiated" \ |
| 3021 | -s "Copy CIDs into SSL transform" \ |
| 3022 | -c "Copy CIDs into SSL transform" \ |
| 3023 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3024 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3025 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3026 | -c "Use of Connection ID has been negotiated" \ |
| 3027 | -c "ignoring unexpected CID" \ |
| 3028 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3032 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3033 | -p "$P_PXY mtu=800" \ |
| 3034 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3035 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3036 | 0 \ |
| 3037 | -c "Enable use of CID extension." \ |
| 3038 | -s "Enable use of CID extension." \ |
| 3039 | -c "client hello, adding CID extension" \ |
| 3040 | -s "found CID extension" \ |
| 3041 | -s "Use of CID extension negotiated" \ |
| 3042 | -s "server hello, adding CID extension" \ |
| 3043 | -c "found CID extension" \ |
| 3044 | -c "Use of CID extension negotiated" \ |
| 3045 | -s "Copy CIDs into SSL transform" \ |
| 3046 | -c "Copy CIDs into SSL transform" \ |
| 3047 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3048 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3049 | -s "Use of Connection ID has been negotiated" \ |
| 3050 | -c "Use of Connection ID has been negotiated" |
| 3051 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3054 | 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] | 3055 | -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] | 3056 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3057 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3058 | 0 \ |
| 3059 | -c "Enable use of CID extension." \ |
| 3060 | -s "Enable use of CID extension." \ |
| 3061 | -c "client hello, adding CID extension" \ |
| 3062 | -s "found CID extension" \ |
| 3063 | -s "Use of CID extension negotiated" \ |
| 3064 | -s "server hello, adding CID extension" \ |
| 3065 | -c "found CID extension" \ |
| 3066 | -c "Use of CID extension negotiated" \ |
| 3067 | -s "Copy CIDs into SSL transform" \ |
| 3068 | -c "Copy CIDs into SSL transform" \ |
| 3069 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3070 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3071 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3072 | -c "Use of Connection ID has been negotiated" \ |
| 3073 | -c "ignoring unexpected CID" \ |
| 3074 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3078 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3079 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3080 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3081 | 0 \ |
| 3082 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3083 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3084 | -c "client hello, adding CID extension" \ |
| 3085 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3086 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3087 | -s "server hello, adding CID extension" \ |
| 3088 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3089 | -c "Use of CID extension negotiated" \ |
| 3090 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3091 | -c "Copy CIDs into SSL transform" \ |
| 3092 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3093 | -s "Peer CID (length 0 Bytes):" \ |
| 3094 | -s "Use of Connection ID has been negotiated" \ |
| 3095 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3099 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3100 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3101 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3102 | 0 \ |
| 3103 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3104 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3105 | -c "client hello, adding CID extension" \ |
| 3106 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3107 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3108 | -s "server hello, adding CID extension" \ |
| 3109 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3110 | -c "Use of CID extension negotiated" \ |
| 3111 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3112 | -c "Copy CIDs into SSL transform" \ |
| 3113 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3114 | -c "Peer CID (length 0 Bytes):" \ |
| 3115 | -s "Use of Connection ID has been negotiated" \ |
| 3116 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3120 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3121 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3122 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3123 | 0 \ |
| 3124 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3125 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3126 | -c "client hello, adding CID extension" \ |
| 3127 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3128 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3129 | -s "server hello, adding CID extension" \ |
| 3130 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3131 | -c "Use of CID extension negotiated" \ |
| 3132 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3133 | -c "Copy CIDs into SSL transform" \ |
| 3134 | -S "Use of Connection ID has been negotiated" \ |
| 3135 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3136 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3138 | 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] | 3139 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3140 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3141 | 0 \ |
| 3142 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3143 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3144 | -c "client hello, adding CID extension" \ |
| 3145 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3146 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3147 | -s "server hello, adding CID extension" \ |
| 3148 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3149 | -c "Use of CID extension negotiated" \ |
| 3150 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3151 | -c "Copy CIDs into SSL transform" \ |
| 3152 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3153 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3154 | -s "Use of Connection ID has been negotiated" \ |
| 3155 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3156 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3158 | 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] | 3159 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3160 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3161 | 0 \ |
| 3162 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3163 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3164 | -c "client hello, adding CID extension" \ |
| 3165 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3166 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3167 | -s "server hello, adding CID extension" \ |
| 3168 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3169 | -c "Use of CID extension negotiated" \ |
| 3170 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3171 | -c "Copy CIDs into SSL transform" \ |
| 3172 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3173 | -s "Peer CID (length 0 Bytes):" \ |
| 3174 | -s "Use of Connection ID has been negotiated" \ |
| 3175 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3176 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3177 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3178 | 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] | 3179 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3180 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3181 | 0 \ |
| 3182 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3183 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3184 | -c "client hello, adding CID extension" \ |
| 3185 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3186 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3187 | -s "server hello, adding CID extension" \ |
| 3188 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3189 | -c "Use of CID extension negotiated" \ |
| 3190 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3191 | -c "Copy CIDs into SSL transform" \ |
| 3192 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3193 | -c "Peer CID (length 0 Bytes):" \ |
| 3194 | -s "Use of Connection ID has been negotiated" \ |
| 3195 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3196 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3198 | 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] | 3199 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3200 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3201 | 0 \ |
| 3202 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3203 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3204 | -c "client hello, adding CID extension" \ |
| 3205 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3206 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3207 | -s "server hello, adding CID extension" \ |
| 3208 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3209 | -c "Use of CID extension negotiated" \ |
| 3210 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3211 | -c "Copy CIDs into SSL transform" \ |
| 3212 | -S "Use of Connection ID has been negotiated" \ |
| 3213 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3214 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3215 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3216 | 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] | 3217 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3218 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3219 | 0 \ |
| 3220 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3221 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3222 | -c "client hello, adding CID extension" \ |
| 3223 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3224 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3225 | -s "server hello, adding CID extension" \ |
| 3226 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3227 | -c "Use of CID extension negotiated" \ |
| 3228 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3229 | -c "Copy CIDs into SSL transform" \ |
| 3230 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3231 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3232 | -s "Use of Connection ID has been negotiated" \ |
| 3233 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3234 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3236 | 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] | 3237 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3238 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3239 | 0 \ |
| 3240 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3241 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3242 | -c "client hello, adding CID extension" \ |
| 3243 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3244 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3245 | -s "server hello, adding CID extension" \ |
| 3246 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3247 | -c "Use of CID extension negotiated" \ |
| 3248 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3249 | -c "Copy CIDs into SSL transform" \ |
| 3250 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3251 | -s "Peer CID (length 0 Bytes):" \ |
| 3252 | -s "Use of Connection ID has been negotiated" \ |
| 3253 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3254 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3255 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3256 | 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] | 3257 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3258 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3259 | 0 \ |
| 3260 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3261 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3262 | -c "client hello, adding CID extension" \ |
| 3263 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3264 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3265 | -s "server hello, adding CID extension" \ |
| 3266 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3267 | -c "Use of CID extension negotiated" \ |
| 3268 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3269 | -c "Copy CIDs into SSL transform" \ |
| 3270 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3271 | -c "Peer CID (length 0 Bytes):" \ |
| 3272 | -s "Use of Connection ID has been negotiated" \ |
| 3273 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3274 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3275 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3276 | 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] | 3277 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3278 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3279 | 0 \ |
| 3280 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3281 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3282 | -c "client hello, adding CID extension" \ |
| 3283 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3284 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3285 | -s "server hello, adding CID extension" \ |
| 3286 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3287 | -c "Use of CID extension negotiated" \ |
| 3288 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3289 | -c "Copy CIDs into SSL transform" \ |
| 3290 | -S "Use of Connection ID has been negotiated" \ |
| 3291 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3292 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3294 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3295 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3296 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3297 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3298 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3299 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3300 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3301 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3302 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3303 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3304 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3305 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3306 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3307 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3308 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3312 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3313 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3314 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3315 | 0 \ |
| 3316 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3317 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3318 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3319 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3320 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3321 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3322 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3323 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3324 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3326 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3328 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3329 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3330 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3331 | 0 \ |
| 3332 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3333 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3334 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3335 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3336 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3337 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3338 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3339 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3340 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3344 | 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] | 3345 | -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] | 3346 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3347 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3348 | 0 \ |
| 3349 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3350 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3351 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3352 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3353 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3354 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3355 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3356 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3357 | -c "ignoring unexpected CID" \ |
| 3358 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3359 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3363 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3364 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3365 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3366 | 0 \ |
| 3367 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3368 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3369 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3370 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3371 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3372 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3373 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3374 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3375 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3378 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3379 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3380 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3381 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3382 | 0 \ |
| 3383 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3384 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3385 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3386 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3387 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3388 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3389 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3390 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3391 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3393 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3395 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3396 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3397 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3398 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3399 | 0 \ |
| 3400 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3401 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3402 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3403 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3404 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3405 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3406 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3407 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3408 | -c "ignoring unexpected CID" \ |
| 3409 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3412 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3413 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3414 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3415 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3416 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3417 | 0 \ |
| 3418 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3419 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3420 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3421 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3422 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3423 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3424 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3426 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3428 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3429 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3430 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3431 | 0 \ |
| 3432 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3433 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3434 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3435 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3436 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3437 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3442 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3443 | -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] | 3444 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3445 | "$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" \ |
| 3446 | 0 \ |
| 3447 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3448 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3449 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3450 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3451 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3452 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3453 | -c "ignoring unexpected CID" \ |
| 3454 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3457 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3459 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3460 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3461 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3462 | 0 \ |
| 3463 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3464 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3465 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3466 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3467 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3468 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3469 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3470 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3471 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3472 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3476 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3477 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3478 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3479 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3480 | 0 \ |
| 3481 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3482 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3483 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3484 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3485 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3486 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3487 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3488 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3489 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3490 | -c "ignoring unexpected CID" \ |
| 3491 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3492 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3494 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3496 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3497 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3498 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3499 | 0 \ |
| 3500 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3501 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3502 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3503 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3504 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3505 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3506 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3507 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3508 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3511 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3513 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3514 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3515 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3516 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3517 | 0 \ |
| 3518 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3519 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3520 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3521 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3522 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3523 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3524 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3525 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3526 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3527 | -c "ignoring unexpected CID" \ |
| 3528 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3529 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3530 | # 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] | 3531 | # tests check that the buffer contents are reallocated when the message is |
| 3532 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3534 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3535 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3536 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3537 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3538 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3539 | 0 \ |
| 3540 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3541 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3542 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3543 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3544 | -s "Reallocating in_buf" \ |
| 3545 | -s "Reallocating out_buf" |
| 3546 | |
| 3547 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3548 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3549 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3550 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3551 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3552 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3553 | 0 \ |
| 3554 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3555 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3556 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3557 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3558 | -s "Reallocating in_buf" \ |
| 3559 | -s "Reallocating out_buf" |
| 3560 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3561 | # Tests for Encrypt-then-MAC extension |
| 3562 | |
| 3563 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3564 | "$P_SRV debug_level=3 \ |
| 3565 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3566 | "$P_CLI debug_level=3" \ |
| 3567 | 0 \ |
| 3568 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3569 | -s "found encrypt then mac extension" \ |
| 3570 | -s "server hello, adding encrypt then mac extension" \ |
| 3571 | -c "found encrypt_then_mac extension" \ |
| 3572 | -c "using encrypt then mac" \ |
| 3573 | -s "using encrypt then mac" |
| 3574 | |
| 3575 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3576 | "$P_SRV debug_level=3 etm=0 \ |
| 3577 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3578 | "$P_CLI debug_level=3 etm=1" \ |
| 3579 | 0 \ |
| 3580 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3581 | -s "found encrypt then mac extension" \ |
| 3582 | -S "server hello, adding encrypt then mac extension" \ |
| 3583 | -C "found encrypt_then_mac extension" \ |
| 3584 | -C "using encrypt then mac" \ |
| 3585 | -S "using encrypt then mac" |
| 3586 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3587 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3588 | "$P_SRV debug_level=3 etm=1 \ |
| 3589 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3590 | "$P_CLI debug_level=3 etm=1" \ |
| 3591 | 0 \ |
| 3592 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3593 | -s "found encrypt then mac extension" \ |
| 3594 | -S "server hello, adding encrypt then mac extension" \ |
| 3595 | -C "found encrypt_then_mac extension" \ |
| 3596 | -C "using encrypt then mac" \ |
| 3597 | -S "using encrypt then mac" |
| 3598 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3599 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3600 | "$P_SRV debug_level=3 etm=1 \ |
| 3601 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3602 | "$P_CLI debug_level=3 etm=0" \ |
| 3603 | 0 \ |
| 3604 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3605 | -S "found encrypt then mac extension" \ |
| 3606 | -S "server hello, adding encrypt then mac extension" \ |
| 3607 | -C "found encrypt_then_mac extension" \ |
| 3608 | -C "using encrypt then mac" \ |
| 3609 | -S "using encrypt then mac" |
| 3610 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3611 | # Tests for Extended Master Secret extension |
| 3612 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3614 | run_test "Extended Master Secret: default" \ |
| 3615 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3616 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3617 | 0 \ |
| 3618 | -c "client hello, adding extended_master_secret extension" \ |
| 3619 | -s "found extended master secret extension" \ |
| 3620 | -s "server hello, adding extended master secret extension" \ |
| 3621 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3622 | -c "session hash for extended master secret" \ |
| 3623 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3624 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3626 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3627 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3628 | "$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] | 3629 | 0 \ |
| 3630 | -c "client hello, adding extended_master_secret extension" \ |
| 3631 | -s "found extended master secret extension" \ |
| 3632 | -S "server hello, adding extended master secret extension" \ |
| 3633 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3634 | -C "session hash for extended master secret" \ |
| 3635 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3636 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3637 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3638 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3639 | "$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] | 3640 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3641 | 0 \ |
| 3642 | -C "client hello, adding extended_master_secret extension" \ |
| 3643 | -S "found extended master secret extension" \ |
| 3644 | -S "server hello, adding extended master secret extension" \ |
| 3645 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3646 | -C "session hash for extended master secret" \ |
| 3647 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3648 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3649 | # Test sending and receiving empty application data records |
| 3650 | |
| 3651 | run_test "Encrypt then MAC: empty application data record" \ |
| 3652 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3653 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3654 | 0 \ |
| 3655 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3656 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3657 | -c "0 bytes written in 1 fragments" |
| 3658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3660 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3661 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3662 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3663 | 0 \ |
| 3664 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3665 | -c "0 bytes written in 1 fragments" |
| 3666 | |
| 3667 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3668 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3669 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3670 | 0 \ |
| 3671 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3672 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3673 | -c "0 bytes written in 1 fragments" |
| 3674 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3676 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3677 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3678 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3679 | 0 \ |
| 3680 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3681 | -c "0 bytes written in 1 fragments" |
| 3682 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3683 | # Tests for CBC 1/n-1 record splitting |
| 3684 | |
| 3685 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3686 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3687 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3688 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3689 | 0 \ |
| 3690 | -s "Read from client: 123 bytes read" \ |
| 3691 | -S "Read from client: 1 bytes read" \ |
| 3692 | -S "122 bytes read" |
| 3693 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3694 | # Tests for Session Tickets |
| 3695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3696 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3697 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3698 | "$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] | 3699 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3700 | -c "client hello, adding session ticket extension" \ |
| 3701 | -s "found session ticket extension" \ |
| 3702 | -s "server hello, adding session ticket extension" \ |
| 3703 | -c "found session_ticket extension" \ |
| 3704 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3705 | -S "session successfully restored from cache" \ |
| 3706 | -s "session successfully restored from ticket" \ |
| 3707 | -s "a session has been resumed" \ |
| 3708 | -c "a session has been resumed" |
| 3709 | |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3710 | run_test "Session resume using tickets: manual rotation" \ |
| 3711 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3712 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3713 | 0 \ |
| 3714 | -c "client hello, adding session ticket extension" \ |
| 3715 | -s "found session ticket extension" \ |
| 3716 | -s "server hello, adding session ticket extension" \ |
| 3717 | -c "found session_ticket extension" \ |
| 3718 | -c "parse new session ticket" \ |
| 3719 | -S "session successfully restored from cache" \ |
| 3720 | -s "session successfully restored from ticket" \ |
| 3721 | -s "a session has been resumed" \ |
| 3722 | -c "a session has been resumed" |
| 3723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3724 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3725 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3726 | "$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] | 3727 | 0 \ |
| 3728 | -c "client hello, adding session ticket extension" \ |
| 3729 | -s "found session ticket extension" \ |
| 3730 | -s "server hello, adding session ticket extension" \ |
| 3731 | -c "found session_ticket extension" \ |
| 3732 | -c "parse new session ticket" \ |
| 3733 | -S "session successfully restored from cache" \ |
| 3734 | -s "session successfully restored from ticket" \ |
| 3735 | -s "a session has been resumed" \ |
| 3736 | -c "a session has been resumed" |
| 3737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3738 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3739 | "$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] | 3740 | "$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] | 3741 | 0 \ |
| 3742 | -c "client hello, adding session ticket extension" \ |
| 3743 | -s "found session ticket extension" \ |
| 3744 | -s "server hello, adding session ticket extension" \ |
| 3745 | -c "found session_ticket extension" \ |
| 3746 | -c "parse new session ticket" \ |
| 3747 | -S "session successfully restored from cache" \ |
| 3748 | -S "session successfully restored from ticket" \ |
| 3749 | -S "a session has been resumed" \ |
| 3750 | -C "a session has been resumed" |
| 3751 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3752 | run_test "Session resume using tickets: session copy" \ |
| 3753 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3754 | "$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] | 3755 | 0 \ |
| 3756 | -c "client hello, adding session ticket extension" \ |
| 3757 | -s "found session ticket extension" \ |
| 3758 | -s "server hello, adding session ticket extension" \ |
| 3759 | -c "found session_ticket extension" \ |
| 3760 | -c "parse new session ticket" \ |
| 3761 | -S "session successfully restored from cache" \ |
| 3762 | -s "session successfully restored from ticket" \ |
| 3763 | -s "a session has been resumed" \ |
| 3764 | -c "a session has been resumed" |
| 3765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3767 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3768 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3769 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3770 | 0 \ |
| 3771 | -c "client hello, adding session ticket extension" \ |
| 3772 | -c "found session_ticket extension" \ |
| 3773 | -c "parse new session ticket" \ |
| 3774 | -c "a session has been resumed" |
| 3775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3777 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3778 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3779 | "( $O_CLI -sess_out $SESSION; \ |
| 3780 | $O_CLI -sess_in $SESSION; \ |
| 3781 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3782 | 0 \ |
| 3783 | -s "found session ticket extension" \ |
| 3784 | -s "server hello, adding session ticket extension" \ |
| 3785 | -S "session successfully restored from cache" \ |
| 3786 | -s "session successfully restored from ticket" \ |
| 3787 | -s "a session has been resumed" |
| 3788 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3789 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3790 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3791 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3792 | 0 \ |
| 3793 | -c "client hello, adding session ticket extension" \ |
| 3794 | -s "found session ticket extension" \ |
| 3795 | -s "server hello, adding session ticket extension" \ |
| 3796 | -c "found session_ticket extension" \ |
| 3797 | -c "parse new session ticket" \ |
| 3798 | -S "session successfully restored from cache" \ |
| 3799 | -s "session successfully restored from ticket" \ |
| 3800 | -s "a session has been resumed" \ |
| 3801 | -c "a session has been resumed" |
| 3802 | |
| 3803 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3804 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3805 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3806 | 0 \ |
| 3807 | -c "client hello, adding session ticket extension" \ |
| 3808 | -s "found session ticket extension" \ |
| 3809 | -s "server hello, adding session ticket extension" \ |
| 3810 | -c "found session_ticket extension" \ |
| 3811 | -c "parse new session ticket" \ |
| 3812 | -S "session successfully restored from cache" \ |
| 3813 | -s "session successfully restored from ticket" \ |
| 3814 | -s "a session has been resumed" \ |
| 3815 | -c "a session has been resumed" |
| 3816 | |
| 3817 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3818 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3819 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3820 | 0 \ |
| 3821 | -c "client hello, adding session ticket extension" \ |
| 3822 | -s "found session ticket extension" \ |
| 3823 | -s "server hello, adding session ticket extension" \ |
| 3824 | -c "found session_ticket extension" \ |
| 3825 | -c "parse new session ticket" \ |
| 3826 | -S "session successfully restored from cache" \ |
| 3827 | -s "session successfully restored from ticket" \ |
| 3828 | -s "a session has been resumed" \ |
| 3829 | -c "a session has been resumed" |
| 3830 | |
| 3831 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3832 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3833 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3834 | 0 \ |
| 3835 | -c "client hello, adding session ticket extension" \ |
| 3836 | -s "found session ticket extension" \ |
| 3837 | -s "server hello, adding session ticket extension" \ |
| 3838 | -c "found session_ticket extension" \ |
| 3839 | -c "parse new session ticket" \ |
| 3840 | -S "session successfully restored from cache" \ |
| 3841 | -s "session successfully restored from ticket" \ |
| 3842 | -s "a session has been resumed" \ |
| 3843 | -c "a session has been resumed" |
| 3844 | |
| 3845 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3846 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3847 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3848 | 0 \ |
| 3849 | -c "client hello, adding session ticket extension" \ |
| 3850 | -s "found session ticket extension" \ |
| 3851 | -s "server hello, adding session ticket extension" \ |
| 3852 | -c "found session_ticket extension" \ |
| 3853 | -c "parse new session ticket" \ |
| 3854 | -S "session successfully restored from cache" \ |
| 3855 | -s "session successfully restored from ticket" \ |
| 3856 | -s "a session has been resumed" \ |
| 3857 | -c "a session has been resumed" |
| 3858 | |
| 3859 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3860 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3861 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3862 | 0 \ |
| 3863 | -c "client hello, adding session ticket extension" \ |
| 3864 | -s "found session ticket extension" \ |
| 3865 | -s "server hello, adding session ticket extension" \ |
| 3866 | -c "found session_ticket extension" \ |
| 3867 | -c "parse new session ticket" \ |
| 3868 | -S "session successfully restored from cache" \ |
| 3869 | -s "session successfully restored from ticket" \ |
| 3870 | -s "a session has been resumed" \ |
| 3871 | -c "a session has been resumed" |
| 3872 | |
| 3873 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3874 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3875 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3876 | 0 \ |
| 3877 | -c "client hello, adding session ticket extension" \ |
| 3878 | -s "found session ticket extension" \ |
| 3879 | -s "server hello, adding session ticket extension" \ |
| 3880 | -c "found session_ticket extension" \ |
| 3881 | -c "parse new session ticket" \ |
| 3882 | -S "session successfully restored from cache" \ |
| 3883 | -s "session successfully restored from ticket" \ |
| 3884 | -s "a session has been resumed" \ |
| 3885 | -c "a session has been resumed" |
| 3886 | |
| 3887 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3888 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3889 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3890 | 0 \ |
| 3891 | -c "client hello, adding session ticket extension" \ |
| 3892 | -s "found session ticket extension" \ |
| 3893 | -s "server hello, adding session ticket extension" \ |
| 3894 | -c "found session_ticket extension" \ |
| 3895 | -c "parse new session ticket" \ |
| 3896 | -S "session successfully restored from cache" \ |
| 3897 | -s "session successfully restored from ticket" \ |
| 3898 | -s "a session has been resumed" \ |
| 3899 | -c "a session has been resumed" |
| 3900 | |
| 3901 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3902 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3903 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3904 | 0 \ |
| 3905 | -c "client hello, adding session ticket extension" \ |
| 3906 | -s "found session ticket extension" \ |
| 3907 | -s "server hello, adding session ticket extension" \ |
| 3908 | -c "found session_ticket extension" \ |
| 3909 | -c "parse new session ticket" \ |
| 3910 | -S "session successfully restored from cache" \ |
| 3911 | -s "session successfully restored from ticket" \ |
| 3912 | -s "a session has been resumed" \ |
| 3913 | -c "a session has been resumed" |
| 3914 | |
| 3915 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3916 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3917 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3918 | 0 \ |
| 3919 | -c "client hello, adding session ticket extension" \ |
| 3920 | -s "found session ticket extension" \ |
| 3921 | -s "server hello, adding session ticket extension" \ |
| 3922 | -c "found session_ticket extension" \ |
| 3923 | -c "parse new session ticket" \ |
| 3924 | -S "session successfully restored from cache" \ |
| 3925 | -s "session successfully restored from ticket" \ |
| 3926 | -s "a session has been resumed" \ |
| 3927 | -c "a session has been resumed" |
| 3928 | |
| 3929 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3930 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3931 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3932 | 0 \ |
| 3933 | -c "client hello, adding session ticket extension" \ |
| 3934 | -s "found session ticket extension" \ |
| 3935 | -s "server hello, adding session ticket extension" \ |
| 3936 | -c "found session_ticket extension" \ |
| 3937 | -c "parse new session ticket" \ |
| 3938 | -S "session successfully restored from cache" \ |
| 3939 | -s "session successfully restored from ticket" \ |
| 3940 | -s "a session has been resumed" \ |
| 3941 | -c "a session has been resumed" |
| 3942 | |
| 3943 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3944 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3945 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3946 | 0 \ |
| 3947 | -c "client hello, adding session ticket extension" \ |
| 3948 | -s "found session ticket extension" \ |
| 3949 | -s "server hello, adding session ticket extension" \ |
| 3950 | -c "found session_ticket extension" \ |
| 3951 | -c "parse new session ticket" \ |
| 3952 | -S "session successfully restored from cache" \ |
| 3953 | -s "session successfully restored from ticket" \ |
| 3954 | -s "a session has been resumed" \ |
| 3955 | -c "a session has been resumed" |
| 3956 | |
| 3957 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3958 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3959 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3960 | 0 \ |
| 3961 | -c "client hello, adding session ticket extension" \ |
| 3962 | -s "found session ticket extension" \ |
| 3963 | -s "server hello, adding session ticket extension" \ |
| 3964 | -c "found session_ticket extension" \ |
| 3965 | -c "parse new session ticket" \ |
| 3966 | -S "session successfully restored from cache" \ |
| 3967 | -s "session successfully restored from ticket" \ |
| 3968 | -s "a session has been resumed" \ |
| 3969 | -c "a session has been resumed" |
| 3970 | |
| 3971 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3972 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3973 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3974 | 0 \ |
| 3975 | -c "client hello, adding session ticket extension" \ |
| 3976 | -s "found session ticket extension" \ |
| 3977 | -s "server hello, adding session ticket extension" \ |
| 3978 | -c "found session_ticket extension" \ |
| 3979 | -c "parse new session ticket" \ |
| 3980 | -S "session successfully restored from cache" \ |
| 3981 | -s "session successfully restored from ticket" \ |
| 3982 | -s "a session has been resumed" \ |
| 3983 | -c "a session has been resumed" |
| 3984 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3985 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3986 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3987 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3988 | 0 \ |
| 3989 | -c "client hello, adding session ticket extension" \ |
| 3990 | -s "found session ticket extension" \ |
| 3991 | -s "server hello, adding session ticket extension" \ |
| 3992 | -c "found session_ticket extension" \ |
| 3993 | -c "parse new session ticket" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" \ |
| 3997 | -c "a session has been resumed" |
| 3998 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3999 | # Tests for Session Tickets with DTLS |
| 4000 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4002 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4003 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4004 | "$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] | 4005 | 0 \ |
| 4006 | -c "client hello, adding session ticket extension" \ |
| 4007 | -s "found session ticket extension" \ |
| 4008 | -s "server hello, adding session ticket extension" \ |
| 4009 | -c "found session_ticket extension" \ |
| 4010 | -c "parse new session ticket" \ |
| 4011 | -S "session successfully restored from cache" \ |
| 4012 | -s "session successfully restored from ticket" \ |
| 4013 | -s "a session has been resumed" \ |
| 4014 | -c "a session has been resumed" |
| 4015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4017 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4018 | "$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] | 4019 | "$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] | 4020 | 0 \ |
| 4021 | -c "client hello, adding session ticket extension" \ |
| 4022 | -s "found session ticket extension" \ |
| 4023 | -s "server hello, adding session ticket extension" \ |
| 4024 | -c "found session_ticket extension" \ |
| 4025 | -c "parse new session ticket" \ |
| 4026 | -S "session successfully restored from cache" \ |
| 4027 | -s "session successfully restored from ticket" \ |
| 4028 | -s "a session has been resumed" \ |
| 4029 | -c "a session has been resumed" |
| 4030 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4032 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4033 | "$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] | 4034 | "$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] | 4035 | 0 \ |
| 4036 | -c "client hello, adding session ticket extension" \ |
| 4037 | -s "found session ticket extension" \ |
| 4038 | -s "server hello, adding session ticket extension" \ |
| 4039 | -c "found session_ticket extension" \ |
| 4040 | -c "parse new session ticket" \ |
| 4041 | -S "session successfully restored from cache" \ |
| 4042 | -S "session successfully restored from ticket" \ |
| 4043 | -S "a session has been resumed" \ |
| 4044 | -C "a session has been resumed" |
| 4045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4047 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4048 | "$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] | 4049 | "$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] | 4050 | 0 \ |
| 4051 | -c "client hello, adding session ticket extension" \ |
| 4052 | -s "found session ticket extension" \ |
| 4053 | -s "server hello, adding session ticket extension" \ |
| 4054 | -c "found session_ticket extension" \ |
| 4055 | -c "parse new session ticket" \ |
| 4056 | -S "session successfully restored from cache" \ |
| 4057 | -s "session successfully restored from ticket" \ |
| 4058 | -s "a session has been resumed" \ |
| 4059 | -c "a session has been resumed" |
| 4060 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4062 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4063 | "$O_SRV -dtls" \ |
| 4064 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4065 | 0 \ |
| 4066 | -c "client hello, adding session ticket extension" \ |
| 4067 | -c "found session_ticket extension" \ |
| 4068 | -c "parse new session ticket" \ |
| 4069 | -c "a session has been resumed" |
| 4070 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4071 | # 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] | 4072 | # 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] | 4073 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4075 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4076 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4077 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4078 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4079 | rm -f $SESSION )" \ |
| 4080 | 0 \ |
| 4081 | -s "found session ticket extension" \ |
| 4082 | -s "server hello, adding session ticket extension" \ |
| 4083 | -S "session successfully restored from cache" \ |
| 4084 | -s "session successfully restored from ticket" \ |
| 4085 | -s "a session has been resumed" |
| 4086 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4087 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4088 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4089 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4090 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4091 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4092 | "$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] | 4093 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4094 | -c "client hello, adding session ticket extension" \ |
| 4095 | -s "found session ticket extension" \ |
| 4096 | -S "server hello, adding session ticket extension" \ |
| 4097 | -C "found session_ticket extension" \ |
| 4098 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4099 | -s "session successfully restored from cache" \ |
| 4100 | -S "session successfully restored from ticket" \ |
| 4101 | -s "a session has been resumed" \ |
| 4102 | -c "a session has been resumed" |
| 4103 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4106 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4107 | "$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] | 4108 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 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" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 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" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4118 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4119 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4120 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4121 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4122 | "$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] | 4123 | 0 \ |
| 4124 | -S "session successfully restored from cache" \ |
| 4125 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4126 | -S "a session has been resumed" \ |
| 4127 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4128 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4129 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4130 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4131 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4132 | "$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] | 4133 | 0 \ |
| 4134 | -s "session successfully restored from cache" \ |
| 4135 | -S "session successfully restored from ticket" \ |
| 4136 | -s "a session has been resumed" \ |
| 4137 | -c "a session has been resumed" |
| 4138 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4139 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4140 | run_test "Session resume using cache: cache removed" \ |
| 4141 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4142 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4143 | 0 \ |
| 4144 | -C "client hello, adding session ticket extension" \ |
| 4145 | -S "found session ticket extension" \ |
| 4146 | -S "server hello, adding session ticket extension" \ |
| 4147 | -C "found session_ticket extension" \ |
| 4148 | -C "parse new session ticket" \ |
| 4149 | -S "session successfully restored from cache" \ |
| 4150 | -S "session successfully restored from ticket" \ |
| 4151 | -S "a session has been resumed" \ |
| 4152 | -C "a session has been resumed" |
| 4153 | |
| 4154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4155 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4156 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4157 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4158 | "$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] | 4159 | 0 \ |
| 4160 | -s "session successfully restored from cache" \ |
| 4161 | -S "session successfully restored from ticket" \ |
| 4162 | -s "a session has been resumed" \ |
| 4163 | -c "a session has been resumed" |
| 4164 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4165 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4166 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4167 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4168 | "$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] | 4169 | 0 \ |
| 4170 | -S "session successfully restored from cache" \ |
| 4171 | -S "session successfully restored from ticket" \ |
| 4172 | -S "a session has been resumed" \ |
| 4173 | -C "a session has been resumed" |
| 4174 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4175 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4176 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4177 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4178 | "$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] | 4179 | 0 \ |
| 4180 | -s "session successfully restored from cache" \ |
| 4181 | -S "session successfully restored from ticket" \ |
| 4182 | -s "a session has been resumed" \ |
| 4183 | -c "a session has been resumed" |
| 4184 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4185 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4186 | run_test "Session resume using cache: session copy" \ |
| 4187 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4188 | "$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] | 4189 | 0 \ |
| 4190 | -s "session successfully restored from cache" \ |
| 4191 | -S "session successfully restored from ticket" \ |
| 4192 | -s "a session has been resumed" \ |
| 4193 | -c "a session has been resumed" |
| 4194 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4196 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4197 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4198 | "( $O_CLI -sess_out $SESSION; \ |
| 4199 | $O_CLI -sess_in $SESSION; \ |
| 4200 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4201 | 0 \ |
| 4202 | -s "found session ticket extension" \ |
| 4203 | -S "server hello, adding session ticket extension" \ |
| 4204 | -s "session successfully restored from cache" \ |
| 4205 | -S "session successfully restored from ticket" \ |
| 4206 | -s "a session has been resumed" |
| 4207 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4209 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4210 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4211 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4212 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4213 | 0 \ |
| 4214 | -C "found session_ticket extension" \ |
| 4215 | -C "parse new session ticket" \ |
| 4216 | -c "a session has been resumed" |
| 4217 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4218 | # Tests for Session resume and extensions |
| 4219 | |
| 4220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4221 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4222 | run_test "Session resume and connection ID" \ |
| 4223 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4224 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4225 | 0 \ |
| 4226 | -c "Enable use of CID extension." \ |
| 4227 | -s "Enable use of CID extension." \ |
| 4228 | -c "client hello, adding CID extension" \ |
| 4229 | -s "found CID extension" \ |
| 4230 | -s "Use of CID extension negotiated" \ |
| 4231 | -s "server hello, adding CID extension" \ |
| 4232 | -c "found CID extension" \ |
| 4233 | -c "Use of CID extension negotiated" \ |
| 4234 | -s "Copy CIDs into SSL transform" \ |
| 4235 | -c "Copy CIDs into SSL transform" \ |
| 4236 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4237 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4238 | -s "Use of Connection ID has been negotiated" \ |
| 4239 | -c "Use of Connection ID has been negotiated" |
| 4240 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4241 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4242 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4245 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4246 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4247 | "$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] | 4248 | 0 \ |
| 4249 | -c "client hello, adding session ticket extension" \ |
| 4250 | -s "found session ticket extension" \ |
| 4251 | -S "server hello, adding session ticket extension" \ |
| 4252 | -C "found session_ticket extension" \ |
| 4253 | -C "parse new session ticket" \ |
| 4254 | -s "session successfully restored from cache" \ |
| 4255 | -S "session successfully restored from ticket" \ |
| 4256 | -s "a session has been resumed" \ |
| 4257 | -c "a session has been resumed" |
| 4258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4260 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4261 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4262 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4263 | "$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] | 4264 | 0 \ |
| 4265 | -C "client hello, adding session ticket extension" \ |
| 4266 | -S "found session ticket extension" \ |
| 4267 | -S "server hello, adding session ticket extension" \ |
| 4268 | -C "found session_ticket extension" \ |
| 4269 | -C "parse new session ticket" \ |
| 4270 | -s "session successfully restored from cache" \ |
| 4271 | -S "session successfully restored from ticket" \ |
| 4272 | -s "a session has been resumed" \ |
| 4273 | -c "a session has been resumed" |
| 4274 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4277 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4278 | "$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] | 4279 | "$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] | 4280 | 0 \ |
| 4281 | -S "session successfully restored from cache" \ |
| 4282 | -S "session successfully restored from ticket" \ |
| 4283 | -S "a session has been resumed" \ |
| 4284 | -C "a session has been resumed" |
| 4285 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4287 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4288 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4289 | "$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] | 4290 | "$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] | 4291 | 0 \ |
| 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 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4298 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4299 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4300 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4301 | "$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] | 4302 | 0 \ |
| 4303 | -s "session successfully restored from cache" \ |
| 4304 | -S "session successfully restored from ticket" \ |
| 4305 | -s "a session has been resumed" \ |
| 4306 | -c "a session has been resumed" |
| 4307 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4309 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4310 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4311 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4312 | "$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] | 4313 | 0 \ |
| 4314 | -S "session successfully restored from cache" \ |
| 4315 | -S "session successfully restored from ticket" \ |
| 4316 | -S "a session has been resumed" \ |
| 4317 | -C "a session has been resumed" |
| 4318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4320 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4321 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4322 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4323 | "$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] | 4324 | 0 \ |
| 4325 | -s "session successfully restored from cache" \ |
| 4326 | -S "session successfully restored from ticket" \ |
| 4327 | -s "a session has been resumed" \ |
| 4328 | -c "a session has been resumed" |
| 4329 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4332 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4333 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4334 | "$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] | 4335 | 0 \ |
| 4336 | -s "session successfully restored from cache" \ |
| 4337 | -S "session successfully restored from ticket" \ |
| 4338 | -s "a session has been resumed" \ |
| 4339 | -c "a session has been resumed" |
| 4340 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4341 | # 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] | 4342 | # 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] | 4343 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4346 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4347 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4348 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4349 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4350 | rm -f $SESSION )" \ |
| 4351 | 0 \ |
| 4352 | -s "found session ticket extension" \ |
| 4353 | -S "server hello, adding session ticket extension" \ |
| 4354 | -s "session successfully restored from cache" \ |
| 4355 | -S "session successfully restored from ticket" \ |
| 4356 | -s "a session has been resumed" |
| 4357 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4359 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4360 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4361 | "$O_SRV -dtls" \ |
| 4362 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4363 | 0 \ |
| 4364 | -C "found session_ticket extension" \ |
| 4365 | -C "parse new session ticket" \ |
| 4366 | -c "a session has been resumed" |
| 4367 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4368 | # Tests for Max Fragment Length extension |
| 4369 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4370 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4372 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4373 | "$P_SRV debug_level=3" \ |
| 4374 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4375 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4376 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4377 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4378 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4379 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4380 | -C "client hello, adding max_fragment_length extension" \ |
| 4381 | -S "found max fragment length extension" \ |
| 4382 | -S "server hello, max_fragment_length extension" \ |
| 4383 | -C "found max_fragment_length extension" |
| 4384 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4385 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4387 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4388 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4389 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4390 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4391 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4392 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4393 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4394 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4395 | -C "client hello, adding max_fragment_length extension" \ |
| 4396 | -S "found max fragment length extension" \ |
| 4397 | -S "server hello, max_fragment_length extension" \ |
| 4398 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4399 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4400 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4401 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4402 | |
| 4403 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4405 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4406 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4407 | "$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] | 4408 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4409 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4410 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4411 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4412 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4413 | -C "client hello, adding max_fragment_length extension" \ |
| 4414 | -S "found max fragment length extension" \ |
| 4415 | -S "server hello, max_fragment_length extension" \ |
| 4416 | -C "found max_fragment_length extension" \ |
| 4417 | -c "fragment larger than.*maximum " |
| 4418 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4419 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4420 | # (session fragment length will be 16384 regardless of mbedtls |
| 4421 | # content length configuration.) |
| 4422 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4423 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4425 | run_test "Max fragment length: disabled, larger message" \ |
| 4426 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4427 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4428 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4429 | -C "Maximum incoming record payload length is 16384" \ |
| 4430 | -C "Maximum outgoing record payload length is 16384" \ |
| 4431 | -S "Maximum incoming record payload length is 16384" \ |
| 4432 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4433 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4434 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4435 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4436 | |
| 4437 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4439 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4440 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4441 | "$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] | 4442 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4443 | -C "Maximum incoming record payload length is 16384" \ |
| 4444 | -C "Maximum outgoing record payload length is 16384" \ |
| 4445 | -S "Maximum incoming record payload length is 16384" \ |
| 4446 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4447 | -c "fragment larger than.*maximum " |
| 4448 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4449 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4451 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4452 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4453 | "$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] | 4454 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4455 | -c "Maximum incoming record payload length is 4096" \ |
| 4456 | -c "Maximum outgoing record payload length is 4096" \ |
| 4457 | -s "Maximum incoming record payload length is 4096" \ |
| 4458 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4459 | -c "client hello, adding max_fragment_length extension" \ |
| 4460 | -s "found max fragment length extension" \ |
| 4461 | -s "server hello, max_fragment_length extension" \ |
| 4462 | -c "found max_fragment_length extension" |
| 4463 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4464 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4465 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4466 | run_test "Max fragment length: client 512, server 1024" \ |
| 4467 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4468 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4469 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4470 | -c "Maximum incoming record payload length is 512" \ |
| 4471 | -c "Maximum outgoing record payload length is 512" \ |
| 4472 | -s "Maximum incoming record payload length is 512" \ |
| 4473 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4474 | -c "client hello, adding max_fragment_length extension" \ |
| 4475 | -s "found max fragment length extension" \ |
| 4476 | -s "server hello, max_fragment_length extension" \ |
| 4477 | -c "found max_fragment_length extension" |
| 4478 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4479 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4480 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4481 | run_test "Max fragment length: client 512, server 2048" \ |
| 4482 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4483 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4484 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4485 | -c "Maximum incoming record payload length is 512" \ |
| 4486 | -c "Maximum outgoing record payload length is 512" \ |
| 4487 | -s "Maximum incoming record payload length is 512" \ |
| 4488 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4489 | -c "client hello, adding max_fragment_length extension" \ |
| 4490 | -s "found max fragment length extension" \ |
| 4491 | -s "server hello, max_fragment_length extension" \ |
| 4492 | -c "found max_fragment_length extension" |
| 4493 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4494 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4495 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4496 | run_test "Max fragment length: client 512, server 4096" \ |
| 4497 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4498 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4499 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4500 | -c "Maximum incoming record payload length is 512" \ |
| 4501 | -c "Maximum outgoing record payload length is 512" \ |
| 4502 | -s "Maximum incoming record payload length is 512" \ |
| 4503 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4504 | -c "client hello, adding max_fragment_length extension" \ |
| 4505 | -s "found max fragment length extension" \ |
| 4506 | -s "server hello, max_fragment_length extension" \ |
| 4507 | -c "found max_fragment_length extension" |
| 4508 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4509 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4511 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4512 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4513 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4514 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4515 | -c "Maximum incoming record payload length is 1024" \ |
| 4516 | -c "Maximum outgoing record payload length is 1024" \ |
| 4517 | -s "Maximum incoming record payload length is 1024" \ |
| 4518 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4519 | -c "client hello, adding max_fragment_length extension" \ |
| 4520 | -s "found max fragment length extension" \ |
| 4521 | -s "server hello, max_fragment_length extension" \ |
| 4522 | -c "found max_fragment_length extension" |
| 4523 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4524 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4526 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4527 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4528 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4529 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4530 | -c "Maximum incoming record payload length is 1024" \ |
| 4531 | -c "Maximum outgoing record payload length is 1024" \ |
| 4532 | -s "Maximum incoming record payload length is 1024" \ |
| 4533 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4534 | -c "client hello, adding max_fragment_length extension" \ |
| 4535 | -s "found max fragment length extension" \ |
| 4536 | -s "server hello, max_fragment_length extension" \ |
| 4537 | -c "found max_fragment_length extension" |
| 4538 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4539 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4540 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4541 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4542 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4543 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4544 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4545 | -c "Maximum incoming record payload length is 1024" \ |
| 4546 | -c "Maximum outgoing record payload length is 1024" \ |
| 4547 | -s "Maximum incoming record payload length is 1024" \ |
| 4548 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4549 | -c "client hello, adding max_fragment_length extension" \ |
| 4550 | -s "found max fragment length extension" \ |
| 4551 | -s "server hello, max_fragment_length extension" \ |
| 4552 | -c "found max_fragment_length extension" |
| 4553 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4554 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4555 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4556 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4557 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4558 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4559 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4560 | -c "Maximum incoming record payload length is 2048" \ |
| 4561 | -c "Maximum outgoing record payload length is 2048" \ |
| 4562 | -s "Maximum incoming record payload length is 2048" \ |
| 4563 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4564 | -c "client hello, adding max_fragment_length extension" \ |
| 4565 | -s "found max fragment length extension" \ |
| 4566 | -s "server hello, max_fragment_length extension" \ |
| 4567 | -c "found max_fragment_length extension" |
| 4568 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4569 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4570 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4571 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4572 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4573 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4574 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4575 | -c "Maximum incoming record payload length is 2048" \ |
| 4576 | -c "Maximum outgoing record payload length is 2048" \ |
| 4577 | -s "Maximum incoming record payload length is 2048" \ |
| 4578 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4579 | -c "client hello, adding max_fragment_length extension" \ |
| 4580 | -s "found max fragment length extension" \ |
| 4581 | -s "server hello, max_fragment_length extension" \ |
| 4582 | -c "found max_fragment_length extension" |
| 4583 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4584 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4585 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4586 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4587 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4588 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4589 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4590 | -c "Maximum incoming record payload length is 2048" \ |
| 4591 | -c "Maximum outgoing record payload length is 2048" \ |
| 4592 | -s "Maximum incoming record payload length is 2048" \ |
| 4593 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4594 | -c "client hello, adding max_fragment_length extension" \ |
| 4595 | -s "found max fragment length extension" \ |
| 4596 | -s "server hello, max_fragment_length extension" \ |
| 4597 | -c "found max_fragment_length extension" |
| 4598 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4599 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4601 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4602 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4603 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4604 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4605 | -c "Maximum incoming record payload length is 4096" \ |
| 4606 | -c "Maximum outgoing record payload length is 4096" \ |
| 4607 | -s "Maximum incoming record payload length is 4096" \ |
| 4608 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4609 | -c "client hello, adding max_fragment_length extension" \ |
| 4610 | -s "found max fragment length extension" \ |
| 4611 | -s "server hello, max_fragment_length extension" \ |
| 4612 | -c "found max_fragment_length extension" |
| 4613 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4614 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4615 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4616 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4617 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4618 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4619 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4620 | -c "Maximum incoming record payload length is 4096" \ |
| 4621 | -c "Maximum outgoing record payload length is 4096" \ |
| 4622 | -s "Maximum incoming record payload length is 4096" \ |
| 4623 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4629 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4630 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4631 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4632 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4633 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4634 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4635 | -c "Maximum incoming record payload length is 4096" \ |
| 4636 | -c "Maximum outgoing record payload length is 4096" \ |
| 4637 | -s "Maximum incoming record payload length is 4096" \ |
| 4638 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +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" |
| 4643 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4644 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4645 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4646 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4647 | "$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] | 4648 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4649 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4650 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4651 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4652 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4653 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4654 | -C "client hello, adding max_fragment_length extension" \ |
| 4655 | -S "found max fragment length extension" \ |
| 4656 | -S "server hello, max_fragment_length extension" \ |
| 4657 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4658 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4659 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4660 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4663 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4664 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4665 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4666 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4667 | -c "Maximum incoming record payload length is 4096" \ |
| 4668 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4669 | -c "client hello, adding max_fragment_length extension" \ |
| 4670 | -c "found max_fragment_length extension" |
| 4671 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4672 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4674 | run_test "Max fragment length: client, message just fits" \ |
| 4675 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4676 | "$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] | 4677 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4678 | -c "Maximum incoming record payload length is 2048" \ |
| 4679 | -c "Maximum outgoing record payload length is 2048" \ |
| 4680 | -s "Maximum incoming record payload length is 2048" \ |
| 4681 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4682 | -c "client hello, adding max_fragment_length extension" \ |
| 4683 | -s "found max fragment length extension" \ |
| 4684 | -s "server hello, max_fragment_length extension" \ |
| 4685 | -c "found max_fragment_length extension" \ |
| 4686 | -c "2048 bytes written in 1 fragments" \ |
| 4687 | -s "2048 bytes read" |
| 4688 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4689 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4691 | run_test "Max fragment length: client, larger message" \ |
| 4692 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4693 | "$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] | 4694 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4695 | -c "Maximum incoming record payload length is 2048" \ |
| 4696 | -c "Maximum outgoing record payload length is 2048" \ |
| 4697 | -s "Maximum incoming record payload length is 2048" \ |
| 4698 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4699 | -c "client hello, adding max_fragment_length extension" \ |
| 4700 | -s "found max fragment length extension" \ |
| 4701 | -s "server hello, max_fragment_length extension" \ |
| 4702 | -c "found max_fragment_length extension" \ |
| 4703 | -c "2345 bytes written in 2 fragments" \ |
| 4704 | -s "2048 bytes read" \ |
| 4705 | -s "297 bytes read" |
| 4706 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4707 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4708 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4710 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4711 | "$P_SRV debug_level=3 dtls=1" \ |
| 4712 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4713 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4714 | -c "Maximum incoming record payload length is 2048" \ |
| 4715 | -c "Maximum outgoing record payload length is 2048" \ |
| 4716 | -s "Maximum incoming record payload length is 2048" \ |
| 4717 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [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 | -c "fragment larger than.*maximum" |
| 4723 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4724 | # Tests for Record Size Limit extension |
| 4725 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4726 | requires_gnutls_tls1_3 |
| 4727 | requires_gnutls_record_size_limit |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4728 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4729 | run_test "Record Size Limit: TLS 1.3: Server-side parsing, debug output and fatal alert" \ |
| 4730 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4731 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4732 | 1 \ |
| 4733 | -c "Preparing extension (Record Size Limit/28) for 'client hello'" \ |
| 4734 | -c "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4735 | -s "ClientHello: record_size_limit(28) extension received."\ |
| 4736 | -s "found record_size_limit extension" \ |
| 4737 | -s "RecordSizeLimit: 16385 Bytes" \ |
| 4738 | -c "Received alert \[110]: An unsupported extension was sent" |
| 4739 | |
| 4740 | requires_gnutls_tls1_3 |
| 4741 | requires_gnutls_record_size_limit |
| 4742 | requires_gnutls_next_disable_tls13_compat |
| 4743 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4744 | run_test "Record Size Limit: TLS 1.3: Client-side parsing, debug output and fatal alert" \ |
| 4745 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert -d 4" \ |
| 4746 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4747 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4748 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" |
| 4749 | # The P_CLI can not yet send the Record Size Limit extension. Thus, the G_NEXT_SRV does not send |
| 4750 | # a response in its EncryptedExtensions record. |
| 4751 | # -s "Parsing extension 'Record Size Limit/28 (2 bytes)" \ |
| 4752 | # -s "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4753 | # -c "EncryptedExtensions: record_size_limit(28) extension received."\ |
| 4754 | # -c "found record_size_limit extension" \ |
| 4755 | # -c "RecordSizeLimit: 16385 Bytes" \ |
| 4756 | # -s "Received alert \[110]: An unsupported extension was sent" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4757 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4758 | # Tests for renegotiation |
| 4759 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4760 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4761 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4762 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4763 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4764 | 0 \ |
| 4765 | -C "client hello, adding renegotiation extension" \ |
| 4766 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4767 | -S "found renegotiation extension" \ |
| 4768 | -s "server hello, secure renegotiation extension" \ |
| 4769 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4770 | -C "=> renegotiate" \ |
| 4771 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4772 | -S "write hello request" |
| 4773 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4775 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4776 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4777 | "$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] | 4778 | 0 \ |
| 4779 | -c "client hello, adding renegotiation extension" \ |
| 4780 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4781 | -s "found renegotiation extension" \ |
| 4782 | -s "server hello, secure renegotiation extension" \ |
| 4783 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4784 | -c "=> renegotiate" \ |
| 4785 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4786 | -S "write hello request" |
| 4787 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4788 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4789 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4790 | "$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] | 4791 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4792 | 0 \ |
| 4793 | -c "client hello, adding renegotiation extension" \ |
| 4794 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4795 | -s "found renegotiation extension" \ |
| 4796 | -s "server hello, secure renegotiation extension" \ |
| 4797 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4798 | -c "=> renegotiate" \ |
| 4799 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4800 | -s "write hello request" |
| 4801 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4802 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4803 | # 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] | 4804 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4805 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4806 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4807 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4808 | "$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] | 4809 | 0 \ |
| 4810 | -c "client hello, adding renegotiation extension" \ |
| 4811 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4812 | -s "found renegotiation extension" \ |
| 4813 | -s "server hello, secure renegotiation extension" \ |
| 4814 | -c "found renegotiation extension" \ |
| 4815 | -c "=> renegotiate" \ |
| 4816 | -s "=> renegotiate" \ |
| 4817 | -S "write hello request" \ |
| 4818 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4819 | |
| 4820 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4821 | # 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] | 4822 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4824 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4825 | "$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] | 4826 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4827 | 0 \ |
| 4828 | -c "client hello, adding renegotiation extension" \ |
| 4829 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4830 | -s "found renegotiation extension" \ |
| 4831 | -s "server hello, secure renegotiation extension" \ |
| 4832 | -c "found renegotiation extension" \ |
| 4833 | -c "=> renegotiate" \ |
| 4834 | -s "=> renegotiate" \ |
| 4835 | -s "write hello request" \ |
| 4836 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4837 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4839 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4840 | "$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] | 4841 | "$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] | 4842 | 0 \ |
| 4843 | -c "client hello, adding renegotiation extension" \ |
| 4844 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4845 | -s "found renegotiation extension" \ |
| 4846 | -s "server hello, secure renegotiation extension" \ |
| 4847 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4848 | -c "=> renegotiate" \ |
| 4849 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4850 | -s "write hello request" |
| 4851 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4854 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4855 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4856 | "$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] | 4857 | "$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" \ |
| 4858 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4859 | -c "Maximum incoming record payload length is 2048" \ |
| 4860 | -c "Maximum outgoing record payload length is 2048" \ |
| 4861 | -s "Maximum incoming record payload length is 2048" \ |
| 4862 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4863 | -c "client hello, adding max_fragment_length extension" \ |
| 4864 | -s "found max fragment length extension" \ |
| 4865 | -s "server hello, max_fragment_length extension" \ |
| 4866 | -c "found max_fragment_length extension" \ |
| 4867 | -c "client hello, adding renegotiation extension" \ |
| 4868 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4869 | -s "found renegotiation extension" \ |
| 4870 | -s "server hello, secure renegotiation extension" \ |
| 4871 | -c "found renegotiation extension" \ |
| 4872 | -c "=> renegotiate" \ |
| 4873 | -s "=> renegotiate" \ |
| 4874 | -s "write hello request" |
| 4875 | |
| 4876 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4877 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4878 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4879 | "$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] | 4880 | 1 \ |
| 4881 | -c "client hello, adding renegotiation extension" \ |
| 4882 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4883 | -S "found renegotiation extension" \ |
| 4884 | -s "server hello, secure renegotiation extension" \ |
| 4885 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4886 | -c "=> renegotiate" \ |
| 4887 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4888 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4889 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4890 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4891 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4892 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4893 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4894 | "$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] | 4895 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4896 | 0 \ |
| 4897 | -C "client hello, adding renegotiation extension" \ |
| 4898 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4899 | -S "found renegotiation extension" \ |
| 4900 | -s "server hello, secure renegotiation extension" \ |
| 4901 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4902 | -C "=> renegotiate" \ |
| 4903 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4904 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4905 | -S "SSL - An unexpected message was received from our peer" \ |
| 4906 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4907 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4908 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4909 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4910 | "$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] | 4911 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4912 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4913 | 0 \ |
| 4914 | -C "client hello, adding renegotiation extension" \ |
| 4915 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4916 | -S "found renegotiation extension" \ |
| 4917 | -s "server hello, secure renegotiation extension" \ |
| 4918 | -c "found renegotiation extension" \ |
| 4919 | -C "=> renegotiate" \ |
| 4920 | -S "=> renegotiate" \ |
| 4921 | -s "write hello request" \ |
| 4922 | -S "SSL - An unexpected message was received from our peer" \ |
| 4923 | -S "failed" |
| 4924 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4925 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4926 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4927 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4928 | "$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] | 4929 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4930 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4931 | 0 \ |
| 4932 | -C "client hello, adding renegotiation extension" \ |
| 4933 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4934 | -S "found renegotiation extension" \ |
| 4935 | -s "server hello, secure renegotiation extension" \ |
| 4936 | -c "found renegotiation extension" \ |
| 4937 | -C "=> renegotiate" \ |
| 4938 | -S "=> renegotiate" \ |
| 4939 | -s "write hello request" \ |
| 4940 | -S "SSL - An unexpected message was received from our peer" \ |
| 4941 | -S "failed" |
| 4942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4944 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4945 | "$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] | 4946 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4947 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4948 | 0 \ |
| 4949 | -C "client hello, adding renegotiation extension" \ |
| 4950 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4951 | -S "found renegotiation extension" \ |
| 4952 | -s "server hello, secure renegotiation extension" \ |
| 4953 | -c "found renegotiation extension" \ |
| 4954 | -C "=> renegotiate" \ |
| 4955 | -S "=> renegotiate" \ |
| 4956 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4957 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4958 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4959 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4960 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4961 | "$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] | 4962 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4963 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4964 | 0 \ |
| 4965 | -c "client hello, adding renegotiation extension" \ |
| 4966 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4967 | -s "found renegotiation extension" \ |
| 4968 | -s "server hello, secure renegotiation extension" \ |
| 4969 | -c "found renegotiation extension" \ |
| 4970 | -c "=> renegotiate" \ |
| 4971 | -s "=> renegotiate" \ |
| 4972 | -s "write hello request" \ |
| 4973 | -S "SSL - An unexpected message was received from our peer" \ |
| 4974 | -S "failed" |
| 4975 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4976 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4977 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4978 | "$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] | 4979 | "$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] | 4980 | 0 \ |
| 4981 | -C "client hello, adding renegotiation extension" \ |
| 4982 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4983 | -S "found renegotiation extension" \ |
| 4984 | -s "server hello, secure renegotiation extension" \ |
| 4985 | -c "found renegotiation extension" \ |
| 4986 | -S "record counter limit reached: renegotiate" \ |
| 4987 | -C "=> renegotiate" \ |
| 4988 | -S "=> renegotiate" \ |
| 4989 | -S "write hello request" \ |
| 4990 | -S "SSL - An unexpected message was received from our peer" \ |
| 4991 | -S "failed" |
| 4992 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4993 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4994 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4995 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4996 | "$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] | 4997 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4998 | 0 \ |
| 4999 | -c "client hello, adding renegotiation extension" \ |
| 5000 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5001 | -s "found renegotiation extension" \ |
| 5002 | -s "server hello, secure renegotiation extension" \ |
| 5003 | -c "found renegotiation extension" \ |
| 5004 | -s "record counter limit reached: renegotiate" \ |
| 5005 | -c "=> renegotiate" \ |
| 5006 | -s "=> renegotiate" \ |
| 5007 | -s "write hello request" \ |
| 5008 | -S "SSL - An unexpected message was received from our peer" \ |
| 5009 | -S "failed" |
| 5010 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5011 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5012 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5013 | "$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] | 5014 | "$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] | 5015 | 0 \ |
| 5016 | -c "client hello, adding renegotiation extension" \ |
| 5017 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5018 | -s "found renegotiation extension" \ |
| 5019 | -s "server hello, secure renegotiation extension" \ |
| 5020 | -c "found renegotiation extension" \ |
| 5021 | -s "record counter limit reached: renegotiate" \ |
| 5022 | -c "=> renegotiate" \ |
| 5023 | -s "=> renegotiate" \ |
| 5024 | -s "write hello request" \ |
| 5025 | -S "SSL - An unexpected message was received from our peer" \ |
| 5026 | -S "failed" |
| 5027 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5028 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5029 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5030 | "$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] | 5031 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5032 | 0 \ |
| 5033 | -C "client hello, adding renegotiation extension" \ |
| 5034 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5035 | -S "found renegotiation extension" \ |
| 5036 | -s "server hello, secure renegotiation extension" \ |
| 5037 | -c "found renegotiation extension" \ |
| 5038 | -S "record counter limit reached: renegotiate" \ |
| 5039 | -C "=> renegotiate" \ |
| 5040 | -S "=> renegotiate" \ |
| 5041 | -S "write hello request" \ |
| 5042 | -S "SSL - An unexpected message was received from our peer" \ |
| 5043 | -S "failed" |
| 5044 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5047 | "$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] | 5048 | "$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] | 5049 | 0 \ |
| 5050 | -c "client hello, adding renegotiation extension" \ |
| 5051 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5052 | -s "found renegotiation extension" \ |
| 5053 | -s "server hello, secure renegotiation extension" \ |
| 5054 | -c "found renegotiation extension" \ |
| 5055 | -c "=> renegotiate" \ |
| 5056 | -s "=> renegotiate" \ |
| 5057 | -S "write hello request" |
| 5058 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5059 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5060 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5061 | "$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] | 5062 | "$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] | 5063 | 0 \ |
| 5064 | -c "client hello, adding renegotiation extension" \ |
| 5065 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5066 | -s "found renegotiation extension" \ |
| 5067 | -s "server hello, secure renegotiation extension" \ |
| 5068 | -c "found renegotiation extension" \ |
| 5069 | -c "=> renegotiate" \ |
| 5070 | -s "=> renegotiate" \ |
| 5071 | -s "write hello request" |
| 5072 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5073 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5075 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5076 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5077 | "$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] | 5078 | 0 \ |
| 5079 | -c "client hello, adding renegotiation extension" \ |
| 5080 | -c "found renegotiation extension" \ |
| 5081 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5082 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5083 | -C "error" \ |
| 5084 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5085 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5086 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5087 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5089 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5090 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5091 | "$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] | 5092 | 0 \ |
| 5093 | -c "client hello, adding renegotiation extension" \ |
| 5094 | -c "found renegotiation extension" \ |
| 5095 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5096 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5097 | -C "error" \ |
| 5098 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5099 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5100 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5101 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5103 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5104 | "$G_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] | 5105 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5106 | 1 \ |
| 5107 | -c "client hello, adding renegotiation extension" \ |
| 5108 | -C "found renegotiation extension" \ |
| 5109 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5110 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5111 | -c "error" \ |
| 5112 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5113 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5114 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5115 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5117 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5118 | "$G_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] | 5119 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5120 | allow_legacy=0" \ |
| 5121 | 1 \ |
| 5122 | -c "client hello, adding renegotiation extension" \ |
| 5123 | -C "found renegotiation extension" \ |
| 5124 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5125 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5126 | -c "error" \ |
| 5127 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5128 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5129 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5130 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5132 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5133 | "$G_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] | 5134 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5135 | allow_legacy=1" \ |
| 5136 | 0 \ |
| 5137 | -c "client hello, adding renegotiation extension" \ |
| 5138 | -C "found renegotiation extension" \ |
| 5139 | -c "=> renegotiate" \ |
| 5140 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5141 | -C "error" \ |
| 5142 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5143 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5144 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5146 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5147 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5148 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5149 | 0 \ |
| 5150 | -c "client hello, adding renegotiation extension" \ |
| 5151 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5152 | -s "found renegotiation extension" \ |
| 5153 | -s "server hello, secure renegotiation extension" \ |
| 5154 | -c "found renegotiation extension" \ |
| 5155 | -c "=> renegotiate" \ |
| 5156 | -s "=> renegotiate" \ |
| 5157 | -S "write hello request" |
| 5158 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5159 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5161 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5162 | "$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] | 5163 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5164 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5165 | 0 \ |
| 5166 | -c "client hello, adding renegotiation extension" \ |
| 5167 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5168 | -s "found renegotiation extension" \ |
| 5169 | -s "server hello, secure renegotiation extension" \ |
| 5170 | -c "found renegotiation extension" \ |
| 5171 | -c "=> renegotiate" \ |
| 5172 | -s "=> renegotiate" \ |
| 5173 | -s "write hello request" |
| 5174 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5175 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5177 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5178 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5179 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5180 | 0 \ |
| 5181 | -c "client hello, adding renegotiation extension" \ |
| 5182 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5183 | -s "found renegotiation extension" \ |
| 5184 | -s "server hello, secure renegotiation extension" \ |
| 5185 | -s "record counter limit reached: renegotiate" \ |
| 5186 | -c "=> renegotiate" \ |
| 5187 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5188 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5189 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5190 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5193 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5194 | "$G_SRV -u --mtu 4096" \ |
| 5195 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5196 | 0 \ |
| 5197 | -c "client hello, adding renegotiation extension" \ |
| 5198 | -c "found renegotiation extension" \ |
| 5199 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5200 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5201 | -C "error" \ |
| 5202 | -s "Extra-header:" |
| 5203 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5204 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5205 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5206 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5208 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5209 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5210 | "$P_CLI debug_level=3" \ |
| 5211 | 0 \ |
| 5212 | -c "found renegotiation extension" \ |
| 5213 | -C "error" \ |
| 5214 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5215 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5216 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5218 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5219 | "$G_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] | 5220 | "$P_CLI debug_level=3" \ |
| 5221 | 0 \ |
| 5222 | -C "found renegotiation extension" \ |
| 5223 | -C "error" \ |
| 5224 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5225 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5226 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5228 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5229 | "$G_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] | 5230 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5231 | 1 \ |
| 5232 | -C "found renegotiation extension" \ |
| 5233 | -c "error" \ |
| 5234 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5235 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5236 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5238 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5239 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5240 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5241 | 0 \ |
| 5242 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5243 | -s "server hello, secure renegotiation extension" |
| 5244 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5245 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5247 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5248 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5249 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5250 | 0 \ |
| 5251 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5252 | -S "server hello, secure renegotiation extension" |
| 5253 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5254 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5255 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5256 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5257 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5258 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5259 | 1 \ |
| 5260 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5261 | -S "server hello, secure renegotiation extension" |
| 5262 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5263 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5264 | |
| 5265 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5267 | run_test "DER format: no trailing bytes" \ |
| 5268 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5269 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5270 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5271 | 0 \ |
| 5272 | -c "Handshake was completed" \ |
| 5273 | |
| 5274 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5276 | run_test "DER format: with a trailing zero byte" \ |
| 5277 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5278 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5279 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5280 | 0 \ |
| 5281 | -c "Handshake was completed" \ |
| 5282 | |
| 5283 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5285 | run_test "DER format: with a trailing random byte" \ |
| 5286 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5287 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5288 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5289 | 0 \ |
| 5290 | -c "Handshake was completed" \ |
| 5291 | |
| 5292 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5294 | run_test "DER format: with 2 trailing random bytes" \ |
| 5295 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5296 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5297 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5298 | 0 \ |
| 5299 | -c "Handshake was completed" \ |
| 5300 | |
| 5301 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5303 | run_test "DER format: with 4 trailing random bytes" \ |
| 5304 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5305 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5306 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5307 | 0 \ |
| 5308 | -c "Handshake was completed" \ |
| 5309 | |
| 5310 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5312 | run_test "DER format: with 8 trailing random bytes" \ |
| 5313 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5314 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5315 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5316 | 0 \ |
| 5317 | -c "Handshake was completed" \ |
| 5318 | |
| 5319 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5321 | run_test "DER format: with 9 trailing random bytes" \ |
| 5322 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5323 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5324 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5325 | 0 \ |
| 5326 | -c "Handshake was completed" \ |
| 5327 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5328 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5329 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5330 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5331 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5332 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5333 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5334 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5335 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5336 | 1 \ |
| 5337 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5338 | -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] | 5339 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5340 | -c "X509 - Certificate verification failed" |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5343 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5344 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5345 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5346 | 0 \ |
| 5347 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5348 | -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] | 5349 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5350 | -C "X509 - Certificate verification failed" |
| 5351 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5352 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5353 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5354 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5355 | "$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] | 5356 | 0 \ |
| 5357 | -c "x509_verify_cert() returned" \ |
| 5358 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5359 | -c "! Certificate verification flags"\ |
| 5360 | -C "! mbedtls_ssl_handshake returned" \ |
| 5361 | -C "X509 - Certificate verification failed" \ |
| 5362 | -C "SSL - No CA Chain is set, but required to operate" |
| 5363 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5364 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5365 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5366 | "$P_SRV" \ |
| 5367 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5368 | 1 \ |
| 5369 | -c "x509_verify_cert() returned" \ |
| 5370 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5371 | -c "! Certificate verification flags"\ |
| 5372 | -c "! mbedtls_ssl_handshake returned" \ |
| 5373 | -c "SSL - No CA Chain is set, but required to operate" |
| 5374 | |
| 5375 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5376 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5377 | # the client informs the server about the supported curves - it does, though, in the |
| 5378 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5379 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5380 | # different means to have the server ignoring the client's supported curve list. |
| 5381 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5382 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5383 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5384 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5385 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required curves=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5386 | 1 \ |
| 5387 | -c "bad certificate (EC key curve)"\ |
| 5388 | -c "! Certificate verification flags"\ |
| 5389 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5390 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5391 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5392 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5393 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5394 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional curves=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5395 | 1 \ |
| 5396 | -c "bad certificate (EC key curve)"\ |
| 5397 | -c "! Certificate verification flags"\ |
| 5398 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5400 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5401 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5402 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5403 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5404 | 0 \ |
| 5405 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5406 | -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] | 5407 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5408 | -C "X509 - Certificate verification failed" |
| 5409 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5410 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5411 | run_test "Authentication: client SHA256, server required" \ |
| 5412 | "$P_SRV auth_mode=required" \ |
| 5413 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5414 | key_file=data_files/server6.key \ |
| 5415 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5416 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5417 | -c "Supported Signature Algorithm found: 04 " \ |
| 5418 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5419 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5420 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5421 | run_test "Authentication: client SHA384, server required" \ |
| 5422 | "$P_SRV auth_mode=required" \ |
| 5423 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5424 | key_file=data_files/server6.key \ |
| 5425 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5426 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5427 | -c "Supported Signature Algorithm found: 04 " \ |
| 5428 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5429 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5430 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5431 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5432 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5433 | "$P_CLI debug_level=3 crt_file=none \ |
| 5434 | key_file=data_files/server5.key" \ |
| 5435 | 1 \ |
| 5436 | -S "skip write certificate request" \ |
| 5437 | -C "skip parse certificate request" \ |
| 5438 | -c "got a certificate request" \ |
| 5439 | -c "= write certificate$" \ |
| 5440 | -C "skip write certificate$" \ |
| 5441 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5442 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5443 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5444 | -s "No client certification received from the client, but required by the authentication mode" |
| 5445 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5446 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5447 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5448 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5449 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5450 | key_file=data_files/server5.key" \ |
| 5451 | 1 \ |
| 5452 | -S "skip write certificate request" \ |
| 5453 | -C "skip parse certificate request" \ |
| 5454 | -c "got a certificate request" \ |
| 5455 | -C "skip write certificate" \ |
| 5456 | -C "skip write certificate verify" \ |
| 5457 | -S "skip parse certificate verify" \ |
| 5458 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5459 | -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] | 5460 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5461 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5462 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5463 | # We don't check that the client receives the alert because it might |
| 5464 | # detect that its write end of the connection is closed and abort |
| 5465 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5466 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5467 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5468 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5469 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5470 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5471 | key_file=data_files/server5.key" \ |
| 5472 | 0 \ |
| 5473 | -S "skip write certificate request" \ |
| 5474 | -C "skip parse certificate request" \ |
| 5475 | -c "got a certificate request" \ |
| 5476 | -C "skip write certificate" \ |
| 5477 | -C "skip write certificate verify" \ |
| 5478 | -S "skip parse certificate verify" \ |
| 5479 | -S "x509_verify_cert() returned" \ |
| 5480 | -S "! The certificate is not correctly signed" \ |
| 5481 | -S "X509 - Certificate verification failed" |
| 5482 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5483 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5484 | run_test "Authentication: client cert not trusted, server required" \ |
| 5485 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5486 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5487 | key_file=data_files/server5.key" \ |
| 5488 | 1 \ |
| 5489 | -S "skip write certificate request" \ |
| 5490 | -C "skip parse certificate request" \ |
| 5491 | -c "got a certificate request" \ |
| 5492 | -C "skip write certificate" \ |
| 5493 | -C "skip write certificate verify" \ |
| 5494 | -S "skip parse certificate verify" \ |
| 5495 | -s "x509_verify_cert() returned" \ |
| 5496 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5497 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5498 | -s "X509 - Certificate verification failed" |
| 5499 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5500 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5501 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5502 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5503 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5504 | key_file=data_files/server5.key" \ |
| 5505 | 0 \ |
| 5506 | -S "skip write certificate request" \ |
| 5507 | -C "skip parse certificate request" \ |
| 5508 | -c "got a certificate request" \ |
| 5509 | -C "skip write certificate" \ |
| 5510 | -C "skip write certificate verify" \ |
| 5511 | -S "skip parse certificate verify" \ |
| 5512 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5513 | -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] | 5514 | -S "! mbedtls_ssl_handshake returned" \ |
| 5515 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5516 | -S "X509 - Certificate verification failed" |
| 5517 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5518 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5519 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5520 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5521 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5522 | key_file=data_files/server5.key" \ |
| 5523 | 0 \ |
| 5524 | -s "skip write certificate request" \ |
| 5525 | -C "skip parse certificate request" \ |
| 5526 | -c "got no certificate request" \ |
| 5527 | -c "skip write certificate" \ |
| 5528 | -c "skip write certificate verify" \ |
| 5529 | -s "skip parse certificate verify" \ |
| 5530 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5531 | -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] | 5532 | -S "! mbedtls_ssl_handshake returned" \ |
| 5533 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5534 | -S "X509 - Certificate verification failed" |
| 5535 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5536 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5537 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5538 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5539 | "$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] | 5540 | 0 \ |
| 5541 | -S "skip write certificate request" \ |
| 5542 | -C "skip parse certificate request" \ |
| 5543 | -c "got a certificate request" \ |
| 5544 | -C "skip write certificate$" \ |
| 5545 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5546 | -c "skip write certificate verify" \ |
| 5547 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5548 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5549 | -S "! mbedtls_ssl_handshake returned" \ |
| 5550 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5551 | -S "X509 - Certificate verification failed" |
| 5552 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5553 | requires_openssl_tls1_3 |
| 5554 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5555 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5556 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5557 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5558 | 0 \ |
| 5559 | -S "skip write certificate request" \ |
| 5560 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5561 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5562 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5563 | -S "X509 - Certificate verification failed" |
| 5564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5566 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5567 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5568 | "$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] | 5569 | 0 \ |
| 5570 | -C "skip parse certificate request" \ |
| 5571 | -c "got a certificate request" \ |
| 5572 | -C "skip write certificate$" \ |
| 5573 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5574 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5575 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5577 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5578 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5579 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5580 | 1 \ |
| 5581 | -C "skip parse certificate request" \ |
| 5582 | -c "got a certificate request" \ |
| 5583 | -C "skip write certificate$" \ |
| 5584 | -c "skip write certificate verify" \ |
| 5585 | -c "! mbedtls_ssl_handshake returned" |
| 5586 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5587 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5588 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5589 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5590 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5591 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5592 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5593 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5594 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5595 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5596 | # 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] | 5597 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5598 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5599 | run_test "Authentication: server max_int chain, client default" \ |
| 5600 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5601 | key_file=data_files/dir-maxpath/09.key" \ |
| 5602 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5603 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5604 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5605 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5606 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5607 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5608 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5609 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5610 | key_file=data_files/dir-maxpath/10.key" \ |
| 5611 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5612 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5613 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5614 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5615 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5616 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5617 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5618 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5619 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5620 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5621 | auth_mode=optional" \ |
| 5622 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5623 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5624 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5625 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5626 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5627 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5628 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5629 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5630 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5631 | auth_mode=none" \ |
| 5632 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5633 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5634 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5635 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5636 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5637 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5638 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5639 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5640 | key_file=data_files/dir-maxpath/10.key" \ |
| 5641 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5642 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5643 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5644 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5645 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5646 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5647 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5648 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5649 | key_file=data_files/dir-maxpath/10.key" \ |
| 5650 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5651 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5652 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5653 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5654 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5655 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5656 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5657 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5658 | key_file=data_files/dir-maxpath/10.key" \ |
| 5659 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5660 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5661 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5662 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5663 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5664 | run_test "Authentication: client max_int chain, server required" \ |
| 5665 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5666 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5667 | key_file=data_files/dir-maxpath/09.key" \ |
| 5668 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5669 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5670 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5671 | # Tests for CA list in CertificateRequest messages |
| 5672 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5673 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5674 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5675 | "$P_SRV debug_level=3 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5676 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5677 | key_file=data_files/server6.key" \ |
| 5678 | 0 \ |
| 5679 | -s "requested DN" |
| 5680 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5681 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5682 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5683 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5684 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5685 | key_file=data_files/server6.key" \ |
| 5686 | 0 \ |
| 5687 | -S "requested DN" |
| 5688 | |
| 5689 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5690 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5691 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5692 | key_file=data_files/server5.key" \ |
| 5693 | 1 \ |
| 5694 | -S "requested DN" \ |
| 5695 | -s "x509_verify_cert() returned" \ |
| 5696 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5697 | -s "! mbedtls_ssl_handshake returned" \ |
| 5698 | -c "! mbedtls_ssl_handshake returned" \ |
| 5699 | -s "X509 - Certificate verification failed" |
| 5700 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5701 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5702 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5703 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5704 | crt_file2=data_files/server1.crt \ |
| 5705 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5706 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5707 | crt_file=data_files/server6.crt \ |
| 5708 | key_file=data_files/server6.key" \ |
| 5709 | 0 \ |
| 5710 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5711 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5712 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5713 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5714 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5715 | crt_file2=data_files/server2.crt \ |
| 5716 | key_file2=data_files/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5717 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5718 | crt_file=data_files/server6.crt \ |
| 5719 | key_file=data_files/server6.key" \ |
| 5720 | 0 \ |
| 5721 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5722 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5723 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5724 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5725 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5726 | crt_file2=data_files/server1.crt \ |
| 5727 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5728 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5729 | crt_file=data_files/server6.crt \ |
| 5730 | key_file=data_files/server6.key" \ |
| 5731 | 0 \ |
| 5732 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5733 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5734 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5735 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5736 | |
| 5737 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5738 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5739 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5740 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5741 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5742 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5743 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5744 | -c "x509_verify_cert() returned" \ |
| 5745 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5746 | -c "! mbedtls_ssl_handshake returned" \ |
| 5747 | -c "X509 - Certificate verification failed" |
| 5748 | |
| 5749 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5750 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5751 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5752 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5753 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5754 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5755 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5756 | -c "x509_verify_cert() returned" \ |
| 5757 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5758 | -C "! mbedtls_ssl_handshake returned" \ |
| 5759 | -C "X509 - Certificate verification failed" |
| 5760 | |
| 5761 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5762 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5763 | # the client informs the server about the supported curves - it does, though, in the |
| 5764 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5765 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5766 | # different means to have the server ignoring the client's supported curve list. |
| 5767 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5769 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5770 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5771 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5772 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5773 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5774 | -c "use CA callback for X.509 CRT verification" \ |
| 5775 | -c "bad certificate (EC key curve)" \ |
| 5776 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5777 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5778 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5780 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
Valerio Setti | a9aafd4 | 2023-04-11 12:30:45 +0200 | [diff] [blame] | 5781 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5782 | crt_file=data_files/server5.ku-ka.crt" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5783 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5784 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5785 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5786 | -c "bad certificate (EC key curve)"\ |
| 5787 | -c "! Certificate verification flags"\ |
| 5788 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5789 | |
| 5790 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5791 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5792 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5793 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5794 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5795 | key_file=data_files/server6.key \ |
| 5796 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5797 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5798 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5799 | -c "Supported Signature Algorithm found: 04 " \ |
| 5800 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5801 | |
| 5802 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5803 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5804 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5805 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5806 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5807 | key_file=data_files/server6.key \ |
| 5808 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5809 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5810 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5811 | -c "Supported Signature Algorithm found: 04 " \ |
| 5812 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5813 | |
| 5814 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5815 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5816 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5817 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5818 | key_file=data_files/server5.key" \ |
| 5819 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5820 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5821 | -S "skip write certificate request" \ |
| 5822 | -C "skip parse certificate request" \ |
| 5823 | -c "got a certificate request" \ |
| 5824 | -C "skip write certificate" \ |
| 5825 | -C "skip write certificate verify" \ |
| 5826 | -S "skip parse certificate verify" \ |
| 5827 | -s "x509_verify_cert() returned" \ |
| 5828 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5829 | -s "! mbedtls_ssl_handshake returned" \ |
| 5830 | -s "send alert level=2 message=48" \ |
| 5831 | -c "! mbedtls_ssl_handshake returned" \ |
| 5832 | -s "X509 - Certificate verification failed" |
| 5833 | # We don't check that the client receives the alert because it might |
| 5834 | # detect that its write end of the connection is closed and abort |
| 5835 | # before reading the alert message. |
| 5836 | |
| 5837 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5838 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5839 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5840 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5841 | key_file=data_files/server5.key" \ |
| 5842 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5843 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5844 | -S "skip write certificate request" \ |
| 5845 | -C "skip parse certificate request" \ |
| 5846 | -c "got a certificate request" \ |
| 5847 | -C "skip write certificate" \ |
| 5848 | -C "skip write certificate verify" \ |
| 5849 | -S "skip parse certificate verify" \ |
| 5850 | -s "x509_verify_cert() returned" \ |
| 5851 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5852 | -s "! mbedtls_ssl_handshake returned" \ |
| 5853 | -c "! mbedtls_ssl_handshake returned" \ |
| 5854 | -s "X509 - Certificate verification failed" |
| 5855 | |
| 5856 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5857 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5858 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5859 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5860 | key_file=data_files/server5.key" \ |
| 5861 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5862 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5863 | -S "skip write certificate request" \ |
| 5864 | -C "skip parse certificate request" \ |
| 5865 | -c "got a certificate request" \ |
| 5866 | -C "skip write certificate" \ |
| 5867 | -C "skip write certificate verify" \ |
| 5868 | -S "skip parse certificate verify" \ |
| 5869 | -s "x509_verify_cert() returned" \ |
| 5870 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5871 | -S "! mbedtls_ssl_handshake returned" \ |
| 5872 | -C "! mbedtls_ssl_handshake returned" \ |
| 5873 | -S "X509 - Certificate verification failed" |
| 5874 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5875 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5876 | requires_full_size_output_buffer |
| 5877 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5878 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5879 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5880 | key_file=data_files/dir-maxpath/09.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5881 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5882 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5883 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5884 | -C "X509 - A fatal error occurred" |
| 5885 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5886 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5887 | requires_full_size_output_buffer |
| 5888 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5889 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5890 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5891 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5892 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5893 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5894 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5895 | -c "X509 - A fatal error occurred" |
| 5896 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5897 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5898 | requires_full_size_output_buffer |
| 5899 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5900 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5901 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5902 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5903 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5904 | debug_level=3 auth_mode=optional" \ |
| 5905 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5906 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5907 | -c "X509 - A fatal error occurred" |
| 5908 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5909 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5910 | requires_full_size_output_buffer |
| 5911 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5912 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5913 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5914 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5915 | key_file=data_files/dir-maxpath/10.key" \ |
| 5916 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5917 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5918 | -s "X509 - A fatal error occurred" |
| 5919 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5920 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5921 | requires_full_size_output_buffer |
| 5922 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5923 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5924 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5925 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5926 | key_file=data_files/dir-maxpath/10.key" \ |
| 5927 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5928 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5929 | -s "X509 - A fatal error occurred" |
| 5930 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5931 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5932 | requires_full_size_output_buffer |
| 5933 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5934 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5935 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5936 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5937 | key_file=data_files/dir-maxpath/09.key" \ |
| 5938 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5939 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5940 | -S "X509 - A fatal error occurred" |
| 5941 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5942 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5943 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5944 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5945 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5946 | "$P_SRV force_version=tls12 crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5947 | key_file=data_files/server5.key \ |
| 5948 | crt_file2=data_files/server5-sha1.crt \ |
| 5949 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5950 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5951 | 0 \ |
| 5952 | -c "signed using.*ECDSA with SHA256" \ |
| 5953 | -C "signed using.*ECDSA with SHA1" |
| 5954 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5955 | # tests for SNI |
| 5956 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5957 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5958 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5959 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5960 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5961 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5962 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5963 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5964 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5965 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5966 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5967 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5968 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5969 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5970 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5971 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5972 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5973 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5974 | 0 \ |
| 5975 | -s "parse ServerName extension" \ |
| 5976 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5977 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5978 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5979 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5980 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5981 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5982 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5983 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5984 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5985 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5986 | 0 \ |
| 5987 | -s "parse ServerName extension" \ |
| 5988 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5989 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5990 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5991 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5992 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5993 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5994 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5995 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 5996 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5997 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5998 | 1 \ |
| 5999 | -s "parse ServerName extension" \ |
| 6000 | -s "ssl_sni_wrapper() returned" \ |
| 6001 | -s "mbedtls_ssl_handshake returned" \ |
| 6002 | -c "mbedtls_ssl_handshake returned" \ |
| 6003 | -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] | 6004 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6005 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6006 | run_test "SNI: client auth no override: optional" \ |
| 6007 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6008 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6009 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6010 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6011 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6012 | -S "skip write certificate request" \ |
| 6013 | -C "skip parse certificate request" \ |
| 6014 | -c "got a certificate request" \ |
| 6015 | -C "skip write certificate" \ |
| 6016 | -C "skip write certificate verify" \ |
| 6017 | -S "skip parse certificate verify" |
| 6018 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6019 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6020 | run_test "SNI: client auth override: none -> optional" \ |
| 6021 | "$P_SRV debug_level=3 auth_mode=none \ |
| 6022 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6023 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6024 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6025 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6026 | -S "skip write certificate request" \ |
| 6027 | -C "skip parse certificate request" \ |
| 6028 | -c "got a certificate request" \ |
| 6029 | -C "skip write certificate" \ |
| 6030 | -C "skip write certificate verify" \ |
| 6031 | -S "skip parse certificate verify" |
| 6032 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6033 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6034 | run_test "SNI: client auth override: optional -> none" \ |
| 6035 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6036 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6037 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6038 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6039 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6040 | -s "skip write certificate request" \ |
| 6041 | -C "skip parse certificate request" \ |
| 6042 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6043 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6044 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6045 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6046 | run_test "SNI: CA no override" \ |
| 6047 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6048 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6049 | ca_file=data_files/test-ca.crt \ |
| 6050 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6051 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6052 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6053 | 1 \ |
| 6054 | -S "skip write certificate request" \ |
| 6055 | -C "skip parse certificate request" \ |
| 6056 | -c "got a certificate request" \ |
| 6057 | -C "skip write certificate" \ |
| 6058 | -C "skip write certificate verify" \ |
| 6059 | -S "skip parse certificate verify" \ |
| 6060 | -s "x509_verify_cert() returned" \ |
| 6061 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6062 | -S "The certificate has been revoked (is on a CRL)" |
| 6063 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6064 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6065 | run_test "SNI: CA override" \ |
| 6066 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6067 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6068 | ca_file=data_files/test-ca.crt \ |
| 6069 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6070 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6071 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6072 | 0 \ |
| 6073 | -S "skip write certificate request" \ |
| 6074 | -C "skip parse certificate request" \ |
| 6075 | -c "got a certificate request" \ |
| 6076 | -C "skip write certificate" \ |
| 6077 | -C "skip write certificate verify" \ |
| 6078 | -S "skip parse certificate verify" \ |
| 6079 | -S "x509_verify_cert() returned" \ |
| 6080 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6081 | -S "The certificate has been revoked (is on a CRL)" |
| 6082 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6083 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6084 | run_test "SNI: CA override with CRL" \ |
| 6085 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6086 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6087 | ca_file=data_files/test-ca.crt \ |
| 6088 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6089 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6090 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6091 | 1 \ |
| 6092 | -S "skip write certificate request" \ |
| 6093 | -C "skip parse certificate request" \ |
| 6094 | -c "got a certificate request" \ |
| 6095 | -C "skip write certificate" \ |
| 6096 | -C "skip write certificate verify" \ |
| 6097 | -S "skip parse certificate verify" \ |
| 6098 | -s "x509_verify_cert() returned" \ |
| 6099 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6100 | -s "The certificate has been revoked (is on a CRL)" |
| 6101 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6102 | # Tests for SNI and DTLS |
| 6103 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6104 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6106 | run_test "SNI: DTLS, no SNI callback" \ |
| 6107 | "$P_SRV debug_level=3 dtls=1 \ |
| 6108 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6109 | "$P_CLI server_name=localhost dtls=1" \ |
| 6110 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6111 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6112 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6113 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6114 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6116 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6117 | "$P_SRV debug_level=3 dtls=1 \ |
| 6118 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6119 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6120 | "$P_CLI server_name=localhost dtls=1" \ |
| 6121 | 0 \ |
| 6122 | -s "parse ServerName extension" \ |
| 6123 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6124 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6125 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6126 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6128 | run_test "SNI: DTLS, matching cert 2" \ |
| 6129 | "$P_SRV debug_level=3 dtls=1 \ |
| 6130 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6131 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6132 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6133 | 0 \ |
| 6134 | -s "parse ServerName extension" \ |
| 6135 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6136 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6139 | run_test "SNI: DTLS, no matching cert" \ |
| 6140 | "$P_SRV debug_level=3 dtls=1 \ |
| 6141 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6142 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6143 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6144 | 1 \ |
| 6145 | -s "parse ServerName extension" \ |
| 6146 | -s "ssl_sni_wrapper() returned" \ |
| 6147 | -s "mbedtls_ssl_handshake returned" \ |
| 6148 | -c "mbedtls_ssl_handshake returned" \ |
| 6149 | -c "SSL - A fatal alert message was received from our peer" |
| 6150 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6152 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6153 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6154 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6155 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6156 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6157 | 0 \ |
| 6158 | -S "skip write certificate request" \ |
| 6159 | -C "skip parse certificate request" \ |
| 6160 | -c "got a certificate request" \ |
| 6161 | -C "skip write certificate" \ |
| 6162 | -C "skip write certificate verify" \ |
| 6163 | -S "skip parse certificate verify" |
| 6164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6166 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6167 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6168 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6169 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6170 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6171 | 0 \ |
| 6172 | -S "skip write certificate request" \ |
| 6173 | -C "skip parse certificate request" \ |
| 6174 | -c "got a certificate request" \ |
| 6175 | -C "skip write certificate" \ |
| 6176 | -C "skip write certificate verify" \ |
| 6177 | -S "skip parse certificate verify" |
| 6178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6180 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6181 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6182 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6183 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6184 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6185 | 0 \ |
| 6186 | -s "skip write certificate request" \ |
| 6187 | -C "skip parse certificate request" \ |
| 6188 | -c "got no certificate request" \ |
| 6189 | -c "skip write certificate" \ |
| 6190 | -c "skip write certificate verify" \ |
| 6191 | -s "skip parse certificate verify" |
| 6192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6194 | run_test "SNI: DTLS, CA no override" \ |
| 6195 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6196 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6197 | ca_file=data_files/test-ca.crt \ |
| 6198 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6199 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6200 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6201 | 1 \ |
| 6202 | -S "skip write certificate request" \ |
| 6203 | -C "skip parse certificate request" \ |
| 6204 | -c "got a certificate request" \ |
| 6205 | -C "skip write certificate" \ |
| 6206 | -C "skip write certificate verify" \ |
| 6207 | -S "skip parse certificate verify" \ |
| 6208 | -s "x509_verify_cert() returned" \ |
| 6209 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6210 | -S "The certificate has been revoked (is on a CRL)" |
| 6211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6213 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6214 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6215 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6216 | ca_file=data_files/test-ca.crt \ |
| 6217 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6218 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6219 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6220 | 0 \ |
| 6221 | -S "skip write certificate request" \ |
| 6222 | -C "skip parse certificate request" \ |
| 6223 | -c "got a certificate request" \ |
| 6224 | -C "skip write certificate" \ |
| 6225 | -C "skip write certificate verify" \ |
| 6226 | -S "skip parse certificate verify" \ |
| 6227 | -S "x509_verify_cert() returned" \ |
| 6228 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6229 | -S "The certificate has been revoked (is on a CRL)" |
| 6230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6232 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6233 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6234 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6235 | ca_file=data_files/test-ca.crt \ |
| 6236 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6237 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6238 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6239 | 1 \ |
| 6240 | -S "skip write certificate request" \ |
| 6241 | -C "skip parse certificate request" \ |
| 6242 | -c "got a certificate request" \ |
| 6243 | -C "skip write certificate" \ |
| 6244 | -C "skip write certificate verify" \ |
| 6245 | -S "skip parse certificate verify" \ |
| 6246 | -s "x509_verify_cert() returned" \ |
| 6247 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6248 | -s "The certificate has been revoked (is on a CRL)" |
| 6249 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6250 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6251 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6252 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6253 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6254 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6255 | "$P_CLI nbio=2 tickets=0" \ |
| 6256 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6257 | -S "mbedtls_ssl_handshake returned" \ |
| 6258 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6259 | -c "Read from server: .* bytes read" |
| 6260 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6261 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6262 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6263 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6264 | "$P_CLI nbio=2 tickets=0" \ |
| 6265 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6266 | -S "mbedtls_ssl_handshake returned" \ |
| 6267 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6268 | -c "Read from server: .* bytes read" |
| 6269 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6270 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6271 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6272 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6273 | "$P_CLI nbio=2 tickets=1" \ |
| 6274 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6275 | -S "mbedtls_ssl_handshake returned" \ |
| 6276 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6277 | -c "Read from server: .* bytes read" |
| 6278 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6279 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6280 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6281 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6282 | "$P_CLI nbio=2 tickets=1" \ |
| 6283 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6284 | -S "mbedtls_ssl_handshake returned" \ |
| 6285 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6286 | -c "Read from server: .* bytes read" |
| 6287 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6288 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6289 | 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] | 6290 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6291 | "$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] | 6292 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6293 | -S "mbedtls_ssl_handshake returned" \ |
| 6294 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6295 | -c "Read from server: .* bytes read" |
| 6296 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6297 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6298 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6299 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6300 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6301 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6302 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6303 | 0 \ |
| 6304 | -S "mbedtls_ssl_handshake returned" \ |
| 6305 | -C "mbedtls_ssl_handshake returned" \ |
| 6306 | -c "Read from server: .* bytes read" |
| 6307 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6308 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6309 | 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] | 6310 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6311 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6312 | 0 \ |
| 6313 | -S "mbedtls_ssl_handshake returned" \ |
| 6314 | -C "mbedtls_ssl_handshake returned" \ |
| 6315 | -c "Read from server: .* bytes read" |
| 6316 | |
| 6317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6318 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6319 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6320 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6321 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6322 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6323 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6324 | -S "mbedtls_ssl_handshake returned" \ |
| 6325 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6326 | -c "Read from server: .* bytes read" |
| 6327 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6328 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6329 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6330 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6331 | "$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] | 6332 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6333 | -S "mbedtls_ssl_handshake returned" \ |
| 6334 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6335 | -c "Read from server: .* bytes read" |
| 6336 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6337 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6338 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6339 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6340 | run_test "Event-driven I/O: basic handshake" \ |
| 6341 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6342 | "$P_CLI event=1 tickets=0" \ |
| 6343 | 0 \ |
| 6344 | -S "mbedtls_ssl_handshake returned" \ |
| 6345 | -C "mbedtls_ssl_handshake returned" \ |
| 6346 | -c "Read from server: .* bytes read" |
| 6347 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6348 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6349 | run_test "Event-driven I/O: client auth" \ |
| 6350 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6351 | "$P_CLI event=1 tickets=0" \ |
| 6352 | 0 \ |
| 6353 | -S "mbedtls_ssl_handshake returned" \ |
| 6354 | -C "mbedtls_ssl_handshake returned" \ |
| 6355 | -c "Read from server: .* bytes read" |
| 6356 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6357 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6358 | run_test "Event-driven I/O: ticket" \ |
| 6359 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6360 | "$P_CLI event=1 tickets=1" \ |
| 6361 | 0 \ |
| 6362 | -S "mbedtls_ssl_handshake returned" \ |
| 6363 | -C "mbedtls_ssl_handshake returned" \ |
| 6364 | -c "Read from server: .* bytes read" |
| 6365 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6366 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6367 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6368 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6369 | "$P_CLI event=1 tickets=1" \ |
| 6370 | 0 \ |
| 6371 | -S "mbedtls_ssl_handshake returned" \ |
| 6372 | -C "mbedtls_ssl_handshake returned" \ |
| 6373 | -c "Read from server: .* bytes read" |
| 6374 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6375 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6376 | 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] | 6377 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6378 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6379 | 0 \ |
| 6380 | -S "mbedtls_ssl_handshake returned" \ |
| 6381 | -C "mbedtls_ssl_handshake returned" \ |
| 6382 | -c "Read from server: .* bytes read" |
| 6383 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6385 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6386 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6387 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6388 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6389 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6390 | 0 \ |
| 6391 | -S "mbedtls_ssl_handshake returned" \ |
| 6392 | -C "mbedtls_ssl_handshake returned" \ |
| 6393 | -c "Read from server: .* bytes read" |
| 6394 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6395 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6396 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6397 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6398 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6399 | 0 \ |
| 6400 | -S "mbedtls_ssl_handshake returned" \ |
| 6401 | -C "mbedtls_ssl_handshake returned" \ |
| 6402 | -c "Read from server: .* bytes read" |
| 6403 | |
| 6404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6405 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6406 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6407 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6408 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6409 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6410 | 0 \ |
| 6411 | -S "mbedtls_ssl_handshake returned" \ |
| 6412 | -C "mbedtls_ssl_handshake returned" \ |
| 6413 | -c "Read from server: .* bytes read" |
| 6414 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6415 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6416 | run_test "Event-driven I/O: session-id resume" \ |
| 6417 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6418 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6419 | 0 \ |
| 6420 | -S "mbedtls_ssl_handshake returned" \ |
| 6421 | -C "mbedtls_ssl_handshake returned" \ |
| 6422 | -c "Read from server: .* bytes read" |
| 6423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6425 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6426 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6427 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6428 | 0 \ |
| 6429 | -c "Read from server: .* bytes read" |
| 6430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6432 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6433 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6434 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6435 | 0 \ |
| 6436 | -c "Read from server: .* bytes read" |
| 6437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6439 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6440 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6441 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6442 | 0 \ |
| 6443 | -c "Read from server: .* bytes read" |
| 6444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6446 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6447 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6448 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6449 | 0 \ |
| 6450 | -c "Read from server: .* bytes read" |
| 6451 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6453 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6454 | "$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] | 6455 | "$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] | 6456 | 0 \ |
| 6457 | -c "Read from server: .* bytes read" |
| 6458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6460 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6461 | "$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] | 6462 | "$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] | 6463 | 0 \ |
| 6464 | -c "Read from server: .* bytes read" |
| 6465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6467 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6468 | "$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] | 6469 | "$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] | 6470 | 0 \ |
| 6471 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6472 | |
| 6473 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6474 | # During session resumption, the client will send its ApplicationData record |
| 6475 | # within the same datagram as the Finished messages. In this situation, the |
| 6476 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6477 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6479 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6480 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6481 | "$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] | 6482 | "$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] | 6483 | 0 \ |
| 6484 | -c "Read from server: .* bytes read" |
| 6485 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6486 | # Tests for version negotiation |
| 6487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6488 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6489 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6490 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6491 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6492 | -S "mbedtls_ssl_handshake returned" \ |
| 6493 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6494 | -s "Protocol is TLSv1.2" \ |
| 6495 | -c "Protocol is TLSv1.2" |
| 6496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6498 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6499 | "$P_SRV" \ |
| 6500 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6501 | 1 \ |
| 6502 | -s "Handshake protocol not within min/max boundaries" \ |
| 6503 | -c "Error in protocol version" \ |
| 6504 | -S "Protocol is TLSv1.0" \ |
| 6505 | -C "Handshake was completed" |
| 6506 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6507 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6508 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6509 | "$P_SRV" \ |
| 6510 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6511 | 1 \ |
| 6512 | -s "Handshake protocol not within min/max boundaries" \ |
| 6513 | -c "Error in protocol version" \ |
| 6514 | -S "Protocol is TLSv1.1" \ |
| 6515 | -C "Handshake was completed" |
| 6516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6518 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6519 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6520 | "$P_CLI" \ |
| 6521 | 1 \ |
| 6522 | -s "Error in protocol version" \ |
| 6523 | -c "Handshake protocol not within min/max boundaries" \ |
| 6524 | -S "Version: TLS1.0" \ |
| 6525 | -C "Protocol is TLSv1.0" |
| 6526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6528 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6529 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6530 | "$P_CLI" \ |
| 6531 | 1 \ |
| 6532 | -s "Error in protocol version" \ |
| 6533 | -c "Handshake protocol not within min/max boundaries" \ |
| 6534 | -S "Version: TLS1.1" \ |
| 6535 | -C "Protocol is TLSv1.1" |
| 6536 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6537 | # Tests for ALPN extension |
| 6538 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6539 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6540 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6541 | "$P_SRV debug_level=3" \ |
| 6542 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6543 | 0 \ |
| 6544 | -C "client hello, adding alpn extension" \ |
| 6545 | -S "found alpn extension" \ |
| 6546 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6547 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6548 | -C "found alpn extension " \ |
| 6549 | -C "Application Layer Protocol is" \ |
| 6550 | -S "Application Layer Protocol is" |
| 6551 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6552 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6553 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6554 | "$P_SRV debug_level=3" \ |
| 6555 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6556 | 0 \ |
| 6557 | -c "client hello, adding alpn extension" \ |
| 6558 | -s "found alpn extension" \ |
| 6559 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6560 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6561 | -C "found alpn extension " \ |
| 6562 | -c "Application Layer Protocol is (none)" \ |
| 6563 | -S "Application Layer Protocol is" |
| 6564 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6565 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6566 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6567 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6568 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6569 | 0 \ |
| 6570 | -C "client hello, adding alpn extension" \ |
| 6571 | -S "found alpn extension" \ |
| 6572 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6573 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6574 | -C "found alpn extension " \ |
| 6575 | -C "Application Layer Protocol is" \ |
| 6576 | -s "Application Layer Protocol is (none)" |
| 6577 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6578 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6579 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6580 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6581 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6582 | 0 \ |
| 6583 | -c "client hello, adding alpn extension" \ |
| 6584 | -s "found alpn extension" \ |
| 6585 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6586 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6587 | -c "found alpn extension" \ |
| 6588 | -c "Application Layer Protocol is abc" \ |
| 6589 | -s "Application Layer Protocol is abc" |
| 6590 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6591 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6592 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6593 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6594 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6595 | 0 \ |
| 6596 | -c "client hello, adding alpn extension" \ |
| 6597 | -s "found alpn extension" \ |
| 6598 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6599 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6600 | -c "found alpn extension" \ |
| 6601 | -c "Application Layer Protocol is abc" \ |
| 6602 | -s "Application Layer Protocol is abc" |
| 6603 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6604 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6605 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6606 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6607 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6608 | 0 \ |
| 6609 | -c "client hello, adding alpn extension" \ |
| 6610 | -s "found alpn extension" \ |
| 6611 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6612 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6613 | -c "found alpn extension" \ |
| 6614 | -c "Application Layer Protocol is 1234" \ |
| 6615 | -s "Application Layer Protocol is 1234" |
| 6616 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6617 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6618 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6619 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6620 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6621 | 1 \ |
| 6622 | -c "client hello, adding alpn extension" \ |
| 6623 | -s "found alpn extension" \ |
| 6624 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6625 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6626 | -C "found alpn extension" \ |
| 6627 | -C "Application Layer Protocol is 1234" \ |
| 6628 | -S "Application Layer Protocol is 1234" |
| 6629 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6630 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6631 | # Tests for keyUsage in leaf certificates, part 1: |
| 6632 | # server-side certificate/suite selection |
| 6633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6634 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6635 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6636 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6637 | "$P_CLI" \ |
| 6638 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6639 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6640 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6641 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6642 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6643 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6644 | "$P_CLI" \ |
| 6645 | 0 \ |
| 6646 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6648 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6649 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6650 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6651 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6652 | 1 \ |
| 6653 | -C "Ciphersuite is " |
| 6654 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 6655 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6656 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6657 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6658 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6659 | "$P_CLI" \ |
| 6660 | 0 \ |
| 6661 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6662 | |
| 6663 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6664 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6665 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6666 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6667 | "$P_CLI" \ |
| 6668 | 0 \ |
| 6669 | -c "Ciphersuite is TLS-ECDH-" |
| 6670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6671 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6672 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6673 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6674 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6675 | 1 \ |
| 6676 | -C "Ciphersuite is " |
| 6677 | |
| 6678 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6679 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6681 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6682 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6683 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6684 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6685 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6686 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6687 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6688 | -C "Processing of the Certificate handshake message failed" \ |
| 6689 | -c "Ciphersuite is TLS-" |
| 6690 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6691 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6692 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6693 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6694 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6695 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6696 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6697 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6698 | -C "Processing of the Certificate handshake message failed" \ |
| 6699 | -c "Ciphersuite is TLS-" |
| 6700 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6701 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6702 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6703 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6704 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6705 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6706 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6707 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6708 | -C "Processing of the Certificate handshake message failed" \ |
| 6709 | -c "Ciphersuite is TLS-" |
| 6710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6711 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6712 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6713 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6714 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6715 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6716 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6717 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6718 | -c "Processing of the Certificate handshake message failed" \ |
| 6719 | -C "Ciphersuite is TLS-" |
| 6720 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6721 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6722 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6723 | -cert data_files/server2.ku-ke.crt" \ |
| 6724 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6725 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6726 | 0 \ |
| 6727 | -c "bad certificate (usage extensions)" \ |
| 6728 | -C "Processing of the Certificate handshake message failed" \ |
| 6729 | -c "Ciphersuite is TLS-" \ |
| 6730 | -c "! Usage does not match the keyUsage extension" |
| 6731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6732 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6733 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6734 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6735 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6736 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6737 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6738 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6739 | -C "Processing of the Certificate handshake message failed" \ |
| 6740 | -c "Ciphersuite is TLS-" |
| 6741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6742 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6743 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6744 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6745 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6746 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6747 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6748 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6749 | -c "Processing of the Certificate handshake message failed" \ |
| 6750 | -C "Ciphersuite is TLS-" |
| 6751 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6752 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6753 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6754 | -cert data_files/server2.ku-ds.crt" \ |
| 6755 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6756 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6757 | 0 \ |
| 6758 | -c "bad certificate (usage extensions)" \ |
| 6759 | -C "Processing of the Certificate handshake message failed" \ |
| 6760 | -c "Ciphersuite is TLS-" \ |
| 6761 | -c "! Usage does not match the keyUsage extension" |
| 6762 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6763 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6764 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6765 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6766 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6767 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6768 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6769 | "$P_CLI debug_level=3" \ |
| 6770 | 0 \ |
| 6771 | -C "bad certificate (usage extensions)" \ |
| 6772 | -C "Processing of the Certificate handshake message failed" \ |
| 6773 | -c "Ciphersuite is" |
| 6774 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6775 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6776 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6777 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6778 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6779 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6780 | -cert data_files/server2.ku-ke.crt" \ |
| 6781 | "$P_CLI debug_level=1" \ |
| 6782 | 1 \ |
| 6783 | -c "bad certificate (usage extensions)" \ |
| 6784 | -c "Processing of the Certificate handshake message failed" \ |
| 6785 | -C "Ciphersuite is" |
| 6786 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6787 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6788 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6789 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6790 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6791 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6792 | -cert data_files/server2.ku-ka.crt" \ |
| 6793 | "$P_CLI debug_level=1" \ |
| 6794 | 1 \ |
| 6795 | -c "bad certificate (usage extensions)" \ |
| 6796 | -c "Processing of the Certificate handshake message failed" \ |
| 6797 | -C "Ciphersuite is" |
| 6798 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6799 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6800 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6801 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6802 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6803 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6804 | -cert data_files/server5.ku-ds.crt" \ |
| 6805 | "$P_CLI debug_level=3" \ |
| 6806 | 0 \ |
| 6807 | -C "bad certificate (usage extensions)" \ |
| 6808 | -C "Processing of the Certificate handshake message failed" \ |
| 6809 | -c "Ciphersuite is" |
| 6810 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6811 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6812 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6813 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6814 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6815 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6816 | -cert data_files/server5.ku-ke.crt" \ |
| 6817 | "$P_CLI debug_level=1" \ |
| 6818 | 1 \ |
| 6819 | -c "bad certificate (usage extensions)" \ |
| 6820 | -c "Processing of the Certificate handshake message failed" \ |
| 6821 | -C "Ciphersuite is" |
| 6822 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6823 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6824 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6825 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6826 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6827 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6828 | -cert data_files/server5.ku-ka.crt" \ |
| 6829 | "$P_CLI debug_level=1" \ |
| 6830 | 1 \ |
| 6831 | -c "bad certificate (usage extensions)" \ |
| 6832 | -c "Processing of the Certificate handshake message failed" \ |
| 6833 | -C "Ciphersuite is" |
| 6834 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6835 | # Tests for keyUsage in leaf certificates, part 3: |
| 6836 | # server-side checking of client cert |
| 6837 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6839 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6840 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6841 | "$O_CLI -key data_files/server2.key \ |
| 6842 | -cert data_files/server2.ku-ds.crt" \ |
| 6843 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6844 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6845 | -S "bad certificate (usage extensions)" \ |
| 6846 | -S "Processing of the Certificate handshake message failed" |
| 6847 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6849 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6850 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6851 | "$O_CLI -key data_files/server2.key \ |
| 6852 | -cert data_files/server2.ku-ke.crt" \ |
| 6853 | 0 \ |
| 6854 | -s "bad certificate (usage extensions)" \ |
| 6855 | -S "Processing of the Certificate handshake message failed" |
| 6856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6858 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6859 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6860 | "$O_CLI -key data_files/server2.key \ |
| 6861 | -cert data_files/server2.ku-ke.crt" \ |
| 6862 | 1 \ |
| 6863 | -s "bad certificate (usage extensions)" \ |
| 6864 | -s "Processing of the Certificate handshake message failed" |
| 6865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6867 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6868 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6869 | "$O_CLI -key data_files/server5.key \ |
| 6870 | -cert data_files/server5.ku-ds.crt" \ |
| 6871 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6872 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6873 | -S "bad certificate (usage extensions)" \ |
| 6874 | -S "Processing of the Certificate handshake message failed" |
| 6875 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6877 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6878 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6879 | "$O_CLI -key data_files/server5.key \ |
| 6880 | -cert data_files/server5.ku-ka.crt" \ |
| 6881 | 0 \ |
| 6882 | -s "bad certificate (usage extensions)" \ |
| 6883 | -S "Processing of the Certificate handshake message failed" |
| 6884 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6885 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6886 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6887 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6888 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6889 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6890 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6891 | -cert data_files/server2.ku-ds.crt" \ |
| 6892 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6893 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6894 | -S "bad certificate (usage extensions)" \ |
| 6895 | -S "Processing of the Certificate handshake message failed" |
| 6896 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6897 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6898 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6899 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6900 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6901 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6902 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6903 | -cert data_files/server2.ku-ke.crt" \ |
| 6904 | 0 \ |
| 6905 | -s "bad certificate (usage extensions)" \ |
| 6906 | -S "Processing of the Certificate handshake message failed" |
| 6907 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6908 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6909 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6910 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6911 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6912 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6913 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6914 | -cert data_files/server5.ku-ds.crt" \ |
| 6915 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6916 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6917 | -S "bad certificate (usage extensions)" \ |
| 6918 | -S "Processing of the Certificate handshake message failed" |
| 6919 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6920 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6921 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6922 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6923 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6924 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6925 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6926 | -cert data_files/server5.ku-ka.crt" \ |
| 6927 | 0 \ |
| 6928 | -s "bad certificate (usage extensions)" \ |
| 6929 | -S "Processing of the Certificate handshake message failed" |
| 6930 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6931 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6932 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6933 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6934 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6935 | "$P_SRV key_file=data_files/server5.key \ |
| 6936 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6937 | "$P_CLI" \ |
| 6938 | 0 |
| 6939 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6940 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6941 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6942 | "$P_SRV key_file=data_files/server5.key \ |
| 6943 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6944 | "$P_CLI" \ |
| 6945 | 0 |
| 6946 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6947 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6948 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6949 | "$P_SRV key_file=data_files/server5.key \ |
| 6950 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6951 | "$P_CLI" \ |
| 6952 | 0 |
| 6953 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6954 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6955 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6956 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6957 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6958 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6959 | 1 |
| 6960 | |
| 6961 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6964 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6965 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6966 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6967 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6968 | 0 \ |
| 6969 | -C "bad certificate (usage extensions)" \ |
| 6970 | -C "Processing of the Certificate handshake message failed" \ |
| 6971 | -c "Ciphersuite is TLS-" |
| 6972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6974 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6975 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6976 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6977 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6978 | 0 \ |
| 6979 | -C "bad certificate (usage extensions)" \ |
| 6980 | -C "Processing of the Certificate handshake message failed" \ |
| 6981 | -c "Ciphersuite is TLS-" |
| 6982 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6983 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6984 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6985 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6986 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6987 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6988 | 0 \ |
| 6989 | -C "bad certificate (usage extensions)" \ |
| 6990 | -C "Processing of the Certificate handshake message failed" \ |
| 6991 | -c "Ciphersuite is TLS-" |
| 6992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6994 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6995 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6996 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6997 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6998 | 1 \ |
| 6999 | -c "bad certificate (usage extensions)" \ |
| 7000 | -c "Processing of the Certificate handshake message failed" \ |
| 7001 | -C "Ciphersuite is TLS-" |
| 7002 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7003 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7004 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7005 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7006 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 7007 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7008 | -cert data_files/server5.eku-srv.crt" \ |
| 7009 | "$P_CLI debug_level=1" \ |
| 7010 | 0 \ |
| 7011 | -C "bad certificate (usage extensions)" \ |
| 7012 | -C "Processing of the Certificate handshake message failed" \ |
| 7013 | -c "Ciphersuite is" |
| 7014 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7015 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7016 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7017 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7018 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 7019 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7020 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7021 | "$P_CLI debug_level=1" \ |
| 7022 | 0 \ |
| 7023 | -C "bad certificate (usage extensions)" \ |
| 7024 | -C "Processing of the Certificate handshake message failed" \ |
| 7025 | -c "Ciphersuite is" |
| 7026 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7027 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7028 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7029 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7030 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 7031 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7032 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7033 | "$P_CLI debug_level=1" \ |
| 7034 | 0 \ |
| 7035 | -C "bad certificate (usage extensions)" \ |
| 7036 | -C "Processing of the Certificate handshake message failed" \ |
| 7037 | -c "Ciphersuite is" |
| 7038 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7039 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7040 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7041 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7042 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 7043 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7044 | -cert data_files/server5.eku-cs.crt" \ |
| 7045 | "$P_CLI debug_level=1" \ |
| 7046 | 1 \ |
| 7047 | -c "bad certificate (usage extensions)" \ |
| 7048 | -c "Processing of the Certificate handshake message failed" \ |
| 7049 | -C "Ciphersuite is" |
| 7050 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7051 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 7052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7054 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7055 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7056 | "$O_CLI -key data_files/server5.key \ |
| 7057 | -cert data_files/server5.eku-cli.crt" \ |
| 7058 | 0 \ |
| 7059 | -S "bad certificate (usage extensions)" \ |
| 7060 | -S "Processing of the Certificate handshake message failed" |
| 7061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7063 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7064 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7065 | "$O_CLI -key data_files/server5.key \ |
| 7066 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7067 | 0 \ |
| 7068 | -S "bad certificate (usage extensions)" \ |
| 7069 | -S "Processing of the Certificate handshake message failed" |
| 7070 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7072 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7073 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7074 | "$O_CLI -key data_files/server5.key \ |
| 7075 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7076 | 0 \ |
| 7077 | -S "bad certificate (usage extensions)" \ |
| 7078 | -S "Processing of the Certificate handshake message failed" |
| 7079 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7081 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7082 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7083 | "$O_CLI -key data_files/server5.key \ |
| 7084 | -cert data_files/server5.eku-cs.crt" \ |
| 7085 | 0 \ |
| 7086 | -s "bad certificate (usage extensions)" \ |
| 7087 | -S "Processing of the Certificate handshake message failed" |
| 7088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7090 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7091 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7092 | "$O_CLI -key data_files/server5.key \ |
| 7093 | -cert data_files/server5.eku-cs.crt" \ |
| 7094 | 1 \ |
| 7095 | -s "bad certificate (usage extensions)" \ |
| 7096 | -s "Processing of the Certificate handshake message failed" |
| 7097 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7098 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7099 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7100 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7101 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7102 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7103 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7104 | -cert data_files/server5.eku-cli.crt" \ |
| 7105 | 0 \ |
| 7106 | -S "bad certificate (usage extensions)" \ |
| 7107 | -S "Processing of the Certificate handshake message failed" |
| 7108 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7109 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7110 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7111 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7112 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7113 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7114 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7115 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7116 | 0 \ |
| 7117 | -S "bad certificate (usage extensions)" \ |
| 7118 | -S "Processing of the Certificate handshake message failed" |
| 7119 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7120 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7121 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7122 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7123 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7124 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7125 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7126 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7127 | 0 \ |
| 7128 | -S "bad certificate (usage extensions)" \ |
| 7129 | -S "Processing of the Certificate handshake message failed" |
| 7130 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7131 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7132 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7133 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7134 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7135 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7136 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7137 | -cert data_files/server5.eku-cs.crt" \ |
| 7138 | 0 \ |
| 7139 | -s "bad certificate (usage extensions)" \ |
| 7140 | -S "Processing of the Certificate handshake message failed" |
| 7141 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7142 | # Tests for DHM parameters loading |
| 7143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7144 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7145 | "$P_SRV" \ |
| 7146 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7147 | debug_level=3" \ |
| 7148 | 0 \ |
| 7149 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7150 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7152 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7153 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7154 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7155 | debug_level=3" \ |
| 7156 | 0 \ |
| 7157 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7158 | -c "value of 'DHM: G ' (2 bits)" |
| 7159 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7160 | # Tests for DHM client-side size checking |
| 7161 | |
| 7162 | run_test "DHM size: server default, client default, OK" \ |
| 7163 | "$P_SRV" \ |
| 7164 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7165 | debug_level=1" \ |
| 7166 | 0 \ |
| 7167 | -C "DHM prime too short:" |
| 7168 | |
| 7169 | run_test "DHM size: server default, client 2048, OK" \ |
| 7170 | "$P_SRV" \ |
| 7171 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7172 | debug_level=1 dhmlen=2048" \ |
| 7173 | 0 \ |
| 7174 | -C "DHM prime too short:" |
| 7175 | |
| 7176 | run_test "DHM size: server 1024, client default, OK" \ |
| 7177 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7178 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7179 | debug_level=1" \ |
| 7180 | 0 \ |
| 7181 | -C "DHM prime too short:" |
| 7182 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7183 | run_test "DHM size: server 999, client 999, OK" \ |
| 7184 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7185 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7186 | debug_level=1 dhmlen=999" \ |
| 7187 | 0 \ |
| 7188 | -C "DHM prime too short:" |
| 7189 | |
| 7190 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7191 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7192 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7193 | debug_level=1 dhmlen=1000" \ |
| 7194 | 0 \ |
| 7195 | -C "DHM prime too short:" |
| 7196 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7197 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7198 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7199 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7200 | debug_level=1" \ |
| 7201 | 1 \ |
| 7202 | -c "DHM prime too short:" |
| 7203 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7204 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7205 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7206 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7207 | debug_level=1 dhmlen=1001" \ |
| 7208 | 1 \ |
| 7209 | -c "DHM prime too short:" |
| 7210 | |
| 7211 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7212 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7213 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7214 | debug_level=1 dhmlen=1000" \ |
| 7215 | 1 \ |
| 7216 | -c "DHM prime too short:" |
| 7217 | |
| 7218 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7219 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7220 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7221 | debug_level=1 dhmlen=999" \ |
| 7222 | 1 \ |
| 7223 | -c "DHM prime too short:" |
| 7224 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7225 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7226 | "$P_SRV" \ |
| 7227 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7228 | debug_level=1 dhmlen=2049" \ |
| 7229 | 1 \ |
| 7230 | -c "DHM prime too short:" |
| 7231 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7232 | # Tests for PSK callback |
| 7233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7234 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7235 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7236 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7237 | psk_identity=foo psk=abc123" \ |
| 7238 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7239 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7240 | -S "SSL - Unknown identity received" \ |
| 7241 | -S "SSL - Verification of the message MAC failed" |
| 7242 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7244 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7245 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7246 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7247 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7248 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7249 | -C "session hash for extended master secret"\ |
| 7250 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7251 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7252 | -S "SSL - Unknown identity received" \ |
| 7253 | -S "SSL - Verification of the message MAC failed" |
| 7254 | |
| 7255 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7256 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7257 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7258 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7259 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7260 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7261 | -C "session hash for extended master secret"\ |
| 7262 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7263 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7264 | -S "SSL - Unknown identity received" \ |
| 7265 | -S "SSL - Verification of the message MAC failed" |
| 7266 | |
| 7267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7268 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7269 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7270 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7271 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7272 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7273 | -c "session hash for extended master secret"\ |
| 7274 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7275 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7276 | -S "SSL - Unknown identity received" \ |
| 7277 | -S "SSL - Verification of the message MAC failed" |
| 7278 | |
| 7279 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7280 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7281 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7282 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7283 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7284 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7285 | -c "session hash for extended master secret"\ |
| 7286 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7287 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7288 | -S "SSL - Unknown identity received" \ |
| 7289 | -S "SSL - Verification of the message MAC failed" |
| 7290 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7291 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7292 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7293 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7294 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7295 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7296 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7297 | -C "session hash for extended master secret"\ |
| 7298 | -S "session hash for extended master secret"\ |
| 7299 | -S "SSL - The handshake negotiation failed" \ |
| 7300 | -S "SSL - Unknown identity received" \ |
| 7301 | -S "SSL - Verification of the message MAC failed" |
| 7302 | |
| 7303 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7304 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7305 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7306 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7307 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7308 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7309 | -C "session hash for extended master secret"\ |
| 7310 | -S "session hash for extended master secret"\ |
| 7311 | -S "SSL - The handshake negotiation failed" \ |
| 7312 | -S "SSL - Unknown identity received" \ |
| 7313 | -S "SSL - Verification of the message MAC failed" |
| 7314 | |
| 7315 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7316 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7317 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7318 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7319 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7320 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7321 | -c "session hash for extended master secret"\ |
| 7322 | -s "session hash for extended master secret"\ |
| 7323 | -S "SSL - The handshake negotiation failed" \ |
| 7324 | -S "SSL - Unknown identity received" \ |
| 7325 | -S "SSL - Verification of the message MAC failed" |
| 7326 | |
| 7327 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7328 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7329 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7330 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7331 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7332 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7333 | -c "session hash for extended master secret"\ |
| 7334 | -s "session hash for extended master secret"\ |
| 7335 | -S "SSL - The handshake negotiation failed" \ |
| 7336 | -S "SSL - Unknown identity received" \ |
| 7337 | -S "SSL - Verification of the message MAC failed" |
| 7338 | |
| 7339 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7340 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7341 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7342 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7343 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7344 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7345 | -C "session hash for extended master secret"\ |
| 7346 | -S "session hash for extended master secret"\ |
| 7347 | -S "SSL - The handshake negotiation failed" \ |
| 7348 | -S "SSL - Unknown identity received" \ |
| 7349 | -S "SSL - Verification of the message MAC failed" |
| 7350 | |
| 7351 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7352 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7353 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7354 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7355 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7356 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7357 | -C "session hash for extended master secret"\ |
| 7358 | -S "session hash for extended master secret"\ |
| 7359 | -S "SSL - The handshake negotiation failed" \ |
| 7360 | -S "SSL - Unknown identity received" \ |
| 7361 | -S "SSL - Verification of the message MAC failed" |
| 7362 | |
| 7363 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7364 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7365 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7366 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7367 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7368 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7369 | -c "session hash for extended master secret"\ |
| 7370 | -s "session hash for extended master secret"\ |
| 7371 | -S "SSL - The handshake negotiation failed" \ |
| 7372 | -S "SSL - Unknown identity received" \ |
| 7373 | -S "SSL - Verification of the message MAC failed" |
| 7374 | |
| 7375 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7376 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7377 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7378 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7379 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7380 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7381 | -c "session hash for extended master secret"\ |
| 7382 | -s "session hash for extended master secret"\ |
| 7383 | -S "SSL - The handshake negotiation failed" \ |
| 7384 | -S "SSL - Unknown identity received" \ |
| 7385 | -S "SSL - Verification of the message MAC failed" |
| 7386 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7387 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7388 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7389 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7390 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7391 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7392 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7393 | -C "session hash for extended master secret"\ |
| 7394 | -S "session hash for extended master secret"\ |
| 7395 | -S "SSL - The handshake negotiation failed" \ |
| 7396 | -S "SSL - Unknown identity received" \ |
| 7397 | -S "SSL - Verification of the message MAC failed" |
| 7398 | |
| 7399 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7400 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7401 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7402 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7403 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7404 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7405 | -C "session hash for extended master secret"\ |
| 7406 | -S "session hash for extended master secret"\ |
| 7407 | -S "SSL - The handshake negotiation failed" \ |
| 7408 | -S "SSL - Unknown identity received" \ |
| 7409 | -S "SSL - Verification of the message MAC failed" |
| 7410 | |
| 7411 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7412 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7413 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7414 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7415 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7416 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7417 | -c "session hash for extended master secret"\ |
| 7418 | -s "session hash for extended master secret"\ |
| 7419 | -S "SSL - The handshake negotiation failed" \ |
| 7420 | -S "SSL - Unknown identity received" \ |
| 7421 | -S "SSL - Verification of the message MAC failed" |
| 7422 | |
| 7423 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7424 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7425 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7426 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7427 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7428 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7429 | -c "session hash for extended master secret"\ |
| 7430 | -s "session hash for extended master secret"\ |
| 7431 | -S "SSL - The handshake negotiation failed" \ |
| 7432 | -S "SSL - Unknown identity received" \ |
| 7433 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7434 | |
| 7435 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7436 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7437 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7438 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7439 | psk_identity=foo psk=abc123" \ |
| 7440 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7441 | -C "session hash for extended master secret"\ |
| 7442 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7443 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7444 | -S "SSL - Unknown identity received" \ |
| 7445 | -S "SSL - Verification of the message MAC failed" |
| 7446 | |
| 7447 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7448 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7449 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7450 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7451 | psk_identity=foo psk=abc123" \ |
| 7452 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7453 | -C "session hash for extended master secret"\ |
| 7454 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7455 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7456 | -S "SSL - Unknown identity received" \ |
| 7457 | -S "SSL - Verification of the message MAC failed" |
| 7458 | |
| 7459 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7460 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7461 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7462 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7463 | "$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] | 7464 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7465 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7466 | -c "session hash for extended master secret"\ |
| 7467 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7468 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7469 | -S "SSL - Unknown identity received" \ |
| 7470 | -S "SSL - Verification of the message MAC failed" |
| 7471 | |
| 7472 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7473 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7474 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7475 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7476 | "$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] | 7477 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7478 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7479 | -c "session hash for extended master secret"\ |
| 7480 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7481 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7482 | -S "SSL - Unknown identity received" \ |
| 7483 | -S "SSL - Verification of the message MAC failed" |
| 7484 | |
| 7485 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7486 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7487 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7488 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7489 | psk_identity=foo psk=abc123" \ |
| 7490 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7491 | -C "session hash for extended master secret"\ |
| 7492 | -S "session hash for extended master secret"\ |
| 7493 | -S "SSL - The handshake negotiation failed" \ |
| 7494 | -S "SSL - Unknown identity received" \ |
| 7495 | -S "SSL - Verification of the message MAC failed" |
| 7496 | |
| 7497 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7498 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7499 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7500 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7501 | psk_identity=foo psk=abc123" \ |
| 7502 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7503 | -C "session hash for extended master secret"\ |
| 7504 | -S "session hash for extended master secret"\ |
| 7505 | -S "SSL - The handshake negotiation failed" \ |
| 7506 | -S "SSL - Unknown identity received" \ |
| 7507 | -S "SSL - Verification of the message MAC failed" |
| 7508 | |
| 7509 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7510 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7511 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7512 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7513 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7514 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7515 | 0 \ |
| 7516 | -c "session hash for extended master secret"\ |
| 7517 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7518 | -S "SSL - The handshake negotiation failed" \ |
| 7519 | -S "SSL - Unknown identity received" \ |
| 7520 | -S "SSL - Verification of the message MAC failed" |
| 7521 | |
| 7522 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7523 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7524 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7525 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7526 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7527 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7528 | 0 \ |
| 7529 | -c "session hash for extended master secret"\ |
| 7530 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7531 | -S "SSL - The handshake negotiation failed" \ |
| 7532 | -S "SSL - Unknown identity received" \ |
| 7533 | -S "SSL - Verification of the message MAC failed" |
| 7534 | |
| 7535 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7536 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7537 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7538 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7539 | psk_identity=foo psk=abc123" \ |
| 7540 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7541 | -C "session hash for extended master secret"\ |
| 7542 | -S "session hash for extended master secret"\ |
| 7543 | -S "SSL - The handshake negotiation failed" \ |
| 7544 | -S "SSL - Unknown identity received" \ |
| 7545 | -S "SSL - Verification of the message MAC failed" |
| 7546 | |
| 7547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7548 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7549 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7550 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7551 | psk_identity=foo psk=abc123" \ |
| 7552 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7553 | -C "session hash for extended master secret"\ |
| 7554 | -S "session hash for extended master secret"\ |
| 7555 | -S "SSL - The handshake negotiation failed" \ |
| 7556 | -S "SSL - Unknown identity received" \ |
| 7557 | -S "SSL - Verification of the message MAC failed" |
| 7558 | |
| 7559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7560 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7561 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7562 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7563 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7564 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7565 | 0 \ |
| 7566 | -c "session hash for extended master secret"\ |
| 7567 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7568 | -S "SSL - The handshake negotiation failed" \ |
| 7569 | -S "SSL - Unknown identity received" \ |
| 7570 | -S "SSL - Verification of the message MAC failed" |
| 7571 | |
| 7572 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7573 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7574 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7575 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7576 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7577 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7578 | 0 \ |
| 7579 | -c "session hash for extended master secret"\ |
| 7580 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7581 | -S "SSL - The handshake negotiation failed" \ |
| 7582 | -S "SSL - Unknown identity received" \ |
| 7583 | -S "SSL - Verification of the message MAC failed" |
| 7584 | |
| 7585 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7586 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7587 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7588 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7589 | psk_identity=foo psk=abc123" \ |
| 7590 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7591 | -C "session hash for extended master secret"\ |
| 7592 | -S "session hash for extended master secret"\ |
| 7593 | -S "SSL - The handshake negotiation failed" \ |
| 7594 | -S "SSL - Unknown identity received" \ |
| 7595 | -S "SSL - Verification of the message MAC failed" |
| 7596 | |
| 7597 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7598 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7599 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7600 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7601 | psk_identity=foo psk=abc123" \ |
| 7602 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7603 | -C "session hash for extended master secret"\ |
| 7604 | -S "session hash for extended master secret"\ |
| 7605 | -S "SSL - The handshake negotiation failed" \ |
| 7606 | -S "SSL - Unknown identity received" \ |
| 7607 | -S "SSL - Verification of the message MAC failed" |
| 7608 | |
| 7609 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7610 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7611 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7612 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7613 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7614 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7615 | 0 \ |
| 7616 | -c "session hash for extended master secret"\ |
| 7617 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7618 | -S "SSL - The handshake negotiation failed" \ |
| 7619 | -S "SSL - Unknown identity received" \ |
| 7620 | -S "SSL - Verification of the message MAC failed" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7623 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7624 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7625 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7626 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7627 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7628 | 0 \ |
| 7629 | -c "session hash for extended master secret"\ |
| 7630 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7631 | -S "SSL - The handshake negotiation failed" \ |
| 7632 | -S "SSL - Unknown identity received" \ |
| 7633 | -S "SSL - Verification of the message MAC failed" |
| 7634 | |
| 7635 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7636 | 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] | 7637 | "$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" \ |
| 7638 | "$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] | 7639 | psk_identity=def psk=beef" \ |
| 7640 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7641 | -C "session hash for extended master secret"\ |
| 7642 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7643 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7644 | -S "SSL - Unknown identity received" \ |
| 7645 | -S "SSL - Verification of the message MAC failed" |
| 7646 | |
| 7647 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7648 | 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] | 7649 | "$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" \ |
| 7650 | "$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] | 7651 | psk_identity=def psk=beef" \ |
| 7652 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7653 | -C "session hash for extended master secret"\ |
| 7654 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7655 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7656 | -S "SSL - Unknown identity received" \ |
| 7657 | -S "SSL - Verification of the message MAC failed" |
| 7658 | |
| 7659 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7660 | 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] | 7661 | "$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] | 7662 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7663 | "$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] | 7664 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7665 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7666 | -c "session hash for extended master secret"\ |
| 7667 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7668 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7669 | -S "SSL - Unknown identity received" \ |
| 7670 | -S "SSL - Verification of the message MAC failed" |
| 7671 | |
| 7672 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7673 | 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] | 7674 | "$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] | 7675 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7676 | "$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] | 7677 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7678 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7679 | -c "session hash for extended master secret"\ |
| 7680 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7681 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7682 | -S "SSL - Unknown identity received" \ |
| 7683 | -S "SSL - Verification of the message MAC failed" |
| 7684 | |
| 7685 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7686 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7687 | "$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" \ |
| 7688 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7689 | psk_identity=def psk=beef" \ |
| 7690 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7691 | -C "session hash for extended master secret"\ |
| 7692 | -S "session hash for extended master secret"\ |
| 7693 | -S "SSL - The handshake negotiation failed" \ |
| 7694 | -S "SSL - Unknown identity received" \ |
| 7695 | -S "SSL - Verification of the message MAC failed" |
| 7696 | |
| 7697 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7698 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7699 | "$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" \ |
| 7700 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7701 | psk_identity=def psk=beef" \ |
| 7702 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7703 | -C "session hash for extended master secret"\ |
| 7704 | -S "session hash for extended master secret"\ |
| 7705 | -S "SSL - The handshake negotiation failed" \ |
| 7706 | -S "SSL - Unknown identity received" \ |
| 7707 | -S "SSL - Verification of the message MAC failed" |
| 7708 | |
| 7709 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7710 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7711 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7712 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7713 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7714 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7715 | 0 \ |
| 7716 | -c "session hash for extended master secret"\ |
| 7717 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7718 | -S "SSL - The handshake negotiation failed" \ |
| 7719 | -S "SSL - Unknown identity received" \ |
| 7720 | -S "SSL - Verification of the message MAC failed" |
| 7721 | |
| 7722 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7723 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7724 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7725 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7726 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7727 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7728 | 0 \ |
| 7729 | -c "session hash for extended master secret"\ |
| 7730 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7731 | -S "SSL - The handshake negotiation failed" \ |
| 7732 | -S "SSL - Unknown identity received" \ |
| 7733 | -S "SSL - Verification of the message MAC failed" |
| 7734 | |
| 7735 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7736 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7737 | "$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" \ |
| 7738 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7739 | psk_identity=def psk=beef" \ |
| 7740 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7741 | -C "session hash for extended master secret"\ |
| 7742 | -S "session hash for extended master secret"\ |
| 7743 | -S "SSL - The handshake negotiation failed" \ |
| 7744 | -S "SSL - Unknown identity received" \ |
| 7745 | -S "SSL - Verification of the message MAC failed" |
| 7746 | |
| 7747 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7748 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7749 | "$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" \ |
| 7750 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7751 | psk_identity=def psk=beef" \ |
| 7752 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7753 | -C "session hash for extended master secret"\ |
| 7754 | -S "session hash for extended master secret"\ |
| 7755 | -S "SSL - The handshake negotiation failed" \ |
| 7756 | -S "SSL - Unknown identity received" \ |
| 7757 | -S "SSL - Verification of the message MAC failed" |
| 7758 | |
| 7759 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7760 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7761 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7762 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7763 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7764 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7765 | 0 \ |
| 7766 | -c "session hash for extended master secret"\ |
| 7767 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7768 | -S "SSL - The handshake negotiation failed" \ |
| 7769 | -S "SSL - Unknown identity received" \ |
| 7770 | -S "SSL - Verification of the message MAC failed" |
| 7771 | |
| 7772 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7773 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7774 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7775 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7776 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7777 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7778 | 0 \ |
| 7779 | -c "session hash for extended master secret"\ |
| 7780 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7781 | -S "SSL - The handshake negotiation failed" \ |
| 7782 | -S "SSL - Unknown identity received" \ |
| 7783 | -S "SSL - Verification of the message MAC failed" |
| 7784 | |
| 7785 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7786 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7787 | "$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" \ |
| 7788 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7789 | psk_identity=def psk=beef" \ |
| 7790 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7791 | -C "session hash for extended master secret"\ |
| 7792 | -S "session hash for extended master secret"\ |
| 7793 | -S "SSL - The handshake negotiation failed" \ |
| 7794 | -S "SSL - Unknown identity received" \ |
| 7795 | -S "SSL - Verification of the message MAC failed" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7798 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7799 | "$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" \ |
| 7800 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7801 | psk_identity=def psk=beef" \ |
| 7802 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7803 | -C "session hash for extended master secret"\ |
| 7804 | -S "session hash for extended master secret"\ |
| 7805 | -S "SSL - The handshake negotiation failed" \ |
| 7806 | -S "SSL - Unknown identity received" \ |
| 7807 | -S "SSL - Verification of the message MAC failed" |
| 7808 | |
| 7809 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7810 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7811 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7812 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7813 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7814 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7815 | 0 \ |
| 7816 | -c "session hash for extended master secret"\ |
| 7817 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7818 | -S "SSL - The handshake negotiation failed" \ |
| 7819 | -S "SSL - Unknown identity received" \ |
| 7820 | -S "SSL - Verification of the message MAC failed" |
| 7821 | |
| 7822 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7823 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7824 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7825 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7826 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7827 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7828 | 0 \ |
| 7829 | -c "session hash for extended master secret"\ |
| 7830 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7831 | -S "SSL - The handshake negotiation failed" \ |
| 7832 | -S "SSL - Unknown identity received" \ |
| 7833 | -S "SSL - Verification of the message MAC failed" |
| 7834 | |
| 7835 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7836 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7837 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 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" \ |
| 7838 | "$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] | 7839 | psk_identity=def psk=beef" \ |
| 7840 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7841 | -C "session hash for extended master secret"\ |
| 7842 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7843 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7844 | -S "SSL - Unknown identity received" \ |
| 7845 | -S "SSL - Verification of the message MAC failed" |
| 7846 | |
| 7847 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7848 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7849 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 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" \ |
| 7850 | "$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] | 7851 | psk_identity=def psk=beef" \ |
| 7852 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7853 | -C "session hash for extended master secret"\ |
| 7854 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7855 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7856 | -S "SSL - Unknown identity received" \ |
| 7857 | -S "SSL - Verification of the message MAC failed" |
| 7858 | |
| 7859 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7860 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7861 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7862 | "$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] | 7863 | psk_identity=def psk=beef" \ |
| 7864 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7865 | -C "session hash for extended master secret"\ |
| 7866 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7867 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7868 | -S "SSL - Unknown identity received" \ |
| 7869 | -S "SSL - Verification of the message MAC failed" |
| 7870 | |
| 7871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7872 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7873 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7874 | "$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] | 7875 | psk_identity=def psk=beef" \ |
| 7876 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7877 | -C "session hash for extended master secret"\ |
| 7878 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7879 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7880 | -S "SSL - Unknown identity received" \ |
| 7881 | -S "SSL - Verification of the message MAC failed" |
| 7882 | |
| 7883 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7884 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7885 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7886 | "$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] | 7887 | psk_identity=def psk=beef" \ |
| 7888 | 1 \ |
| 7889 | -s "SSL - Verification of the message MAC failed" |
| 7890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7891 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7892 | "$P_SRV" \ |
| 7893 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7894 | psk_identity=foo psk=abc123" \ |
| 7895 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7896 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7897 | -S "SSL - Unknown identity received" \ |
| 7898 | -S "SSL - Verification of the message MAC failed" |
| 7899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7900 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7901 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7902 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7903 | psk_identity=foo psk=abc123" \ |
| 7904 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7905 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7906 | -s "SSL - Unknown identity received" \ |
| 7907 | -S "SSL - Verification of the message MAC failed" |
| 7908 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7909 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7910 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7911 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7912 | psk_identity=abc psk=dead" \ |
| 7913 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7914 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7915 | -S "SSL - Unknown identity received" \ |
| 7916 | -S "SSL - Verification of the message MAC failed" |
| 7917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7918 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7919 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7920 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7921 | psk_identity=def psk=beef" \ |
| 7922 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7923 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7924 | -S "SSL - Unknown identity received" \ |
| 7925 | -S "SSL - Verification of the message MAC failed" |
| 7926 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7927 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7928 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7929 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7930 | psk_identity=ghi psk=beef" \ |
| 7931 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7932 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7933 | -s "SSL - Unknown identity received" \ |
| 7934 | -S "SSL - Verification of the message MAC failed" |
| 7935 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7936 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7937 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7938 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7939 | psk_identity=abc psk=beef" \ |
| 7940 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7941 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7942 | -S "SSL - Unknown identity received" \ |
| 7943 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7944 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7945 | # Tests for EC J-PAKE |
| 7946 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7947 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7949 | run_test "ECJPAKE: client not configured" \ |
| 7950 | "$P_SRV debug_level=3" \ |
| 7951 | "$P_CLI debug_level=3" \ |
| 7952 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7953 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7954 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7955 | -S "found ecjpake kkpp extension" \ |
| 7956 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7957 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7958 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7959 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7960 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7961 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7962 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7963 | run_test "ECJPAKE: server not configured" \ |
| 7964 | "$P_SRV debug_level=3" \ |
| 7965 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7966 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7967 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7968 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7969 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7970 | -s "found ecjpake kkpp extension" \ |
| 7971 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7972 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7973 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7974 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7975 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7976 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 7977 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 7978 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7979 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7980 | run_test "ECJPAKE: working, TLS" \ |
| 7981 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7982 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7983 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7984 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7985 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7986 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7987 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7988 | -s "found ecjpake kkpp extension" \ |
| 7989 | -S "skip ecjpake kkpp extension" \ |
| 7990 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7991 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7992 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7993 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7994 | -S "SSL - Verification of the message MAC failed" |
| 7995 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7996 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 7997 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 7998 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 7999 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8000 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8001 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8002 | 0 \ |
| 8003 | -c "add ciphersuite: c0ff" \ |
| 8004 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8005 | -c "using opaque password" \ |
| 8006 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8007 | -C "re-using cached ecjpake parameters" \ |
| 8008 | -s "found ecjpake kkpp extension" \ |
| 8009 | -S "skip ecjpake kkpp extension" \ |
| 8010 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8011 | -s "server hello, ecjpake kkpp extension" \ |
| 8012 | -c "found ecjpake_kkpp extension" \ |
| 8013 | -S "SSL - The handshake negotiation failed" \ |
| 8014 | -S "SSL - Verification of the message MAC failed" |
| 8015 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8016 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8017 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8018 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8019 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8020 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8021 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8022 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8023 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8024 | 0 \ |
| 8025 | -c "add ciphersuite: c0ff" \ |
| 8026 | -c "adding ecjpake_kkpp extension" \ |
| 8027 | -c "using opaque password" \ |
| 8028 | -S "using opaque password" \ |
| 8029 | -C "re-using cached ecjpake parameters" \ |
| 8030 | -s "found ecjpake kkpp extension" \ |
| 8031 | -S "skip ecjpake kkpp extension" \ |
| 8032 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8033 | -s "server hello, ecjpake kkpp extension" \ |
| 8034 | -c "found ecjpake_kkpp extension" \ |
| 8035 | -S "SSL - The handshake negotiation failed" \ |
| 8036 | -S "SSL - Verification of the message MAC failed" |
| 8037 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8038 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8039 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8040 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8041 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8042 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8043 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8044 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 8045 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8046 | 0 \ |
| 8047 | -c "add ciphersuite: c0ff" \ |
| 8048 | -c "adding ecjpake_kkpp extension" \ |
| 8049 | -C "using opaque password" \ |
| 8050 | -s "using opaque password" \ |
| 8051 | -C "re-using cached ecjpake parameters" \ |
| 8052 | -s "found ecjpake kkpp extension" \ |
| 8053 | -S "skip ecjpake kkpp extension" \ |
| 8054 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8055 | -s "server hello, ecjpake kkpp extension" \ |
| 8056 | -c "found ecjpake_kkpp extension" \ |
| 8057 | -S "SSL - The handshake negotiation failed" \ |
| 8058 | -S "SSL - Verification of the message MAC failed" |
| 8059 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8060 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8061 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8062 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8063 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8064 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8065 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8066 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8067 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8068 | -s "SSL - Verification of the message MAC failed" |
| 8069 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8070 | server_needs_more_time 1 |
| 8071 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8072 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8073 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 8074 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8075 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 8076 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8077 | 1 \ |
| 8078 | -c "using opaque password" \ |
| 8079 | -s "using opaque password" \ |
| 8080 | -C "re-using cached ecjpake parameters" \ |
| 8081 | -s "SSL - Verification of the message MAC failed" |
| 8082 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8083 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8084 | run_test "ECJPAKE: working, DTLS" \ |
| 8085 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8086 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8087 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8088 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8089 | -c "re-using cached ecjpake parameters" \ |
| 8090 | -S "SSL - Verification of the message MAC failed" |
| 8091 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8092 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8093 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8094 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8095 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8096 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8097 | 0 \ |
| 8098 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8099 | -S "SSL - Verification of the message MAC failed" |
| 8100 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8101 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8102 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8103 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8104 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8105 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8106 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8107 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8108 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8109 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8110 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8111 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8112 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8113 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8114 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8115 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8116 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8117 | 0 |
| 8118 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8119 | # Test for ClientHello without extensions |
| 8120 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8121 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8122 | run_test "ClientHello without extensions" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 8123 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8124 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8125 | 0 \ |
| 8126 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8127 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8128 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8129 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8130 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8131 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8132 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8133 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8134 | "$P_CLI request_size=100" \ |
| 8135 | 0 \ |
| 8136 | -s "Read from client: 100 bytes read$" |
| 8137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8139 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8140 | "$P_SRV buffer_size=100" \ |
| 8141 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8142 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8143 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8144 | |
| 8145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8146 | requires_max_content_len 200 |
| 8147 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8148 | "$P_SRV buffer_size=100" \ |
| 8149 | "$P_CLI request_size=200" \ |
| 8150 | 0 \ |
| 8151 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8152 | |
| 8153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8154 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8155 | "$P_SRV buffer_size=100" \ |
| 8156 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8157 | 0 \ |
| 8158 | -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] | 8159 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8160 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8161 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8162 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8163 | "$P_SRV force_version=tls12" \ |
| 8164 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8165 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8166 | 0 \ |
| 8167 | -s "Read from client: 1 bytes read" |
| 8168 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8169 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8170 | "$P_SRV force_version=tls12" \ |
| 8171 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8172 | 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] | 8173 | 0 \ |
| 8174 | -s "Read from client: 1 bytes read" |
| 8175 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8176 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8177 | "$P_SRV force_version=tls12" \ |
| 8178 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8179 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8180 | 0 \ |
| 8181 | -s "Read from client: 1 bytes read" |
| 8182 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8183 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8184 | "$P_SRV force_version=tls12" \ |
| 8185 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8186 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8187 | 0 \ |
| 8188 | -s "Read from client: 1 bytes read" |
| 8189 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8190 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8191 | "$P_SRV force_version=tls12" \ |
| 8192 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8193 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8194 | 0 \ |
| 8195 | -s "Read from client: 1 bytes read" |
| 8196 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8198 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8199 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8200 | "$P_CLI request_size=1 \ |
| 8201 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8202 | 0 \ |
| 8203 | -s "Read from client: 1 bytes read" |
| 8204 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8205 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8206 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8207 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8208 | "$P_CLI request_size=1 \ |
| 8209 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8210 | 0 \ |
| 8211 | -s "Read from client: 1 bytes read" |
| 8212 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8213 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8214 | |
| 8215 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8216 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8217 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8218 | "$P_CLI dtls=1 request_size=1 \ |
| 8219 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8220 | 0 \ |
| 8221 | -s "Read from client: 1 bytes read" |
| 8222 | |
| 8223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8224 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8225 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8226 | "$P_CLI dtls=1 request_size=1 \ |
| 8227 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8228 | 0 \ |
| 8229 | -s "Read from client: 1 bytes read" |
| 8230 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8231 | # Tests for small server packets |
| 8232 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8233 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8234 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8235 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8236 | 0 \ |
| 8237 | -c "Read from server: 1 bytes read" |
| 8238 | |
| 8239 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8240 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8241 | "$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] | 8242 | 0 \ |
| 8243 | -c "Read from server: 1 bytes read" |
| 8244 | |
| 8245 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8246 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8247 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8248 | 0 \ |
| 8249 | -c "Read from server: 1 bytes read" |
| 8250 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8251 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8252 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8253 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8254 | 0 \ |
| 8255 | -c "Read from server: 1 bytes read" |
| 8256 | |
| 8257 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8258 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8259 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8260 | 0 \ |
| 8261 | -c "Read from server: 1 bytes read" |
| 8262 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8263 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8264 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8265 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8266 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8267 | 0 \ |
| 8268 | -c "Read from server: 1 bytes read" |
| 8269 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8270 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8271 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8272 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8273 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8274 | 0 \ |
| 8275 | -c "Read from server: 1 bytes read" |
| 8276 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8277 | # Tests for small server packets in DTLS |
| 8278 | |
| 8279 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8280 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8281 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8282 | "$P_CLI dtls=1 \ |
| 8283 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8284 | 0 \ |
| 8285 | -c "Read from server: 1 bytes read" |
| 8286 | |
| 8287 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8288 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8289 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8290 | "$P_CLI dtls=1 \ |
| 8291 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8292 | 0 \ |
| 8293 | -c "Read from server: 1 bytes read" |
| 8294 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8295 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8296 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8297 | # How many fragments do we expect to write $1 bytes? |
| 8298 | fragments_for_write() { |
| 8299 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8300 | } |
| 8301 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8302 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8303 | "$P_SRV force_version=tls12" \ |
| 8304 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8305 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8306 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8307 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8308 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8309 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8310 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8311 | "$P_SRV force_version=tls12" \ |
| 8312 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8313 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8314 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8315 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8316 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8317 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8318 | "$P_SRV force_version=tls12" \ |
| 8319 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8320 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8321 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8322 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8323 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8324 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8325 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8326 | "$P_SRV force_version=tls12" \ |
| 8327 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8329 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8330 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8331 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8332 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8333 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8334 | "$P_SRV force_version=tls12" \ |
| 8335 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8336 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8337 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8338 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8339 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8340 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8341 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8342 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8343 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8344 | "$P_CLI request_size=16384 \ |
| 8345 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8346 | 0 \ |
| 8347 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8348 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8349 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8350 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8351 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8352 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8353 | "$P_CLI request_size=16384 \ |
| 8354 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8355 | 0 \ |
| 8356 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8357 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8358 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8359 | # 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] | 8360 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8361 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8362 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8363 | 0 \ |
| 8364 | -c "Read from server: 16384 bytes read" |
| 8365 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8366 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8367 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8368 | "$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] | 8369 | 0 \ |
| 8370 | -s "16384 bytes written in 1 fragments" \ |
| 8371 | -c "Read from server: 16384 bytes read" |
| 8372 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8373 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8374 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8375 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8376 | 0 \ |
| 8377 | -c "Read from server: 16384 bytes read" |
| 8378 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8379 | 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] | 8380 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8381 | "$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] | 8382 | 0 \ |
| 8383 | -s "16384 bytes written in 1 fragments" \ |
| 8384 | -c "Read from server: 16384 bytes read" |
| 8385 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8386 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8387 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8388 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8389 | 0 \ |
| 8390 | -c "Read from server: 16384 bytes read" |
| 8391 | |
| 8392 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8393 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8394 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8395 | 0 \ |
| 8396 | -c "Read from server: 16384 bytes read" |
| 8397 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8398 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8399 | run_test "Large server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8400 | "$P_SRV response_size=16384" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8401 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8402 | 0 \ |
| 8403 | -c "Read from server: 16384 bytes read" |
| 8404 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8405 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8406 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8407 | "$P_SRV response_size=16384" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8408 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8409 | 0 \ |
| 8410 | -c "Read from server: 16384 bytes read" |
| 8411 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8412 | # Tests for restartable ECC |
| 8413 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8414 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8415 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8416 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8417 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8418 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8419 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8420 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8421 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8422 | debug_level=1" \ |
| 8423 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8424 | -C "x509_verify_cert.*4b00" \ |
| 8425 | -C "mbedtls_pk_verify.*4b00" \ |
| 8426 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8427 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8428 | |
| 8429 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8430 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8431 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8432 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8433 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8434 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8435 | debug_level=1 ec_max_ops=0" \ |
| 8436 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8437 | -C "x509_verify_cert.*4b00" \ |
| 8438 | -C "mbedtls_pk_verify.*4b00" \ |
| 8439 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8440 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8441 | |
| 8442 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8443 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8444 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8445 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8446 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8447 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8448 | debug_level=1 ec_max_ops=65535" \ |
| 8449 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8450 | -C "x509_verify_cert.*4b00" \ |
| 8451 | -C "mbedtls_pk_verify.*4b00" \ |
| 8452 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8453 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8454 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8455 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8456 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8457 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8458 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8459 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8460 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8461 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8462 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8463 | debug_level=1 ec_max_ops=1000" \ |
| 8464 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8465 | -c "x509_verify_cert.*4b00" \ |
| 8466 | -c "mbedtls_pk_verify.*4b00" \ |
| 8467 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8468 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8469 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8470 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8471 | # everything except ECDH (where TLS calls PSA directly). |
| 8472 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8473 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8474 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8475 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
| 8476 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8477 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8478 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8479 | debug_level=1 ec_max_ops=1000" \ |
| 8480 | 0 \ |
| 8481 | -c "x509_verify_cert.*4b00" \ |
| 8482 | -c "mbedtls_pk_verify.*4b00" \ |
| 8483 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8484 | -c "mbedtls_pk_sign.*4b00" |
| 8485 | |
| 8486 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 8487 | # 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] | 8488 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8489 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8490 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8491 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8492 | crt_file=data_files/server5-badsign.crt \ |
| 8493 | key_file=data_files/server5.key" \ |
| 8494 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8495 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8496 | debug_level=1 ec_max_ops=1000" \ |
| 8497 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8498 | -c "x509_verify_cert.*4b00" \ |
| 8499 | -C "mbedtls_pk_verify.*4b00" \ |
| 8500 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8501 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8502 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8503 | -c "! mbedtls_ssl_handshake returned" \ |
| 8504 | -c "X509 - Certificate verification failed" |
| 8505 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8506 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8508 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8509 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8510 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8511 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8512 | crt_file=data_files/server5-badsign.crt \ |
| 8513 | key_file=data_files/server5.key" \ |
| 8514 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8515 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8516 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8517 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8518 | -c "x509_verify_cert.*4b00" \ |
| 8519 | -c "mbedtls_pk_verify.*4b00" \ |
| 8520 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8521 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8522 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8523 | -C "! mbedtls_ssl_handshake returned" \ |
| 8524 | -C "X509 - Certificate verification failed" |
| 8525 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8526 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8527 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8528 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8529 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8530 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8531 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ |
| 8532 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8533 | crt_file=data_files/server5-badsign.crt \ |
| 8534 | key_file=data_files/server5.key" \ |
| 8535 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8536 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8537 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8538 | 0 \ |
| 8539 | -c "x509_verify_cert.*4b00" \ |
| 8540 | -c "mbedtls_pk_verify.*4b00" \ |
| 8541 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8542 | -c "mbedtls_pk_sign.*4b00" \ |
| 8543 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8544 | -C "! mbedtls_ssl_handshake returned" \ |
| 8545 | -C "X509 - Certificate verification failed" |
| 8546 | |
| 8547 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8548 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8549 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8550 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8551 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8552 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8553 | crt_file=data_files/server5-badsign.crt \ |
| 8554 | key_file=data_files/server5.key" \ |
| 8555 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8556 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8557 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8558 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8559 | -C "x509_verify_cert.*4b00" \ |
| 8560 | -c "mbedtls_pk_verify.*4b00" \ |
| 8561 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8562 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8563 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8564 | -C "! mbedtls_ssl_handshake returned" \ |
| 8565 | -C "X509 - Certificate verification failed" |
| 8566 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8567 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8568 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8569 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8571 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8572 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
| 8573 | "$P_SRV curves=secp256r1 auth_mode=required \ |
| 8574 | crt_file=data_files/server5-badsign.crt \ |
| 8575 | key_file=data_files/server5.key" \ |
| 8576 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8577 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8578 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8579 | 0 \ |
| 8580 | -C "x509_verify_cert.*4b00" \ |
| 8581 | -c "mbedtls_pk_verify.*4b00" \ |
| 8582 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8583 | -c "mbedtls_pk_sign.*4b00" \ |
| 8584 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8585 | -C "! mbedtls_ssl_handshake returned" \ |
| 8586 | -C "X509 - Certificate verification failed" |
| 8587 | |
| 8588 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8589 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8590 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8591 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8592 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8593 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8594 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8595 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8596 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8597 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8598 | -c "x509_verify_cert.*4b00" \ |
| 8599 | -c "mbedtls_pk_verify.*4b00" \ |
| 8600 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8601 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8602 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8603 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8604 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8605 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8606 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8607 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8608 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
| 8609 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
| 8610 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8611 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8612 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8613 | 0 \ |
| 8614 | -c "x509_verify_cert.*4b00" \ |
| 8615 | -c "mbedtls_pk_verify.*4b00" \ |
| 8616 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8617 | -c "mbedtls_pk_sign.*4b00" |
| 8618 | |
| 8619 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8620 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8621 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8622 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8623 | run_test "EC restart: TLS, max_ops=1000 no client auth (no USE_PSA)" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8624 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8625 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8626 | debug_level=1 ec_max_ops=1000" \ |
| 8627 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8628 | -c "x509_verify_cert.*4b00" \ |
| 8629 | -c "mbedtls_pk_verify.*4b00" \ |
| 8630 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8631 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8632 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8633 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8634 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8635 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8636 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8637 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8638 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8639 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
| 8640 | "$P_SRV curves=secp256r1" \ |
| 8641 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8642 | debug_level=1 ec_max_ops=1000" \ |
| 8643 | 0 \ |
| 8644 | -c "x509_verify_cert.*4b00" \ |
| 8645 | -c "mbedtls_pk_verify.*4b00" \ |
| 8646 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8647 | -C "mbedtls_pk_sign.*4b00" |
| 8648 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8649 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 8650 | # restartable behaviour at all (not even client auth). |
| 8651 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 8652 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8653 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8654 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8655 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
| 8656 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
| 8657 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 8658 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8659 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8660 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8661 | -C "x509_verify_cert.*4b00" \ |
| 8662 | -C "mbedtls_pk_verify.*4b00" \ |
| 8663 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8664 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8665 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8666 | # Tests of asynchronous private key support in SSL |
| 8667 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8668 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8669 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8670 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8671 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8672 | "$P_CLI" \ |
| 8673 | 0 \ |
| 8674 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8675 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8676 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8678 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8679 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8680 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8681 | "$P_CLI" \ |
| 8682 | 0 \ |
| 8683 | -s "Async sign callback: using key slot " \ |
| 8684 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8685 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8686 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8687 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8688 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8689 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8690 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8691 | "$P_CLI" \ |
| 8692 | 0 \ |
| 8693 | -s "Async sign callback: using key slot " \ |
| 8694 | -U "Async sign callback: using key slot " \ |
| 8695 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8696 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8697 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8698 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8699 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8700 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8701 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8702 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8703 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8704 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8705 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8706 | "$P_CLI server_name=polarssl.example" \ |
| 8707 | 0 \ |
| 8708 | -s "Async sign callback: using key slot " \ |
| 8709 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8710 | -s "parse ServerName extension" \ |
| 8711 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8712 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8713 | |
| 8714 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8715 | run_test "SSL async private: decrypt, delay=0" \ |
| 8716 | "$P_SRV \ |
| 8717 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8718 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8719 | 0 \ |
| 8720 | -s "Async decrypt callback: using key slot " \ |
| 8721 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8722 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8723 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8724 | run_test "SSL async private: decrypt, delay=1" \ |
| 8725 | "$P_SRV \ |
| 8726 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8727 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8728 | 0 \ |
| 8729 | -s "Async decrypt callback: using key slot " \ |
| 8730 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8731 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8732 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8734 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8735 | "$P_SRV psk=abc123 \ |
| 8736 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8737 | "$P_CLI psk=abc123 \ |
| 8738 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8739 | 0 \ |
| 8740 | -s "Async decrypt callback: using key slot " \ |
| 8741 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8742 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8743 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8744 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8745 | "$P_SRV psk=abc123 \ |
| 8746 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8747 | "$P_CLI psk=abc123 \ |
| 8748 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8749 | 0 \ |
| 8750 | -s "Async decrypt callback: using key slot " \ |
| 8751 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8752 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8753 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8754 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8755 | run_test "SSL async private: sign callback not present" \ |
| 8756 | "$P_SRV \ |
| 8757 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8758 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8759 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8760 | 0 \ |
| 8761 | -S "Async sign callback" \ |
| 8762 | -s "! mbedtls_ssl_handshake returned" \ |
| 8763 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8764 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8765 | -s "Successful connection" |
| 8766 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8768 | run_test "SSL async private: decrypt callback not present" \ |
| 8769 | "$P_SRV debug_level=1 \ |
| 8770 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8771 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 8772 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8773 | 0 \ |
| 8774 | -S "Async decrypt callback" \ |
| 8775 | -s "! mbedtls_ssl_handshake returned" \ |
| 8776 | -s "got no RSA private key" \ |
| 8777 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8778 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8779 | |
| 8780 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8781 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8782 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8783 | "$P_SRV \ |
| 8784 | async_operations=s async_private_delay1=1 \ |
| 8785 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8786 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8787 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8788 | 0 \ |
| 8789 | -s "Async sign callback: using key slot 0," \ |
| 8790 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8791 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8792 | |
| 8793 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8794 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8795 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8796 | "$P_SRV \ |
| 8797 | async_operations=s async_private_delay2=1 \ |
| 8798 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8799 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8800 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8801 | 0 \ |
| 8802 | -s "Async sign callback: using key slot 0," \ |
| 8803 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8804 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8805 | |
| 8806 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8807 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8808 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8809 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8810 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8811 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8812 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8813 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8814 | 0 \ |
| 8815 | -s "Async sign callback: using key slot 1," \ |
| 8816 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8817 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8818 | |
| 8819 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8820 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8821 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8822 | "$P_SRV \ |
| 8823 | async_operations=s async_private_delay1=1 \ |
| 8824 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8825 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8826 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8827 | 0 \ |
| 8828 | -s "Async sign callback: no key matches this certificate." |
| 8829 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8831 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8832 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8833 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8834 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8835 | "$P_CLI" \ |
| 8836 | 1 \ |
| 8837 | -s "Async sign callback: injected error" \ |
| 8838 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8839 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8840 | -s "! mbedtls_ssl_handshake returned" |
| 8841 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8842 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8843 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8844 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8845 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8846 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8847 | "$P_CLI" \ |
| 8848 | 1 \ |
| 8849 | -s "Async sign callback: using key slot " \ |
| 8850 | -S "Async resume" \ |
| 8851 | -s "Async cancel" |
| 8852 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8853 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8854 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8855 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8856 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8857 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8858 | "$P_CLI" \ |
| 8859 | 1 \ |
| 8860 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8861 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8862 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8863 | -s "! mbedtls_ssl_handshake returned" |
| 8864 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8865 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8866 | run_test "SSL async private: decrypt, error in start" \ |
| 8867 | "$P_SRV \ |
| 8868 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8869 | async_private_error=1" \ |
| 8870 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8871 | 1 \ |
| 8872 | -s "Async decrypt callback: injected error" \ |
| 8873 | -S "Async resume" \ |
| 8874 | -S "Async cancel" \ |
| 8875 | -s "! mbedtls_ssl_handshake returned" |
| 8876 | |
| 8877 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8878 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8879 | "$P_SRV \ |
| 8880 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8881 | async_private_error=2" \ |
| 8882 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8883 | 1 \ |
| 8884 | -s "Async decrypt callback: using key slot " \ |
| 8885 | -S "Async resume" \ |
| 8886 | -s "Async cancel" |
| 8887 | |
| 8888 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8889 | run_test "SSL async private: decrypt, error in resume" \ |
| 8890 | "$P_SRV \ |
| 8891 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8892 | async_private_error=3" \ |
| 8893 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8894 | 1 \ |
| 8895 | -s "Async decrypt callback: using key slot " \ |
| 8896 | -s "Async resume callback: decrypt done but injected error" \ |
| 8897 | -S "Async cancel" \ |
| 8898 | -s "! mbedtls_ssl_handshake returned" |
| 8899 | |
| 8900 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8901 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8902 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8903 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8904 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8905 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8906 | 0 \ |
| 8907 | -s "Async cancel" \ |
| 8908 | -s "! mbedtls_ssl_handshake returned" \ |
| 8909 | -s "Async resume" \ |
| 8910 | -s "Successful connection" |
| 8911 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8912 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8913 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8914 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8915 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8916 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8917 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8918 | 0 \ |
| 8919 | -s "! mbedtls_ssl_handshake returned" \ |
| 8920 | -s "Async resume" \ |
| 8921 | -s "Successful connection" |
| 8922 | |
| 8923 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8925 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8926 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8927 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8929 | 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] | 8930 | "$P_SRV \ |
| 8931 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8932 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8933 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8934 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8935 | [ \$? -eq 1 ] && |
| 8936 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8937 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8938 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8939 | -S "Async resume" \ |
| 8940 | -s "Async cancel" \ |
| 8941 | -s "! mbedtls_ssl_handshake returned" \ |
| 8942 | -s "Async sign callback: no key matches this certificate." \ |
| 8943 | -s "Successful connection" |
| 8944 | |
| 8945 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8946 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8947 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8948 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8949 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8951 | 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] | 8952 | "$P_SRV \ |
| 8953 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8954 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8955 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8956 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8957 | [ \$? -eq 1 ] && |
| 8958 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8959 | 0 \ |
| 8960 | -s "Async resume" \ |
| 8961 | -s "! mbedtls_ssl_handshake returned" \ |
| 8962 | -s "Async sign callback: no key matches this certificate." \ |
| 8963 | -s "Successful connection" |
| 8964 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8965 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8966 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8967 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8968 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8969 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8970 | exchanges=2 renegotiation=1" \ |
| 8971 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8972 | 0 \ |
| 8973 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8974 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8975 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8976 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8977 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8978 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8979 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8980 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8981 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8982 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8983 | 0 \ |
| 8984 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8985 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8986 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8987 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8989 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8990 | "$P_SRV \ |
| 8991 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8992 | exchanges=2 renegotiation=1" \ |
| 8993 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8994 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8995 | 0 \ |
| 8996 | -s "Async decrypt callback: using key slot " \ |
| 8997 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8998 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8999 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9001 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9002 | "$P_SRV \ |
| 9003 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9004 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9005 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 9006 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9007 | 0 \ |
| 9008 | -s "Async decrypt callback: using key slot " \ |
| 9009 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9010 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9011 | # Tests for ECC extensions (rfc 4492) |
| 9012 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9013 | requires_config_enabled MBEDTLS_AES_C |
| 9014 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9015 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9016 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9017 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 9018 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9019 | "$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] | 9020 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9021 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9022 | -C "client hello, adding supported_point_formats extension" \ |
| 9023 | -S "found supported elliptic curves extension" \ |
| 9024 | -S "found supported point formats extension" |
| 9025 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9026 | requires_config_enabled MBEDTLS_AES_C |
| 9027 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9028 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9029 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9030 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9031 | "$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] | 9032 | "$P_CLI debug_level=3" \ |
| 9033 | 0 \ |
| 9034 | -C "found supported_point_formats extension" \ |
| 9035 | -S "server hello, supported_point_formats extension" |
| 9036 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9037 | requires_config_enabled MBEDTLS_AES_C |
| 9038 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9039 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9040 | run_test "Force an ECC ciphersuite in the client side" \ |
| 9041 | "$P_SRV debug_level=3" \ |
| 9042 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9043 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9044 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9045 | -c "client hello, adding supported_point_formats extension" \ |
| 9046 | -s "found supported elliptic curves extension" \ |
| 9047 | -s "found supported point formats extension" |
| 9048 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9049 | requires_config_enabled MBEDTLS_AES_C |
| 9050 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9051 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9052 | run_test "Force an ECC ciphersuite in the server side" \ |
| 9053 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9054 | "$P_CLI debug_level=3" \ |
| 9055 | 0 \ |
| 9056 | -c "found supported_point_formats extension" \ |
| 9057 | -s "server hello, supported_point_formats extension" |
| 9058 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9059 | # Tests for DTLS HelloVerifyRequest |
| 9060 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9062 | run_test "DTLS cookie: enabled" \ |
| 9063 | "$P_SRV dtls=1 debug_level=2" \ |
| 9064 | "$P_CLI dtls=1 debug_level=2" \ |
| 9065 | 0 \ |
| 9066 | -s "cookie verification failed" \ |
| 9067 | -s "cookie verification passed" \ |
| 9068 | -S "cookie verification skipped" \ |
| 9069 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9070 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9071 | -S "SSL - The requested feature is not available" |
| 9072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9074 | run_test "DTLS cookie: disabled" \ |
| 9075 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 9076 | "$P_CLI dtls=1 debug_level=2" \ |
| 9077 | 0 \ |
| 9078 | -S "cookie verification failed" \ |
| 9079 | -S "cookie verification passed" \ |
| 9080 | -s "cookie verification skipped" \ |
| 9081 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9082 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9083 | -S "SSL - The requested feature is not available" |
| 9084 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9086 | run_test "DTLS cookie: default (failing)" \ |
| 9087 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 9088 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 9089 | 1 \ |
| 9090 | -s "cookie verification failed" \ |
| 9091 | -S "cookie verification passed" \ |
| 9092 | -S "cookie verification skipped" \ |
| 9093 | -C "received hello verify request" \ |
| 9094 | -S "hello verification requested" \ |
| 9095 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9096 | |
| 9097 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9099 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9100 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9101 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9102 | 0 \ |
| 9103 | -s "cookie verification failed" \ |
| 9104 | -s "cookie verification passed" \ |
| 9105 | -S "cookie verification skipped" \ |
| 9106 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9107 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9108 | -S "SSL - The requested feature is not available" |
| 9109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9111 | run_test "DTLS cookie: enabled, nbio" \ |
| 9112 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9113 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9114 | 0 \ |
| 9115 | -s "cookie verification failed" \ |
| 9116 | -s "cookie verification passed" \ |
| 9117 | -S "cookie verification skipped" \ |
| 9118 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9119 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9120 | -S "SSL - The requested feature is not available" |
| 9121 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9122 | # Tests for client reconnecting from the same port with DTLS |
| 9123 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9124 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9126 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9127 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9128 | "$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] | 9129 | 0 \ |
| 9130 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9131 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9132 | -S "Client initiated reconnection from same port" |
| 9133 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9134 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9136 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9137 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9138 | "$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] | 9139 | 0 \ |
| 9140 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9141 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9142 | -s "Client initiated reconnection from same port" |
| 9143 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9144 | 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] | 9145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9146 | 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] | 9147 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9148 | "$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] | 9149 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9150 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9151 | -s "Client initiated reconnection from same port" |
| 9152 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9153 | 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] | 9154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9155 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9156 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9157 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9158 | 0 \ |
| 9159 | -S "The operation timed out" \ |
| 9160 | -s "Client initiated reconnection from same port" |
| 9161 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9163 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9164 | "$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] | 9165 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9166 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9167 | -s "The operation timed out" \ |
| 9168 | -S "Client initiated reconnection from same port" |
| 9169 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9171 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9172 | -p "$P_PXY inject_clihlo=1" \ |
| 9173 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9174 | "$P_CLI dtls=1 exchanges=2" \ |
| 9175 | 0 \ |
| 9176 | -s "possible client reconnect from the same port" \ |
| 9177 | -S "Client initiated reconnection from same port" |
| 9178 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9179 | # Tests for various cases of client authentication with DTLS |
| 9180 | # (focused on handshake flows and message parsing) |
| 9181 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9183 | run_test "DTLS client auth: required" \ |
| 9184 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9185 | "$P_CLI dtls=1" \ |
| 9186 | 0 \ |
| 9187 | -s "Verifying peer X.509 certificate... ok" |
| 9188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9190 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9191 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9192 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9193 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9194 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9195 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9196 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9197 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9198 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9199 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9200 | 0 \ |
| 9201 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9202 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9203 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9204 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9205 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9206 | "$P_CLI dtls=1 psk=abc124" \ |
| 9207 | 1 \ |
| 9208 | -s "SSL - Verification of the message MAC failed" \ |
| 9209 | -c "SSL - A fatal alert message was received from our peer" |
| 9210 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9211 | # Tests for receiving fragmented handshake messages with DTLS |
| 9212 | |
| 9213 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9215 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9216 | "$G_SRV -u --mtu 2048 -a" \ |
| 9217 | "$P_CLI dtls=1 debug_level=2" \ |
| 9218 | 0 \ |
| 9219 | -C "found fragmented DTLS handshake message" \ |
| 9220 | -C "error" |
| 9221 | |
| 9222 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9224 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9225 | "$G_SRV -u --mtu 512" \ |
| 9226 | "$P_CLI dtls=1 debug_level=2" \ |
| 9227 | 0 \ |
| 9228 | -c "found fragmented DTLS handshake message" \ |
| 9229 | -C "error" |
| 9230 | |
| 9231 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9233 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9234 | "$G_SRV -u --mtu 128" \ |
| 9235 | "$P_CLI dtls=1 debug_level=2" \ |
| 9236 | 0 \ |
| 9237 | -c "found fragmented DTLS handshake message" \ |
| 9238 | -C "error" |
| 9239 | |
| 9240 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9242 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9243 | "$G_SRV -u --mtu 128" \ |
| 9244 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9245 | 0 \ |
| 9246 | -c "found fragmented DTLS handshake message" \ |
| 9247 | -C "error" |
| 9248 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9249 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9252 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9253 | "$G_SRV -u --mtu 256" \ |
| 9254 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9255 | 0 \ |
| 9256 | -c "found fragmented DTLS handshake message" \ |
| 9257 | -c "client hello, adding renegotiation extension" \ |
| 9258 | -c "found renegotiation extension" \ |
| 9259 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9260 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9261 | -C "error" \ |
| 9262 | -s "Extra-header:" |
| 9263 | |
| 9264 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9265 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9267 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9268 | "$G_SRV -u --mtu 256" \ |
| 9269 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9270 | 0 \ |
| 9271 | -c "found fragmented DTLS handshake message" \ |
| 9272 | -c "client hello, adding renegotiation extension" \ |
| 9273 | -c "found renegotiation extension" \ |
| 9274 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9275 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9276 | -C "error" \ |
| 9277 | -s "Extra-header:" |
| 9278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9280 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9281 | "$O_SRV -dtls -mtu 2048" \ |
| 9282 | "$P_CLI dtls=1 debug_level=2" \ |
| 9283 | 0 \ |
| 9284 | -C "found fragmented DTLS handshake message" \ |
| 9285 | -C "error" |
| 9286 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9288 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 9289 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9290 | "$P_CLI dtls=1 debug_level=2" \ |
| 9291 | 0 \ |
| 9292 | -c "found fragmented DTLS handshake message" \ |
| 9293 | -C "error" |
| 9294 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9296 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9297 | "$O_SRV -dtls -mtu 256" \ |
| 9298 | "$P_CLI dtls=1 debug_level=2" \ |
| 9299 | 0 \ |
| 9300 | -c "found fragmented DTLS handshake message" \ |
| 9301 | -C "error" |
| 9302 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9304 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9305 | "$O_SRV -dtls -mtu 256" \ |
| 9306 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9307 | 0 \ |
| 9308 | -c "found fragmented DTLS handshake message" \ |
| 9309 | -C "error" |
| 9310 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9311 | # Tests for sending fragmented handshake messages with DTLS |
| 9312 | # |
| 9313 | # Use client auth when we need the client to send large messages, |
| 9314 | # and use large cert chains on both sides too (the long chains we have all use |
| 9315 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9316 | # Sizes reached (UDP payload): |
| 9317 | # - 2037B for server certificate |
| 9318 | # - 1542B for client certificate |
| 9319 | # - 1013B for newsessionticket |
| 9320 | # - all others below 512B |
| 9321 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9322 | |
| 9323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9324 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9325 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9326 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9328 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9329 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9330 | crt_file=data_files/server7_int-ca.crt \ |
| 9331 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9332 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9333 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9334 | "$P_CLI dtls=1 debug_level=2 \ |
| 9335 | crt_file=data_files/server8_int-ca2.crt \ |
| 9336 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9337 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9338 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9339 | 0 \ |
| 9340 | -S "found fragmented DTLS handshake message" \ |
| 9341 | -C "found fragmented DTLS handshake message" \ |
| 9342 | -C "error" |
| 9343 | |
| 9344 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9345 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9346 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9347 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9349 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9350 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9351 | crt_file=data_files/server7_int-ca.crt \ |
| 9352 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9353 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9354 | max_frag_len=1024" \ |
| 9355 | "$P_CLI dtls=1 debug_level=2 \ |
| 9356 | crt_file=data_files/server8_int-ca2.crt \ |
| 9357 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9358 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9359 | max_frag_len=2048" \ |
| 9360 | 0 \ |
| 9361 | -S "found fragmented DTLS handshake message" \ |
| 9362 | -c "found fragmented DTLS handshake message" \ |
| 9363 | -C "error" |
| 9364 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9365 | # With the MFL extension, the server has no way of forcing |
| 9366 | # the client to not exceed a certain MTU; hence, the following |
| 9367 | # test can't be replicated with an MTU proxy such as the one |
| 9368 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9369 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9370 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9371 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9372 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9374 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9376 | crt_file=data_files/server7_int-ca.crt \ |
| 9377 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9378 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9379 | max_frag_len=512" \ |
| 9380 | "$P_CLI dtls=1 debug_level=2 \ |
| 9381 | crt_file=data_files/server8_int-ca2.crt \ |
| 9382 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9383 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9384 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9385 | 0 \ |
| 9386 | -S "found fragmented DTLS handshake message" \ |
| 9387 | -c "found fragmented DTLS handshake message" \ |
| 9388 | -C "error" |
| 9389 | |
| 9390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9391 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9392 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9393 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9395 | 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] | 9396 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9397 | crt_file=data_files/server7_int-ca.crt \ |
| 9398 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9399 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9400 | max_frag_len=2048" \ |
| 9401 | "$P_CLI dtls=1 debug_level=2 \ |
| 9402 | crt_file=data_files/server8_int-ca2.crt \ |
| 9403 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9404 | hs_timeout=2500-60000 \ |
| 9405 | max_frag_len=1024" \ |
| 9406 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9407 | -S "found fragmented DTLS handshake message" \ |
| 9408 | -c "found fragmented DTLS handshake message" \ |
| 9409 | -C "error" |
| 9410 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9411 | # While not required by the standard defining the MFL extension |
| 9412 | # (according to which it only applies to records, not to datagrams), |
| 9413 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9414 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9415 | # to the peer. |
| 9416 | # The next test checks that no datagrams significantly larger than the |
| 9417 | # negotiated MFL are sent. |
| 9418 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9419 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9420 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9421 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9423 | 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] | 9424 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9425 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9426 | crt_file=data_files/server7_int-ca.crt \ |
| 9427 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9428 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9429 | max_frag_len=2048" \ |
| 9430 | "$P_CLI dtls=1 debug_level=2 \ |
| 9431 | crt_file=data_files/server8_int-ca2.crt \ |
| 9432 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9433 | hs_timeout=2500-60000 \ |
| 9434 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9435 | 0 \ |
| 9436 | -S "found fragmented DTLS handshake message" \ |
| 9437 | -c "found fragmented DTLS handshake message" \ |
| 9438 | -C "error" |
| 9439 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9440 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9441 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9442 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9443 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9445 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9446 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9447 | crt_file=data_files/server7_int-ca.crt \ |
| 9448 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9449 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9450 | max_frag_len=2048" \ |
| 9451 | "$P_CLI dtls=1 debug_level=2 \ |
| 9452 | crt_file=data_files/server8_int-ca2.crt \ |
| 9453 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9454 | hs_timeout=2500-60000 \ |
| 9455 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9456 | 0 \ |
| 9457 | -s "found fragmented DTLS handshake message" \ |
| 9458 | -c "found fragmented DTLS handshake message" \ |
| 9459 | -C "error" |
| 9460 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9461 | # While not required by the standard defining the MFL extension |
| 9462 | # (according to which it only applies to records, not to datagrams), |
| 9463 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9464 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9465 | # to the peer. |
| 9466 | # The next test checks that no datagrams significantly larger than the |
| 9467 | # negotiated MFL are sent. |
| 9468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9469 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9470 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9471 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9473 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9474 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9475 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9476 | crt_file=data_files/server7_int-ca.crt \ |
| 9477 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9478 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9479 | max_frag_len=2048" \ |
| 9480 | "$P_CLI dtls=1 debug_level=2 \ |
| 9481 | crt_file=data_files/server8_int-ca2.crt \ |
| 9482 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9483 | hs_timeout=2500-60000 \ |
| 9484 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9485 | 0 \ |
| 9486 | -s "found fragmented DTLS handshake message" \ |
| 9487 | -c "found fragmented DTLS handshake message" \ |
| 9488 | -C "error" |
| 9489 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9490 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9491 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9492 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9494 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9495 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9496 | crt_file=data_files/server7_int-ca.crt \ |
| 9497 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9498 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9499 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9500 | "$P_CLI dtls=1 debug_level=2 \ |
| 9501 | crt_file=data_files/server8_int-ca2.crt \ |
| 9502 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9503 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9504 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9505 | 0 \ |
| 9506 | -S "found fragmented DTLS handshake message" \ |
| 9507 | -C "found fragmented DTLS handshake message" \ |
| 9508 | -C "error" |
| 9509 | |
| 9510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9511 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9512 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9514 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9515 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9516 | crt_file=data_files/server7_int-ca.crt \ |
| 9517 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9518 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9519 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9520 | "$P_CLI dtls=1 debug_level=2 \ |
| 9521 | crt_file=data_files/server8_int-ca2.crt \ |
| 9522 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9523 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9524 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9525 | 0 \ |
| 9526 | -s "found fragmented DTLS handshake message" \ |
| 9527 | -C "found fragmented DTLS handshake message" \ |
| 9528 | -C "error" |
| 9529 | |
| 9530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9531 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9532 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9534 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9535 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9536 | crt_file=data_files/server7_int-ca.crt \ |
| 9537 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9538 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9539 | mtu=512" \ |
| 9540 | "$P_CLI dtls=1 debug_level=2 \ |
| 9541 | crt_file=data_files/server8_int-ca2.crt \ |
| 9542 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9543 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9544 | mtu=2048" \ |
| 9545 | 0 \ |
| 9546 | -S "found fragmented DTLS handshake message" \ |
| 9547 | -c "found fragmented DTLS handshake message" \ |
| 9548 | -C "error" |
| 9549 | |
| 9550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9551 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9552 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9554 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9555 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9556 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9557 | crt_file=data_files/server7_int-ca.crt \ |
| 9558 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9559 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9560 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9561 | "$P_CLI dtls=1 debug_level=2 \ |
| 9562 | crt_file=data_files/server8_int-ca2.crt \ |
| 9563 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9564 | hs_timeout=2500-60000 \ |
| 9565 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9566 | 0 \ |
| 9567 | -s "found fragmented DTLS handshake message" \ |
| 9568 | -c "found fragmented DTLS handshake message" \ |
| 9569 | -C "error" |
| 9570 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9571 | # 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] | 9572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9573 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9574 | requires_hash_alg SHA_256 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9575 | requires_config_enabled MBEDTLS_AES_C |
| 9576 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9577 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9578 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9579 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9580 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9581 | crt_file=data_files/server7_int-ca.crt \ |
| 9582 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9583 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9584 | mtu=512" \ |
| 9585 | "$P_CLI dtls=1 debug_level=2 \ |
| 9586 | crt_file=data_files/server8_int-ca2.crt \ |
| 9587 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9588 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9589 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9590 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9591 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9592 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9593 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9594 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9595 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9596 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9597 | # 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] | 9598 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9599 | # retransmissions, but in some cases (like both the server and client using |
| 9600 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9601 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9602 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9604 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9605 | requires_config_enabled MBEDTLS_AES_C |
| 9606 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9607 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9608 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9609 | -p "$P_PXY mtu=508" \ |
| 9610 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9611 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9612 | key_file=data_files/server7.key \ |
| 9613 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9614 | "$P_CLI dtls=1 debug_level=2 \ |
| 9615 | crt_file=data_files/server8_int-ca2.crt \ |
| 9616 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9617 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9618 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9619 | 0 \ |
| 9620 | -s "found fragmented DTLS handshake message" \ |
| 9621 | -c "found fragmented DTLS handshake message" \ |
| 9622 | -C "error" |
| 9623 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9624 | # 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] | 9625 | only_with_valgrind |
| 9626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9627 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9628 | requires_config_enabled MBEDTLS_AES_C |
| 9629 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9630 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9631 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9632 | -p "$P_PXY mtu=508" \ |
| 9633 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9634 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9635 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9636 | hs_timeout=250-10000" \ |
| 9637 | "$P_CLI dtls=1 debug_level=2 \ |
| 9638 | crt_file=data_files/server8_int-ca2.crt \ |
| 9639 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9640 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9641 | hs_timeout=250-10000" \ |
| 9642 | 0 \ |
| 9643 | -s "found fragmented DTLS handshake message" \ |
| 9644 | -c "found fragmented DTLS handshake message" \ |
| 9645 | -C "error" |
| 9646 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9647 | # 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] | 9648 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9649 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9650 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9651 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9652 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9653 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9655 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9656 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9657 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9658 | crt_file=data_files/server7_int-ca.crt \ |
| 9659 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9660 | hs_timeout=10000-60000 \ |
| 9661 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9662 | "$P_CLI dtls=1 debug_level=2 \ |
| 9663 | crt_file=data_files/server8_int-ca2.crt \ |
| 9664 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9665 | hs_timeout=10000-60000 \ |
| 9666 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9667 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9668 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9669 | -s "found fragmented DTLS handshake message" \ |
| 9670 | -c "found fragmented DTLS handshake message" \ |
| 9671 | -C "error" |
| 9672 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9673 | # 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] | 9674 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9675 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9676 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9677 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9679 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9680 | requires_config_enabled MBEDTLS_AES_C |
| 9681 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9682 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9683 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9684 | -p "$P_PXY mtu=512" \ |
| 9685 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9686 | crt_file=data_files/server7_int-ca.crt \ |
| 9687 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9688 | hs_timeout=10000-60000 \ |
| 9689 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9690 | "$P_CLI dtls=1 debug_level=2 \ |
| 9691 | crt_file=data_files/server8_int-ca2.crt \ |
| 9692 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9693 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9694 | hs_timeout=10000-60000 \ |
| 9695 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9696 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9697 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9698 | -s "found fragmented DTLS handshake message" \ |
| 9699 | -c "found fragmented DTLS handshake message" \ |
| 9700 | -C "error" |
| 9701 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9702 | not_with_valgrind # spurious autoreduction due to timeout |
| 9703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9704 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9705 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9707 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9708 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9709 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9710 | crt_file=data_files/server7_int-ca.crt \ |
| 9711 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9712 | hs_timeout=10000-60000 \ |
| 9713 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9714 | "$P_CLI dtls=1 debug_level=2 \ |
| 9715 | crt_file=data_files/server8_int-ca2.crt \ |
| 9716 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9717 | hs_timeout=10000-60000 \ |
| 9718 | mtu=1024 nbio=2" \ |
| 9719 | 0 \ |
| 9720 | -S "autoreduction" \ |
| 9721 | -s "found fragmented DTLS handshake message" \ |
| 9722 | -c "found fragmented DTLS handshake message" \ |
| 9723 | -C "error" |
| 9724 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9725 | # 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] | 9726 | not_with_valgrind # spurious autoreduction due to timeout |
| 9727 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9728 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9729 | requires_config_enabled MBEDTLS_AES_C |
| 9730 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9731 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9732 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9733 | -p "$P_PXY mtu=512" \ |
| 9734 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9735 | crt_file=data_files/server7_int-ca.crt \ |
| 9736 | key_file=data_files/server7.key \ |
| 9737 | hs_timeout=10000-60000 \ |
| 9738 | mtu=512 nbio=2" \ |
| 9739 | "$P_CLI dtls=1 debug_level=2 \ |
| 9740 | crt_file=data_files/server8_int-ca2.crt \ |
| 9741 | key_file=data_files/server8.key \ |
| 9742 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9743 | hs_timeout=10000-60000 \ |
| 9744 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9745 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9746 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9747 | -s "found fragmented DTLS handshake message" \ |
| 9748 | -c "found fragmented DTLS handshake message" \ |
| 9749 | -C "error" |
| 9750 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9751 | # 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] | 9752 | # This ensures things still work after session_reset(). |
| 9753 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9754 | # Since we don't support reading fragmented ClientHello yet, |
| 9755 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9756 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9757 | # An autoreduction on the client-side might happen if the server is |
| 9758 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9759 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9760 | # resumed listening, which would result in a spurious autoreduction. |
| 9761 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9762 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9763 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9764 | requires_config_enabled MBEDTLS_AES_C |
| 9765 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9766 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9767 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9768 | -p "$P_PXY mtu=1450" \ |
| 9769 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9770 | crt_file=data_files/server7_int-ca.crt \ |
| 9771 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9772 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9773 | mtu=1450" \ |
| 9774 | "$P_CLI dtls=1 debug_level=2 \ |
| 9775 | crt_file=data_files/server8_int-ca2.crt \ |
| 9776 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9777 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9778 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9779 | 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] | 9780 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9781 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9782 | -s "found fragmented DTLS handshake message" \ |
| 9783 | -c "found fragmented DTLS handshake message" \ |
| 9784 | -C "error" |
| 9785 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9786 | # An autoreduction on the client-side might happen if the server is |
| 9787 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9788 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9790 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9791 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9793 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9794 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9795 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9796 | -p "$P_PXY mtu=512" \ |
| 9797 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9798 | crt_file=data_files/server7_int-ca.crt \ |
| 9799 | key_file=data_files/server7.key \ |
| 9800 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9801 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9802 | mtu=512" \ |
| 9803 | "$P_CLI dtls=1 debug_level=2 \ |
| 9804 | crt_file=data_files/server8_int-ca2.crt \ |
| 9805 | key_file=data_files/server8.key \ |
| 9806 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9807 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9808 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9809 | mtu=512" \ |
| 9810 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9811 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9812 | -s "found fragmented DTLS handshake message" \ |
| 9813 | -c "found fragmented DTLS handshake message" \ |
| 9814 | -C "error" |
| 9815 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9816 | # An autoreduction on the client-side might happen if the server is |
| 9817 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9818 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9820 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9821 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9823 | requires_config_enabled MBEDTLS_AES_C |
| 9824 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9825 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9826 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9827 | -p "$P_PXY mtu=512" \ |
| 9828 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9829 | crt_file=data_files/server7_int-ca.crt \ |
| 9830 | key_file=data_files/server7.key \ |
| 9831 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9832 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9833 | mtu=512" \ |
| 9834 | "$P_CLI dtls=1 debug_level=2 \ |
| 9835 | crt_file=data_files/server8_int-ca2.crt \ |
| 9836 | key_file=data_files/server8.key \ |
| 9837 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9838 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9839 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9840 | mtu=512" \ |
| 9841 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9842 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9843 | -s "found fragmented DTLS handshake message" \ |
| 9844 | -c "found fragmented DTLS handshake message" \ |
| 9845 | -C "error" |
| 9846 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9847 | # An autoreduction on the client-side might happen if the server is |
| 9848 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9849 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9851 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9852 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9854 | requires_config_enabled MBEDTLS_AES_C |
| 9855 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9856 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9857 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9858 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9859 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9860 | crt_file=data_files/server7_int-ca.crt \ |
| 9861 | key_file=data_files/server7.key \ |
| 9862 | exchanges=2 renegotiation=1 \ |
| 9863 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9864 | hs_timeout=10000-60000 \ |
| 9865 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9866 | "$P_CLI dtls=1 debug_level=2 \ |
| 9867 | crt_file=data_files/server8_int-ca2.crt \ |
| 9868 | key_file=data_files/server8.key \ |
| 9869 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9870 | hs_timeout=10000-60000 \ |
| 9871 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9872 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9873 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9874 | -s "found fragmented DTLS handshake message" \ |
| 9875 | -c "found fragmented DTLS handshake message" \ |
| 9876 | -C "error" |
| 9877 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9878 | # An autoreduction on the client-side might happen if the server is |
| 9879 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9880 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9881 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9882 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9883 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9884 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9885 | requires_config_enabled MBEDTLS_AES_C |
| 9886 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9887 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9888 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9889 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9890 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9891 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9892 | crt_file=data_files/server7_int-ca.crt \ |
| 9893 | key_file=data_files/server7.key \ |
| 9894 | exchanges=2 renegotiation=1 \ |
| 9895 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9896 | hs_timeout=10000-60000 \ |
| 9897 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9898 | "$P_CLI dtls=1 debug_level=2 \ |
| 9899 | crt_file=data_files/server8_int-ca2.crt \ |
| 9900 | key_file=data_files/server8.key \ |
| 9901 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9902 | hs_timeout=10000-60000 \ |
| 9903 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9904 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9905 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9906 | -s "found fragmented DTLS handshake message" \ |
| 9907 | -c "found fragmented DTLS handshake message" \ |
| 9908 | -C "error" |
| 9909 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9910 | # An autoreduction on the client-side might happen if the server is |
| 9911 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9912 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9913 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9914 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9915 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9916 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9917 | requires_config_enabled MBEDTLS_AES_C |
| 9918 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9919 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9920 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9921 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9922 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9923 | crt_file=data_files/server7_int-ca.crt \ |
| 9924 | key_file=data_files/server7.key \ |
| 9925 | exchanges=2 renegotiation=1 \ |
| 9926 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9927 | hs_timeout=10000-60000 \ |
| 9928 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9929 | "$P_CLI dtls=1 debug_level=2 \ |
| 9930 | crt_file=data_files/server8_int-ca2.crt \ |
| 9931 | key_file=data_files/server8.key \ |
| 9932 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9933 | hs_timeout=10000-60000 \ |
| 9934 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9935 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9936 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9937 | -s "found fragmented DTLS handshake message" \ |
| 9938 | -c "found fragmented DTLS handshake message" \ |
| 9939 | -C "error" |
| 9940 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9941 | # 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] | 9942 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9943 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9944 | requires_config_enabled MBEDTLS_AES_C |
| 9945 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9946 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9947 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9948 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9949 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9950 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9951 | crt_file=data_files/server7_int-ca.crt \ |
| 9952 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9953 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9954 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9955 | crt_file=data_files/server8_int-ca2.crt \ |
| 9956 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9957 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9958 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9959 | 0 \ |
| 9960 | -s "found fragmented DTLS handshake message" \ |
| 9961 | -c "found fragmented DTLS handshake message" \ |
| 9962 | -C "error" |
| 9963 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9964 | # 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] | 9965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9966 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9967 | requires_config_enabled MBEDTLS_AES_C |
| 9968 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9969 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9970 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9971 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9972 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9973 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9974 | crt_file=data_files/server7_int-ca.crt \ |
| 9975 | key_file=data_files/server7.key \ |
| 9976 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9977 | "$P_CLI dtls=1 debug_level=2 \ |
| 9978 | crt_file=data_files/server8_int-ca2.crt \ |
| 9979 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9980 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9981 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9982 | 0 \ |
| 9983 | -s "found fragmented DTLS handshake message" \ |
| 9984 | -c "found fragmented DTLS handshake message" \ |
| 9985 | -C "error" |
| 9986 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9987 | # interop tests for DTLS fragmentating with reliable connection |
| 9988 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9989 | # here and below we just want to test that the we fragment in a way that |
| 9990 | # pleases other implementations, so we don't need the peer to fragment |
| 9991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9992 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9993 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9994 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9995 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9996 | "$G_SRV -u" \ |
| 9997 | "$P_CLI dtls=1 debug_level=2 \ |
| 9998 | crt_file=data_files/server8_int-ca2.crt \ |
| 9999 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10000 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10001 | 0 \ |
| 10002 | -c "fragmenting handshake message" \ |
| 10003 | -C "error" |
| 10004 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10005 | # We use --insecure for the GnuTLS client because it expects |
| 10006 | # the hostname / IP it connects to to be the name used in the |
| 10007 | # certificate obtained from the server. Here, however, it |
| 10008 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10009 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10010 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10011 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10012 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10013 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10014 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10015 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10016 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10017 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 10018 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10019 | crt_file=data_files/server7_int-ca.crt \ |
| 10020 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10021 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10022 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10023 | 0 \ |
| 10024 | -s "fragmenting handshake message" |
| 10025 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10026 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10027 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10028 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10029 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10030 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10031 | "$P_CLI dtls=1 debug_level=2 \ |
| 10032 | crt_file=data_files/server8_int-ca2.crt \ |
| 10033 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10034 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10035 | 0 \ |
| 10036 | -c "fragmenting handshake message" \ |
| 10037 | -C "error" |
| 10038 | |
| 10039 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10040 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10041 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10042 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10043 | "$P_SRV dtls=1 debug_level=2 \ |
| 10044 | crt_file=data_files/server7_int-ca.crt \ |
| 10045 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10046 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10047 | "$O_CLI -dtls1_2" \ |
| 10048 | 0 \ |
| 10049 | -s "fragmenting handshake message" |
| 10050 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10051 | # interop tests for DTLS fragmentating with unreliable connection |
| 10052 | # |
| 10053 | # again we just want to test that the we fragment in a way that |
| 10054 | # pleases other implementations, so we don't need the peer to fragment |
| 10055 | requires_gnutls_next |
| 10056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10057 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10058 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10059 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10060 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10061 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10062 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10063 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10064 | crt_file=data_files/server8_int-ca2.crt \ |
| 10065 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10066 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10067 | 0 \ |
| 10068 | -c "fragmenting handshake message" \ |
| 10069 | -C "error" |
| 10070 | |
| 10071 | requires_gnutls_next |
| 10072 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10073 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10074 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10075 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10076 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10077 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10078 | "$P_SRV dtls=1 debug_level=2 \ |
| 10079 | crt_file=data_files/server7_int-ca.crt \ |
| 10080 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10081 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10082 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10083 | 0 \ |
| 10084 | -s "fragmenting handshake message" |
| 10085 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10086 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10087 | ## 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] | 10088 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10089 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10090 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10091 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10092 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10093 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10094 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10095 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10096 | "$P_CLI dtls=1 debug_level=2 \ |
| 10097 | crt_file=data_files/server8_int-ca2.crt \ |
| 10098 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10099 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10100 | 0 \ |
| 10101 | -c "fragmenting handshake message" \ |
| 10102 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10103 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10104 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10105 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10106 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10107 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10108 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10109 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10110 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10111 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10112 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10113 | "$P_SRV dtls=1 debug_level=2 \ |
| 10114 | crt_file=data_files/server7_int-ca.crt \ |
| 10115 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10116 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10117 | "$O_CLI -dtls1_2" \ |
| 10118 | 0 \ |
| 10119 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10120 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10121 | # Tests for DTLS-SRTP (RFC 5764) |
| 10122 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10124 | run_test "DTLS-SRTP all profiles supported" \ |
| 10125 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10126 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10127 | 0 \ |
| 10128 | -s "found use_srtp extension" \ |
| 10129 | -s "found srtp profile" \ |
| 10130 | -s "selected srtp profile" \ |
| 10131 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10132 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10133 | -c "client hello, adding use_srtp extension" \ |
| 10134 | -c "found use_srtp extension" \ |
| 10135 | -c "found srtp profile" \ |
| 10136 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10137 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10138 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10139 | -C "error" |
| 10140 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10141 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10142 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10144 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10145 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10146 | "$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] | 10147 | 0 \ |
| 10148 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10149 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10150 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10151 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10152 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10153 | -c "client hello, adding use_srtp extension" \ |
| 10154 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10155 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10156 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10157 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10158 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10159 | -C "error" |
| 10160 | |
| 10161 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10163 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10164 | "$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] | 10165 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10166 | 0 \ |
| 10167 | -s "found use_srtp extension" \ |
| 10168 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10169 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10170 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10171 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10172 | -c "client hello, adding use_srtp extension" \ |
| 10173 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10174 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10175 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10176 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10177 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10178 | -C "error" |
| 10179 | |
| 10180 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10182 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10183 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10184 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10185 | 0 \ |
| 10186 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10187 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10188 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10189 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10190 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10191 | -c "client hello, adding use_srtp extension" \ |
| 10192 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10193 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10194 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10195 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10196 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10197 | -C "error" |
| 10198 | |
| 10199 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10201 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10202 | "$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] | 10203 | "$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] | 10204 | 0 \ |
| 10205 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10206 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10207 | -S "selected srtp profile" \ |
| 10208 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10209 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10210 | -c "client hello, adding use_srtp extension" \ |
| 10211 | -C "found use_srtp extension" \ |
| 10212 | -C "found srtp profile" \ |
| 10213 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10214 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10215 | -C "error" |
| 10216 | |
| 10217 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10219 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10220 | "$P_SRV dtls=1 debug_level=3" \ |
| 10221 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10222 | 0 \ |
| 10223 | -s "found use_srtp extension" \ |
| 10224 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10225 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10226 | -c "client hello, adding use_srtp extension" \ |
| 10227 | -C "found use_srtp extension" \ |
| 10228 | -C "found srtp profile" \ |
| 10229 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10230 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10231 | -C "error" |
| 10232 | |
| 10233 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10235 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10236 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10237 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10238 | 0 \ |
| 10239 | -s "found use_srtp extension" \ |
| 10240 | -s "found srtp profile" \ |
| 10241 | -s "selected srtp profile" \ |
| 10242 | -s "server hello, adding use_srtp extension" \ |
| 10243 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10244 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10245 | -c "client hello, adding use_srtp extension" \ |
| 10246 | -c "found use_srtp extension" \ |
| 10247 | -c "found srtp profile" \ |
| 10248 | -c "selected srtp profile" \ |
| 10249 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10250 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10251 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10252 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10253 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10254 | -C "error" |
| 10255 | |
| 10256 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10258 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10259 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10260 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10261 | 0 \ |
| 10262 | -s "found use_srtp extension" \ |
| 10263 | -s "found srtp profile" \ |
| 10264 | -s "selected srtp profile" \ |
| 10265 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10266 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10267 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10268 | -S "dumping 'using mki' (8 bytes)" \ |
| 10269 | -c "client hello, adding use_srtp extension" \ |
| 10270 | -c "found use_srtp extension" \ |
| 10271 | -c "found srtp profile" \ |
| 10272 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10273 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10274 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10275 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10276 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10277 | -C "dumping 'received mki' (8 bytes)" \ |
| 10278 | -C "error" |
| 10279 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10280 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10282 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10283 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10284 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10285 | 0 \ |
| 10286 | -s "found use_srtp extension" \ |
| 10287 | -s "found srtp profile" \ |
| 10288 | -s "selected srtp profile" \ |
| 10289 | -s "server hello, adding use_srtp extension" \ |
| 10290 | -s "DTLS-SRTP key material is"\ |
| 10291 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10292 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10293 | |
| 10294 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10296 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10297 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10298 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10299 | 0 \ |
| 10300 | -s "found use_srtp extension" \ |
| 10301 | -s "found srtp profile" \ |
| 10302 | -s "selected srtp profile" \ |
| 10303 | -s "server hello, adding use_srtp extension" \ |
| 10304 | -s "DTLS-SRTP key material is"\ |
| 10305 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10306 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10307 | |
| 10308 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10310 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10311 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10312 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10313 | 0 \ |
| 10314 | -s "found use_srtp extension" \ |
| 10315 | -s "found srtp profile" \ |
| 10316 | -s "selected srtp profile" \ |
| 10317 | -s "server hello, adding use_srtp extension" \ |
| 10318 | -s "DTLS-SRTP key material is"\ |
| 10319 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10320 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10321 | |
| 10322 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10324 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10325 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10326 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10327 | 0 \ |
| 10328 | -s "found use_srtp extension" \ |
| 10329 | -s "found srtp profile" \ |
| 10330 | -s "selected srtp profile" \ |
| 10331 | -s "server hello, adding use_srtp extension" \ |
| 10332 | -s "DTLS-SRTP key material is"\ |
| 10333 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10334 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10335 | |
| 10336 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10338 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10339 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10340 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10341 | 0 \ |
| 10342 | -s "found use_srtp extension" \ |
| 10343 | -s "found srtp profile" \ |
| 10344 | -s "selected srtp profile" \ |
| 10345 | -s "server hello, adding use_srtp extension" \ |
| 10346 | -s "DTLS-SRTP key material is"\ |
| 10347 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10348 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10349 | |
| 10350 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10352 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10353 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10354 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10355 | 0 \ |
| 10356 | -s "found use_srtp extension" \ |
| 10357 | -s "found srtp profile" \ |
| 10358 | -S "selected srtp profile" \ |
| 10359 | -S "server hello, adding use_srtp extension" \ |
| 10360 | -S "DTLS-SRTP key material is"\ |
| 10361 | -C "SRTP Extension negotiated, profile" |
| 10362 | |
| 10363 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10365 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10366 | "$P_SRV dtls=1 debug_level=3" \ |
| 10367 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10368 | 0 \ |
| 10369 | -s "found use_srtp extension" \ |
| 10370 | -S "server hello, adding use_srtp extension" \ |
| 10371 | -S "DTLS-SRTP key material is"\ |
| 10372 | -C "SRTP Extension negotiated, profile" |
| 10373 | |
| 10374 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10376 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10377 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10378 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10379 | 0 \ |
| 10380 | -c "client hello, adding use_srtp extension" \ |
| 10381 | -c "found use_srtp extension" \ |
| 10382 | -c "found srtp profile" \ |
| 10383 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10384 | -c "DTLS-SRTP key material is"\ |
| 10385 | -C "error" |
| 10386 | |
| 10387 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10389 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10390 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10391 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10392 | 0 \ |
| 10393 | -c "client hello, adding use_srtp extension" \ |
| 10394 | -c "found use_srtp extension" \ |
| 10395 | -c "found srtp profile" \ |
| 10396 | -c "selected srtp profile" \ |
| 10397 | -c "DTLS-SRTP key material is"\ |
| 10398 | -C "error" |
| 10399 | |
| 10400 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10402 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10403 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10404 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10405 | 0 \ |
| 10406 | -c "client hello, adding use_srtp extension" \ |
| 10407 | -c "found use_srtp extension" \ |
| 10408 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10409 | -c "selected srtp profile" \ |
| 10410 | -c "DTLS-SRTP key material is"\ |
| 10411 | -C "error" |
| 10412 | |
| 10413 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10415 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10416 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10417 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10418 | 0 \ |
| 10419 | -c "client hello, adding use_srtp extension" \ |
| 10420 | -c "found use_srtp extension" \ |
| 10421 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10422 | -c "selected srtp profile" \ |
| 10423 | -c "DTLS-SRTP key material is"\ |
| 10424 | -C "error" |
| 10425 | |
| 10426 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10428 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10429 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10430 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10431 | 0 \ |
| 10432 | -c "client hello, adding use_srtp extension" \ |
| 10433 | -c "found use_srtp extension" \ |
| 10434 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10435 | -c "selected srtp profile" \ |
| 10436 | -c "DTLS-SRTP key material is"\ |
| 10437 | -C "error" |
| 10438 | |
| 10439 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10441 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10442 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10443 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10444 | 0 \ |
| 10445 | -c "client hello, adding use_srtp extension" \ |
| 10446 | -C "found use_srtp extension" \ |
| 10447 | -C "found srtp profile" \ |
| 10448 | -C "selected srtp profile" \ |
| 10449 | -C "DTLS-SRTP key material is"\ |
| 10450 | -C "error" |
| 10451 | |
| 10452 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10454 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10455 | "$O_SRV -dtls" \ |
| 10456 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10457 | 0 \ |
| 10458 | -c "client hello, adding use_srtp extension" \ |
| 10459 | -C "found use_srtp extension" \ |
| 10460 | -C "found srtp profile" \ |
| 10461 | -C "selected srtp profile" \ |
| 10462 | -C "DTLS-SRTP key material is"\ |
| 10463 | -C "error" |
| 10464 | |
| 10465 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10467 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10468 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10469 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10470 | 0 \ |
| 10471 | -c "client hello, adding use_srtp extension" \ |
| 10472 | -c "found use_srtp extension" \ |
| 10473 | -c "found srtp profile" \ |
| 10474 | -c "selected srtp profile" \ |
| 10475 | -c "DTLS-SRTP key material is"\ |
| 10476 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10477 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10478 | -C "dumping 'received mki' (8 bytes)" \ |
| 10479 | -C "error" |
| 10480 | |
| 10481 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10482 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10484 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10485 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10486 | "$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] | 10487 | 0 \ |
| 10488 | -s "found use_srtp extension" \ |
| 10489 | -s "found srtp profile" \ |
| 10490 | -s "selected srtp profile" \ |
| 10491 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10492 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10493 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10494 | |
| 10495 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10496 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10498 | 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] | 10499 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10500 | "$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] | 10501 | 0 \ |
| 10502 | -s "found use_srtp extension" \ |
| 10503 | -s "found srtp profile" \ |
| 10504 | -s "selected srtp profile" \ |
| 10505 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10506 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10507 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10508 | |
| 10509 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10510 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10512 | 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] | 10513 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10514 | "$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] | 10515 | 0 \ |
| 10516 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10517 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10518 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10519 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10520 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10521 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10522 | |
| 10523 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10524 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10526 | 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] | 10527 | "$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] | 10528 | "$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] | 10529 | 0 \ |
| 10530 | -s "found use_srtp extension" \ |
| 10531 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10532 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10533 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10534 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10535 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10536 | |
| 10537 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10538 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10540 | 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] | 10541 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10542 | "$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] | 10543 | 0 \ |
| 10544 | -s "found use_srtp extension" \ |
| 10545 | -s "found srtp profile" \ |
| 10546 | -s "selected srtp profile" \ |
| 10547 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10548 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10549 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10550 | |
| 10551 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10552 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10554 | 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] | 10555 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10556 | "$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] | 10557 | 0 \ |
| 10558 | -s "found use_srtp extension" \ |
| 10559 | -s "found srtp profile" \ |
| 10560 | -S "selected srtp profile" \ |
| 10561 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10562 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10563 | -C "SRTP profile:" |
| 10564 | |
| 10565 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10566 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10568 | 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] | 10569 | "$P_SRV dtls=1 debug_level=3" \ |
| 10570 | "$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] | 10571 | 0 \ |
| 10572 | -s "found use_srtp extension" \ |
| 10573 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10574 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10575 | -C "SRTP profile:" |
| 10576 | |
| 10577 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10578 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10579 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10580 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10581 | "$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" \ |
| 10582 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10583 | 0 \ |
| 10584 | -c "client hello, adding use_srtp extension" \ |
| 10585 | -c "found use_srtp extension" \ |
| 10586 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10587 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10588 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10589 | -C "error" |
| 10590 | |
| 10591 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10592 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10594 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10595 | "$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" \ |
| 10596 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10597 | 0 \ |
| 10598 | -c "client hello, adding use_srtp extension" \ |
| 10599 | -c "found use_srtp extension" \ |
| 10600 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10601 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10602 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10603 | -C "error" |
| 10604 | |
| 10605 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10606 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10608 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10609 | "$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" \ |
| 10610 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10611 | 0 \ |
| 10612 | -c "client hello, adding use_srtp extension" \ |
| 10613 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10614 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10615 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10616 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10617 | -C "error" |
| 10618 | |
| 10619 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10620 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10622 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10623 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10624 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10625 | 0 \ |
| 10626 | -c "client hello, adding use_srtp extension" \ |
| 10627 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10628 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10629 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10630 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10631 | -C "error" |
| 10632 | |
| 10633 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10634 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10636 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10637 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10638 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10639 | 0 \ |
| 10640 | -c "client hello, adding use_srtp extension" \ |
| 10641 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10642 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10643 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10644 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10645 | -C "error" |
| 10646 | |
| 10647 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10648 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10650 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10651 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10652 | "$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] | 10653 | 0 \ |
| 10654 | -c "client hello, adding use_srtp extension" \ |
| 10655 | -C "found use_srtp extension" \ |
| 10656 | -C "found srtp profile" \ |
| 10657 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10658 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10659 | -C "error" |
| 10660 | |
| 10661 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10662 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10664 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10665 | "$G_SRV -u" \ |
| 10666 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10667 | 0 \ |
| 10668 | -c "client hello, adding use_srtp extension" \ |
| 10669 | -C "found use_srtp extension" \ |
| 10670 | -C "found srtp profile" \ |
| 10671 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10672 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10673 | -C "error" |
| 10674 | |
| 10675 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10676 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10678 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10679 | "$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" \ |
| 10680 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10681 | 0 \ |
| 10682 | -c "client hello, adding use_srtp extension" \ |
| 10683 | -c "found use_srtp extension" \ |
| 10684 | -c "found srtp profile" \ |
| 10685 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10686 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10687 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10688 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10689 | -c "dumping 'received mki' (8 bytes)" \ |
| 10690 | -C "error" |
| 10691 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10692 | # Tests for specific things with "unreliable" UDP connection |
| 10693 | |
| 10694 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10696 | run_test "DTLS proxy: reference" \ |
| 10697 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10698 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10699 | "$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] | 10700 | 0 \ |
| 10701 | -C "replayed record" \ |
| 10702 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10703 | -C "Buffer record from epoch" \ |
| 10704 | -S "Buffer record from epoch" \ |
| 10705 | -C "ssl_buffer_message" \ |
| 10706 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10707 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10708 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10709 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10710 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10711 | -c "HTTP/1.0 200 OK" |
| 10712 | |
| 10713 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10715 | run_test "DTLS proxy: duplicate every packet" \ |
| 10716 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10717 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10718 | "$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] | 10719 | 0 \ |
| 10720 | -c "replayed record" \ |
| 10721 | -s "replayed record" \ |
| 10722 | -c "record from another epoch" \ |
| 10723 | -s "record from another epoch" \ |
| 10724 | -S "resend" \ |
| 10725 | -s "Extra-header:" \ |
| 10726 | -c "HTTP/1.0 200 OK" |
| 10727 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10729 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10730 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10731 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10732 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10733 | 0 \ |
| 10734 | -c "replayed record" \ |
| 10735 | -S "replayed record" \ |
| 10736 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10737 | -s "record from another epoch" \ |
| 10738 | -c "resend" \ |
| 10739 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10740 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10741 | -c "HTTP/1.0 200 OK" |
| 10742 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10744 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10745 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10746 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10747 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10748 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10749 | -c "next record in same datagram" \ |
| 10750 | -s "next record in same datagram" |
| 10751 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10753 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10754 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10755 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10756 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10757 | 0 \ |
| 10758 | -c "next record in same datagram" \ |
| 10759 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10760 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10762 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10763 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10764 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10765 | "$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] | 10766 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10767 | -c "discarding invalid record (mac)" \ |
| 10768 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10769 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10770 | -c "HTTP/1.0 200 OK" \ |
| 10771 | -S "too many records with bad MAC" \ |
| 10772 | -S "Verification of the message MAC failed" |
| 10773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10775 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10776 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10777 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10778 | "$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] | 10779 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10780 | -C "discarding invalid record (mac)" \ |
| 10781 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10782 | -S "Extra-header:" \ |
| 10783 | -C "HTTP/1.0 200 OK" \ |
| 10784 | -s "too many records with bad MAC" \ |
| 10785 | -s "Verification of the message MAC failed" |
| 10786 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10788 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10789 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10790 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10791 | "$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] | 10792 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10793 | -c "discarding invalid record (mac)" \ |
| 10794 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10795 | -s "Extra-header:" \ |
| 10796 | -c "HTTP/1.0 200 OK" \ |
| 10797 | -S "too many records with bad MAC" \ |
| 10798 | -S "Verification of the message MAC failed" |
| 10799 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10801 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10802 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10803 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10804 | "$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] | 10805 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10806 | -c "discarding invalid record (mac)" \ |
| 10807 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10808 | -s "Extra-header:" \ |
| 10809 | -c "HTTP/1.0 200 OK" \ |
| 10810 | -s "too many records with bad MAC" \ |
| 10811 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10812 | |
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 | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10814 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10815 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10816 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10817 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10818 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10819 | -c "record from another epoch" \ |
| 10820 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10821 | -s "Extra-header:" \ |
| 10822 | -c "HTTP/1.0 200 OK" |
| 10823 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10824 | # Tests for reordering support with DTLS |
| 10825 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10826 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10828 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10829 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10830 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10831 | hs_timeout=2500-60000" \ |
| 10832 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10833 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10834 | 0 \ |
| 10835 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10836 | -c "Next handshake message has been buffered - load"\ |
| 10837 | -S "Buffering HS message" \ |
| 10838 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10839 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10840 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10841 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10842 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10843 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10844 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10846 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10847 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10848 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10849 | hs_timeout=2500-60000" \ |
| 10850 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10851 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10852 | 0 \ |
| 10853 | -c "Buffering HS message" \ |
| 10854 | -c "found fragmented DTLS handshake message"\ |
| 10855 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10856 | -c "Next handshake message has been buffered - load"\ |
| 10857 | -S "Buffering HS message" \ |
| 10858 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10859 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10860 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10861 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10862 | -S "Remember CCS message" |
| 10863 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10864 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10865 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10866 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10867 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10868 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10869 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10871 | 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] | 10872 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10873 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10874 | hs_timeout=2500-60000" \ |
| 10875 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10876 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10877 | 0 \ |
| 10878 | -c "Buffering HS message" \ |
| 10879 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10880 | -C "attempt to make space by freeing buffered messages" \ |
| 10881 | -S "Buffering HS message" \ |
| 10882 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10883 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10884 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10885 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10886 | -S "Remember CCS message" |
| 10887 | |
| 10888 | # The size constraints ensure that the delayed certificate message can't |
| 10889 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10890 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10891 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10892 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10893 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10895 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10896 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10897 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10898 | hs_timeout=2500-60000" \ |
| 10899 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10900 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10901 | 0 \ |
| 10902 | -c "Buffering HS message" \ |
| 10903 | -c "attempt to make space by freeing buffered future messages" \ |
| 10904 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10905 | -S "Buffering HS message" \ |
| 10906 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10907 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10908 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10909 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10910 | -S "Remember CCS message" |
| 10911 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10912 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10914 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10915 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10916 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10917 | hs_timeout=2500-60000" \ |
| 10918 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10919 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10920 | 0 \ |
| 10921 | -C "Buffering HS message" \ |
| 10922 | -C "Next handshake message has been buffered - load"\ |
| 10923 | -s "Buffering HS message" \ |
| 10924 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10925 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10926 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10927 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10928 | -S "Remember CCS message" |
| 10929 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10930 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10932 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10933 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10934 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10935 | hs_timeout=2500-60000" \ |
| 10936 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10937 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10938 | 0 \ |
| 10939 | -C "Buffering HS message" \ |
| 10940 | -C "Next handshake message has been buffered - load"\ |
| 10941 | -S "Buffering HS message" \ |
| 10942 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10943 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10944 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10945 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10946 | -S "Remember CCS message" |
| 10947 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10948 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10950 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10951 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10952 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10953 | hs_timeout=2500-60000" \ |
| 10954 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10955 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10956 | 0 \ |
| 10957 | -C "Buffering HS message" \ |
| 10958 | -C "Next handshake message has been buffered - load"\ |
| 10959 | -S "Buffering HS message" \ |
| 10960 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10961 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10962 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10963 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10964 | -s "Remember CCS message" |
| 10965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10967 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10968 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10969 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10970 | hs_timeout=2500-60000" \ |
| 10971 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10972 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10973 | 0 \ |
| 10974 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10975 | -s "Found buffered record from current epoch - load" \ |
| 10976 | -c "Buffer record from epoch 1" \ |
| 10977 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10978 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10979 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10980 | # from the server are delayed, so that the encrypted Finished message |
| 10981 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10982 | # in afterwards, the encrypted Finished message must be freed in order |
| 10983 | # to make space for the NewSessionTicket to be reassembled. |
| 10984 | # This works only in very particular circumstances: |
| 10985 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10986 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10987 | # the encrypted Finished message. |
| 10988 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10989 | # needs to be fragmented. |
| 10990 | # - All messages sent by the server must be small enough to be either sent |
| 10991 | # without fragmentation or be reassembled within the bounds of |
| 10992 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10993 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10994 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10995 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10996 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10997 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10998 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10999 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 11000 | 0 \ |
| 11001 | -s "Buffer record from epoch 1" \ |
| 11002 | -s "Found buffered record from current epoch - load" \ |
| 11003 | -c "Buffer record from epoch 1" \ |
| 11004 | -C "Found buffered record from current epoch - load" \ |
| 11005 | -c "Enough space available after freeing future epoch record" |
| 11006 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11007 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11008 | |
| 11009 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11010 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11011 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11012 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11013 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11014 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11015 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11016 | 0 \ |
| 11017 | -s "Extra-header:" \ |
| 11018 | -c "HTTP/1.0 200 OK" |
| 11019 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11020 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11021 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 11022 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11023 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11024 | "$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] | 11025 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 11026 | 0 \ |
| 11027 | -s "Extra-header:" \ |
| 11028 | -c "HTTP/1.0 200 OK" |
| 11029 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11030 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11032 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11033 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11034 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11035 | "$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] | 11036 | 0 \ |
| 11037 | -s "Extra-header:" \ |
| 11038 | -c "HTTP/1.0 200 OK" |
| 11039 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11040 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11042 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11043 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11044 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11045 | "$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] | 11046 | 0 \ |
| 11047 | -s "Extra-header:" \ |
| 11048 | -c "HTTP/1.0 200 OK" |
| 11049 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11050 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11052 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11053 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11054 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11055 | "$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] | 11056 | 0 \ |
| 11057 | -s "Extra-header:" \ |
| 11058 | -c "HTTP/1.0 200 OK" |
| 11059 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11060 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11062 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11063 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11064 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11065 | "$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] | 11066 | 0 \ |
| 11067 | -s "Extra-header:" \ |
| 11068 | -c "HTTP/1.0 200 OK" |
| 11069 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11070 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11072 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11073 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11074 | "$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] | 11075 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11076 | "$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] | 11077 | 0 \ |
| 11078 | -s "Extra-header:" \ |
| 11079 | -c "HTTP/1.0 200 OK" |
| 11080 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11081 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11082 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11083 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11084 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11085 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11086 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11087 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 11088 | 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] | 11089 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11090 | 0 \ |
| 11091 | -s "a session has been resumed" \ |
| 11092 | -c "a session has been resumed" \ |
| 11093 | -s "Extra-header:" \ |
| 11094 | -c "HTTP/1.0 200 OK" |
| 11095 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11096 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11097 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11098 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11099 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11100 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11101 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11102 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 11103 | 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] | 11104 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11105 | 0 \ |
| 11106 | -s "a session has been resumed" \ |
| 11107 | -c "a session has been resumed" \ |
| 11108 | -s "Extra-header:" \ |
| 11109 | -c "HTTP/1.0 200 OK" |
| 11110 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11111 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11112 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11113 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11114 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11115 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11116 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11117 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11118 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11119 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11120 | 0 \ |
| 11121 | -c "=> renegotiate" \ |
| 11122 | -s "=> renegotiate" \ |
| 11123 | -s "Extra-header:" \ |
| 11124 | -c "HTTP/1.0 200 OK" |
| 11125 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11126 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11127 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11128 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11129 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11130 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11131 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11132 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11133 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11134 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11135 | 0 \ |
| 11136 | -c "=> renegotiate" \ |
| 11137 | -s "=> renegotiate" \ |
| 11138 | -s "Extra-header:" \ |
| 11139 | -c "HTTP/1.0 200 OK" |
| 11140 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11141 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11143 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11144 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11145 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11146 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11147 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11148 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11149 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11150 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11151 | 0 \ |
| 11152 | -c "=> renegotiate" \ |
| 11153 | -s "=> renegotiate" \ |
| 11154 | -s "Extra-header:" \ |
| 11155 | -c "HTTP/1.0 200 OK" |
| 11156 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11157 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11159 | 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] | 11160 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11161 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11162 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11163 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11164 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11165 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11166 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11167 | 0 \ |
| 11168 | -c "=> renegotiate" \ |
| 11169 | -s "=> renegotiate" \ |
| 11170 | -s "Extra-header:" \ |
| 11171 | -c "HTTP/1.0 200 OK" |
| 11172 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11173 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11174 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11175 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11176 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11177 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11178 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11180 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11181 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 11182 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 11183 | "$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] | 11184 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11185 | -c "HTTP/1.0 200 OK" |
| 11186 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11187 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11188 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11189 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11191 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11192 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11193 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11194 | "$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] | 11195 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11196 | -c "HTTP/1.0 200 OK" |
| 11197 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11198 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11199 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11200 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11202 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11203 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11204 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11205 | "$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] | 11206 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11207 | -c "HTTP/1.0 200 OK" |
| 11208 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11209 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11210 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11211 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11213 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11214 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11215 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11216 | "$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] | 11217 | 0 \ |
| 11218 | -s "Extra-header:" \ |
| 11219 | -c "Extra-header:" |
| 11220 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11221 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11222 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11223 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11225 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11227 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11228 | "$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] | 11229 | 0 \ |
| 11230 | -s "Extra-header:" \ |
| 11231 | -c "Extra-header:" |
| 11232 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11233 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11234 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11235 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11237 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11238 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11239 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11240 | "$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] | 11241 | 0 \ |
| 11242 | -s "Extra-header:" \ |
| 11243 | -c "Extra-header:" |
| 11244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11246 | run_test "export keys functionality" \ |
| 11247 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 11248 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11249 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11250 | -c "EAP-TLS key material is:"\ |
| 11251 | -s "EAP-TLS key material is:"\ |
| 11252 | -c "EAP-TLS IV is:" \ |
| 11253 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11254 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11255 | # openssl feature tests: check if tls1.3 exists. |
| 11256 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11257 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11258 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11259 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11260 | 0 \ |
| 11261 | -c "TLS 1.3" \ |
| 11262 | -s "TLS 1.3" |
| 11263 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11264 | # 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] | 11265 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11266 | requires_gnutls_next_no_ticket |
| 11267 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11268 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11269 | "$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] | 11270 | "$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] | 11271 | 0 \ |
| 11272 | -s "Version: TLS1.3" \ |
| 11273 | -c "Version: TLS1.3" |
| 11274 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11275 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11277 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11278 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11279 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
| 11280 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11281 | run_test "TLS 1.3: Default" \ |
| 11282 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
| 11283 | "$P_CLI allow_sha1=0" \ |
| 11284 | 0 \ |
| 11285 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11286 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 5e2f816 | 2023-05-23 10:08:18 +0200 | [diff] [blame] | 11287 | -s "ECDH/FFDH group: x25519" \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11288 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 11289 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11290 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11291 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11292 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11293 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11294 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11295 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11296 | "$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] | 11297 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11298 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11299 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11300 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11301 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11302 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11303 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11304 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11305 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11306 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11307 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11308 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11309 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11310 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 75a5a9c | 2023-06-12 11:21:18 +0200 | [diff] [blame] | 11311 | -c "DHE group name: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11312 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11313 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11314 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11315 | -c "=> parse certificate verify" \ |
| 11316 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11317 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11318 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11319 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11320 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11321 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11322 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11323 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11324 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11325 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11326 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11327 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11328 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11329 | "$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] | 11330 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11331 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11332 | -s "SERVER HELLO was queued" \ |
| 11333 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11334 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11335 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11336 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11337 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11338 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11339 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11340 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11341 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11342 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11343 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11344 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 75a5a9c | 2023-06-12 11:21:18 +0200 | [diff] [blame] | 11345 | -c "DHE group name: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11346 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11347 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11348 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11349 | -c "=> parse certificate verify" \ |
| 11350 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11351 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11352 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11353 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11354 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11355 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11356 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11357 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11358 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11359 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11360 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11361 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11362 | run_test "TLS 1.3: alpn - openssl" \ |
| 11363 | "$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] | 11364 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11365 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11366 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11367 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11368 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11369 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11370 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11371 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11372 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11373 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11374 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11375 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11376 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11377 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 75a5a9c | 2023-06-12 11:21:18 +0200 | [diff] [blame] | 11378 | -c "DHE group name: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11379 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11380 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11381 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11382 | -c "=> parse certificate verify" \ |
| 11383 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11384 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11385 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11386 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11387 | -c "HTTP/1.0 200 ok" \ |
| 11388 | -c "Application Layer Protocol is h2" |
| 11389 | |
| 11390 | requires_gnutls_tls1_3 |
| 11391 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11392 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11393 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11394 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11395 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11396 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11397 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11398 | "$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] | 11399 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11400 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11401 | -s "SERVER HELLO was queued" \ |
| 11402 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11403 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11404 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11405 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11406 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11407 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11408 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11409 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11410 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11411 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11412 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11413 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 75a5a9c | 2023-06-12 11:21:18 +0200 | [diff] [blame] | 11414 | -c "DHE group name: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11415 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11416 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11417 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11418 | -c "=> parse certificate verify" \ |
| 11419 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11420 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11421 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11422 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11423 | -c "HTTP/1.0 200 OK" \ |
| 11424 | -c "Application Layer Protocol is h2" |
| 11425 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11426 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11427 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11428 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11429 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11430 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11431 | run_test "TLS 1.3: server alpn - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11432 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11433 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11434 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11435 | -s "found alpn extension" \ |
| 11436 | -s "server side, adding alpn extension" \ |
| 11437 | -s "Protocol is TLSv1.3" \ |
| 11438 | -s "HTTP/1.0 200 OK" \ |
| 11439 | -s "Application Layer Protocol is h2" |
| 11440 | |
| 11441 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11442 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11443 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11444 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11445 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11446 | run_test "TLS 1.3: server alpn - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11447 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11448 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11449 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11450 | -s "found alpn extension" \ |
| 11451 | -s "server side, adding alpn extension" \ |
| 11452 | -s "Protocol is TLSv1.3" \ |
| 11453 | -s "HTTP/1.0 200 OK" \ |
| 11454 | -s "Application Layer Protocol is h2" |
| 11455 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11457 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11458 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11459 | skip_handshake_stage_check |
| 11460 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11461 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11462 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11463 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11464 | 1 \ |
| 11465 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11466 | -S "Version: TLS1.0" \ |
| 11467 | -C "Protocol is TLSv1.0" |
| 11468 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11470 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11471 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11472 | skip_handshake_stage_check |
| 11473 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11474 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11475 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11476 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11477 | 1 \ |
| 11478 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11479 | -S "Version: TLS1.1" \ |
| 11480 | -C "Protocol is TLSv1.1" |
| 11481 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11483 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11484 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11485 | skip_handshake_stage_check |
| 11486 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11487 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11488 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11489 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11490 | 1 \ |
| 11491 | -s "Client's version: 3.3" \ |
| 11492 | -c "is a fatal alert message (msg 40)" \ |
| 11493 | -S "Version: TLS1.2" \ |
| 11494 | -C "Protocol is TLSv1.2" |
| 11495 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11497 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11498 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11499 | skip_handshake_stage_check |
| 11500 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11501 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11502 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11503 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11504 | 1 \ |
| 11505 | -s "fatal protocol_version" \ |
| 11506 | -c "is a fatal alert message (msg 70)" \ |
| 11507 | -S "Version: TLS1.0" \ |
| 11508 | -C "Protocol : TLSv1.0" |
| 11509 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11511 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11512 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11513 | skip_handshake_stage_check |
| 11514 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11515 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11516 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11517 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11518 | 1 \ |
| 11519 | -s "fatal protocol_version" \ |
| 11520 | -c "is a fatal alert message (msg 70)" \ |
| 11521 | -S "Version: TLS1.1" \ |
| 11522 | -C "Protocol : TLSv1.1" |
| 11523 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11524 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11525 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11526 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11527 | skip_handshake_stage_check |
| 11528 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11529 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11530 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11531 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11532 | 1 \ |
| 11533 | -s "fatal protocol_version" \ |
| 11534 | -c "is a fatal alert message (msg 70)" \ |
| 11535 | -S "Version: TLS1.2" \ |
| 11536 | -C "Protocol : TLSv1.2" |
| 11537 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11538 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11539 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11540 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11541 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11542 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11543 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11544 | "$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] | 11545 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11546 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11547 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11548 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11549 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11550 | -c "HTTP/1.0 200 ok" \ |
| 11551 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11552 | |
| 11553 | requires_gnutls_tls1_3 |
| 11554 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11555 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11556 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11557 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11558 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11559 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11560 | "$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] | 11561 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11562 | 0 \ |
| 11563 | -c "got a certificate request" \ |
| 11564 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11565 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11566 | -c "HTTP/1.0 200 OK" \ |
| 11567 | -c "Protocol is TLSv1.3" |
| 11568 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11569 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11570 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11571 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11572 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11573 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11574 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11575 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11576 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11577 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11578 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11579 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11580 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11581 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11582 | |
| 11583 | requires_gnutls_tls1_3 |
| 11584 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11585 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11586 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11587 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11588 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11589 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11590 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11591 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11592 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11593 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11594 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11595 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11596 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11597 | |
| 11598 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11599 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11600 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11601 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11602 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11603 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11604 | "$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] | 11605 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11606 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11607 | 0 \ |
| 11608 | -c "got a certificate request" \ |
| 11609 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11610 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11611 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11612 | |
| 11613 | requires_gnutls_tls1_3 |
| 11614 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11615 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11616 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11617 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11618 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11619 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11620 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11621 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11622 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11623 | 0 \ |
| 11624 | -c "got a certificate request" \ |
| 11625 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11626 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11627 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11628 | |
| 11629 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11630 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11631 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11632 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11633 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11634 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11635 | "$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] | 11636 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11637 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11638 | 0 \ |
| 11639 | -c "got a certificate request" \ |
| 11640 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11641 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11642 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11643 | |
| 11644 | requires_gnutls_tls1_3 |
| 11645 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11646 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11647 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11648 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11649 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11650 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11651 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11652 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11653 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11654 | 0 \ |
| 11655 | -c "got a certificate request" \ |
| 11656 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11657 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11658 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11659 | |
| 11660 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11661 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11662 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11663 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11664 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11665 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11666 | "$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] | 11667 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11668 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11669 | 0 \ |
| 11670 | -c "got a certificate request" \ |
| 11671 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11672 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11673 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11674 | |
| 11675 | requires_gnutls_tls1_3 |
| 11676 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11678 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11679 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11680 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11681 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11682 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11683 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11684 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11685 | 0 \ |
| 11686 | -c "got a certificate request" \ |
| 11687 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11688 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11689 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11690 | |
| 11691 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11692 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11693 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11694 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11695 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11696 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11697 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11698 | "$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] | 11699 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11700 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11701 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11702 | -c "got a certificate request" \ |
| 11703 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11704 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11705 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11706 | |
| 11707 | requires_gnutls_tls1_3 |
| 11708 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11709 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11710 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11711 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11712 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11713 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11714 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11715 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11716 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11717 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11718 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11719 | -c "got a certificate request" \ |
| 11720 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11721 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11722 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11723 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11724 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11725 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11726 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11727 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11728 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11729 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11730 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11731 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11732 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11733 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11734 | 0 \ |
| 11735 | -c "got a certificate request" \ |
| 11736 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11737 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11738 | -c "Protocol is TLSv1.3" |
| 11739 | |
| 11740 | requires_gnutls_tls1_3 |
| 11741 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11742 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11743 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11744 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11745 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11746 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11747 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11748 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11749 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11750 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11751 | 0 \ |
| 11752 | -c "got a certificate request" \ |
| 11753 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11754 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11755 | -c "Protocol is TLSv1.3" |
| 11756 | |
| 11757 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11758 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11759 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11760 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11761 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11762 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11763 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11764 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11765 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11766 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11767 | 0 \ |
| 11768 | -c "got a certificate request" \ |
| 11769 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11770 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11771 | -c "Protocol is TLSv1.3" |
| 11772 | |
| 11773 | requires_gnutls_tls1_3 |
| 11774 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11775 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11776 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11777 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11778 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11779 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11780 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11781 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11782 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11783 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11784 | 0 \ |
| 11785 | -c "got a certificate request" \ |
| 11786 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11787 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11788 | -c "Protocol is TLSv1.3" |
| 11789 | |
| 11790 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11791 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11792 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11793 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11794 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11795 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11796 | 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] | 11797 | "$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] | 11798 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11799 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11800 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11801 | 1 \ |
| 11802 | -c "got a certificate request" \ |
| 11803 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11804 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11805 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11806 | |
| 11807 | requires_gnutls_tls1_3 |
| 11808 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11809 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11810 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11811 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11812 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11813 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11814 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11815 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11816 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11817 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11818 | 1 \ |
| 11819 | -c "got a certificate request" \ |
| 11820 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11821 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11822 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11823 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11824 | # Test using an opaque private key for client authentication |
| 11825 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11826 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11828 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11829 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11830 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11831 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11832 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11833 | 0 \ |
| 11834 | -c "got a certificate request" \ |
| 11835 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11836 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11837 | -c "Protocol is TLSv1.3" |
| 11838 | |
| 11839 | requires_gnutls_tls1_3 |
| 11840 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11841 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11842 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11843 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11844 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11845 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11846 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11847 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11848 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11849 | 0 \ |
| 11850 | -c "got a certificate request" \ |
| 11851 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11852 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11853 | -c "Protocol is TLSv1.3" |
| 11854 | |
| 11855 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11856 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11857 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11859 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11860 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11861 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11862 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11863 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11864 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11865 | 0 \ |
| 11866 | -c "got a certificate request" \ |
| 11867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11869 | -c "Protocol is TLSv1.3" |
| 11870 | |
| 11871 | requires_gnutls_tls1_3 |
| 11872 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11873 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11875 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11876 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11877 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11878 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11879 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11880 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11881 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11882 | 0 \ |
| 11883 | -c "got a certificate request" \ |
| 11884 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11886 | -c "Protocol is TLSv1.3" |
| 11887 | |
| 11888 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11889 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11890 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11891 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11892 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11893 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11894 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11895 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11896 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11897 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11898 | 0 \ |
| 11899 | -c "got a certificate request" \ |
| 11900 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11901 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11902 | -c "Protocol is TLSv1.3" |
| 11903 | |
| 11904 | requires_gnutls_tls1_3 |
| 11905 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11906 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11907 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11908 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11909 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11910 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11911 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11912 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11913 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11914 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11915 | 0 \ |
| 11916 | -c "got a certificate request" \ |
| 11917 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11918 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11919 | -c "Protocol is TLSv1.3" |
| 11920 | |
| 11921 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11922 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11923 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11924 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11925 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11926 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11927 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11928 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11929 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11930 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11931 | 0 \ |
| 11932 | -c "got a certificate request" \ |
| 11933 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11934 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11935 | -c "Protocol is TLSv1.3" |
| 11936 | |
| 11937 | requires_gnutls_tls1_3 |
| 11938 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11939 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11940 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11941 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11942 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11943 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11944 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11945 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11946 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11947 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11948 | 0 \ |
| 11949 | -c "got a certificate request" \ |
| 11950 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11952 | -c "Protocol is TLSv1.3" |
| 11953 | |
| 11954 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11956 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11957 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11958 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11959 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11960 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11961 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11962 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11963 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11964 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11965 | 0 \ |
| 11966 | -c "got a certificate request" \ |
| 11967 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11968 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11969 | -c "Protocol is TLSv1.3" |
| 11970 | |
| 11971 | requires_gnutls_tls1_3 |
| 11972 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11973 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11974 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11975 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11976 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11977 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11978 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11979 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11980 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11981 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11982 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11983 | 0 \ |
| 11984 | -c "got a certificate request" \ |
| 11985 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11986 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11987 | -c "Protocol is TLSv1.3" |
| 11988 | |
| 11989 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11990 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11991 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11992 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11993 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11994 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11995 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11996 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11997 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11998 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11999 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12000 | 0 \ |
| 12001 | -c "got a certificate request" \ |
| 12002 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12003 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12004 | -c "Protocol is TLSv1.3" |
| 12005 | |
| 12006 | requires_gnutls_tls1_3 |
| 12007 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12008 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12009 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12010 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12011 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12012 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12013 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12014 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12015 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12016 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12017 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12018 | 0 \ |
| 12019 | -c "got a certificate request" \ |
| 12020 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12021 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12022 | -c "Protocol is TLSv1.3" |
| 12023 | |
| 12024 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12025 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12026 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12027 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12028 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12029 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12030 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12031 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12032 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12033 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12034 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12035 | 0 \ |
| 12036 | -c "got a certificate request" \ |
| 12037 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12038 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12039 | -c "Protocol is TLSv1.3" |
| 12040 | |
| 12041 | requires_gnutls_tls1_3 |
| 12042 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12043 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12044 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12045 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12046 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12047 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12048 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12049 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12050 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12051 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12052 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12053 | 0 \ |
| 12054 | -c "got a certificate request" \ |
| 12055 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12056 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12057 | -c "Protocol is TLSv1.3" |
| 12058 | |
| 12059 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12060 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12061 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12062 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12063 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12064 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12065 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12066 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12067 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12068 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12069 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12070 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12071 | 1 \ |
| 12072 | -c "got a certificate request" \ |
| 12073 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12074 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12075 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12076 | |
| 12077 | requires_gnutls_tls1_3 |
| 12078 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12079 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12080 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12081 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12082 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12083 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12084 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12085 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12086 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12087 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12088 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12089 | 1 \ |
| 12090 | -c "got a certificate request" \ |
| 12091 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12092 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12093 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12094 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12095 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12096 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12097 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12098 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12099 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12100 | 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] | 12101 | "$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] | 12102 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12103 | 0 \ |
| 12104 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12105 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12106 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12107 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12108 | -c "HTTP/1.0 200 ok" |
| 12109 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12110 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12111 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12112 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12113 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12114 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12115 | 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] | 12116 | "$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] | 12117 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12118 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12119 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12120 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12121 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12122 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12123 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12124 | |
| 12125 | requires_gnutls_tls1_3 |
| 12126 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12127 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12128 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12129 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12130 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12131 | 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] | 12132 | "$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] | 12133 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12134 | 0 \ |
| 12135 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12136 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12137 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12138 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12139 | -c "HTTP/1.0 200 OK" |
| 12140 | |
| 12141 | requires_gnutls_tls1_3 |
| 12142 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12143 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12144 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12145 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12146 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12147 | 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] | 12148 | "$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] | 12149 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12150 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12151 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12152 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12153 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12154 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12155 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12156 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12157 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12158 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12159 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12160 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12161 | run_test "TLS 1.3: Server side check - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12162 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12163 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12164 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12165 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12166 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12167 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12168 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12169 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12170 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12171 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12172 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12173 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12174 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12175 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12176 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12177 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12178 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12179 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 12180 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 12181 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12182 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12183 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12184 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12185 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12186 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12187 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12188 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12189 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12190 | -s "=> parse client hello" \ |
| 12191 | -s "<= parse client hello" |
| 12192 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12193 | requires_gnutls_tls1_3 |
| 12194 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12195 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12196 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12198 | run_test "TLS 1.3: Server side check - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12199 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 12200 | "$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] | 12201 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12202 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12203 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12204 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12205 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12206 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12207 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12208 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12209 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12210 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12211 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12212 | requires_gnutls_tls1_3 |
| 12213 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12214 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12215 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12216 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12217 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12218 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12219 | "$G_NEXT_CLI localhost -d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/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] | 12220 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12221 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12222 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12223 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12224 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12225 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12226 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12227 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12228 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12229 | -s "=> parse client hello" \ |
| 12230 | -s "<= parse client hello" |
| 12231 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12232 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12233 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12234 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12235 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12236 | run_test "TLS 1.3: Server side check - mbedtls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12237 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12238 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12239 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12240 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12241 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12242 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12243 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12244 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12245 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12246 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12247 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12248 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12249 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12250 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12251 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12252 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12253 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12254 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12255 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12256 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12257 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12258 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12259 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12260 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12261 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12262 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12263 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12264 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12265 | -s "=> parse client hello" \ |
| 12266 | -s "<= parse client hello" |
| 12267 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12268 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12269 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12270 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12271 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12272 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12273 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12274 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12275 | 1 \ |
| 12276 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12277 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12278 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12279 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12280 | -s "=> write certificate request" \ |
| 12281 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12282 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12283 | -s "=> parse client hello" \ |
| 12284 | -s "<= parse client hello" |
| 12285 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12286 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12287 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12288 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12289 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12290 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12291 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12292 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12293 | 0 \ |
| 12294 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12295 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12296 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12297 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12298 | -s "=> write certificate request" \ |
| 12299 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12300 | -s "=> parse client hello" \ |
| 12301 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12302 | |
| 12303 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12304 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12305 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12306 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12307 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12308 | "$P_SRV debug_level=4 curves=secp384r1" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12309 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12310 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12311 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12312 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12313 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12314 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12315 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12316 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12317 | -s "=> write hello retry request" \ |
| 12318 | -s "<= write hello retry request" |
| 12319 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12320 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12322 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12323 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12324 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12325 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12326 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12327 | 1 \ |
| 12328 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12329 | -s "No certificate available." |
| 12330 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12331 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12332 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12333 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12334 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12335 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12336 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12337 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12338 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12339 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_files/server5.crt -key data_files/server5.key -tls1_3" \ |
| 12340 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12341 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12342 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12343 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12344 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12345 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12346 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12347 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12348 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12349 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12350 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12351 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12352 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
| 12353 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12354 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12355 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12356 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12357 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12358 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12359 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12360 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12361 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12362 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12363 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12364 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12365 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12366 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12367 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12368 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12369 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12370 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12371 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12372 | TEST_SUITE_NAME=${i##*/} |
| 12373 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12374 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12375 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12376 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12377 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12378 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12379 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12380 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12381 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12382 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12383 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12384 | 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] | 12385 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12386 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12387 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12388 | -s "Protocol is TLSv1.3" \ |
| 12389 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12390 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12391 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12392 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12393 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12394 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12395 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12396 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12397 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12398 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12399 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12400 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12401 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12402 | -s "Protocol is TLSv1.3" \ |
| 12403 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12404 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12405 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12406 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12407 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12408 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12409 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12410 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12411 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12412 | 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] | 12413 | "$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] | 12414 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12415 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12416 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12417 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12418 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12419 | |
| 12420 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12421 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12422 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12423 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12424 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12425 | 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] | 12426 | "$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] | 12427 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12428 | 1 \ |
| 12429 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12430 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12431 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12432 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12433 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12434 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12435 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12436 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12437 | "$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] | 12438 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12439 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12440 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12441 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12442 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12443 | requires_gnutls_tls1_3 |
| 12444 | requires_gnutls_next_no_ticket |
| 12445 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12446 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12447 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12448 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12449 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12450 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12451 | "$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] | 12452 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12453 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12454 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12455 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12456 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12457 | |
| 12458 | requires_gnutls_tls1_3 |
| 12459 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12460 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12462 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12463 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12464 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12465 | "$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] | 12466 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12467 | 1 \ |
| 12468 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12469 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12470 | requires_gnutls_tls1_3 |
| 12471 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12472 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12473 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12474 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12475 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12476 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12477 | "$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] | 12478 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12479 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12480 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12481 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12482 | |
| 12483 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12484 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12485 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12486 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12487 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12488 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12489 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12490 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12491 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12492 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12493 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12494 | -C "14 03 03 00 01" |
| 12495 | |
| 12496 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12497 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12498 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12499 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12500 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12501 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12502 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12503 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12504 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12505 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12506 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12507 | |
| 12508 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12509 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12510 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12511 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12512 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12513 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12514 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12515 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12516 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12517 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12518 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12519 | -c "14 03 03 00 01" |
| 12520 | |
| 12521 | requires_gnutls_tls1_3 |
| 12522 | requires_gnutls_next_no_ticket |
| 12523 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12524 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12525 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12526 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12527 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12528 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12529 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12530 | "$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] | 12531 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12532 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12533 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12534 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12535 | |
| 12536 | requires_gnutls_tls1_3 |
| 12537 | requires_gnutls_next_no_ticket |
| 12538 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12539 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12540 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12541 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12542 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12543 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12544 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12545 | "$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] | 12546 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12547 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12548 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12549 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12550 | -c "discarding change cipher spec in TLS1.3" |
| 12551 | |
| 12552 | requires_gnutls_tls1_3 |
| 12553 | requires_gnutls_next_no_ticket |
| 12554 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12555 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12556 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12557 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12558 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12559 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12560 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12561 | "$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] | 12562 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12563 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12564 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12565 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12566 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12567 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12568 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12569 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12570 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12571 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12572 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12573 | "$P_SRV debug_level=4 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12574 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12575 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12576 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12577 | -c "Protocol is TLSv1.3" \ |
| 12578 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12579 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12580 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12581 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12583 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12584 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12585 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12586 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12587 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12588 | "$P_SRV debug_level=4 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12589 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12590 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12591 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12592 | -c "Protocol is TLSv1.3" \ |
| 12593 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12594 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12595 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12596 | |
| 12597 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12598 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12599 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12600 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12601 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12602 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12603 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -no_middlebox -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12604 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12605 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12606 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12607 | -c "received HelloRetryRequest message" \ |
| 12608 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12609 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12610 | |
| 12611 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12612 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12613 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12614 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12615 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12616 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12617 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12618 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12619 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12620 | -c "received HelloRetryRequest message" \ |
| 12621 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12622 | |
| 12623 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12624 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12625 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12626 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12627 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12628 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12629 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12630 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12631 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12632 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12633 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12634 | |
| 12635 | requires_gnutls_tls1_3 |
| 12636 | requires_gnutls_next_no_ticket |
| 12637 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12638 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12639 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12640 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12641 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12642 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12643 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12644 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12645 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12646 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12647 | -c "received HelloRetryRequest message" \ |
| 12648 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12649 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12650 | |
| 12651 | requires_gnutls_tls1_3 |
| 12652 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12653 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12655 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12656 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12657 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12658 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12659 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12660 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12661 | -c "received HelloRetryRequest message" \ |
| 12662 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12663 | |
| 12664 | requires_gnutls_tls1_3 |
| 12665 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12666 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12667 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12668 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12669 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12670 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12671 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12672 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12673 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12674 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12675 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12676 | |
| 12677 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12678 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12679 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12680 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12681 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12682 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12683 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12684 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12685 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12686 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12687 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12688 | -C "14 03 03 00 01" |
| 12689 | |
| 12690 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12691 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12692 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12693 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12694 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12695 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12696 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12697 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12698 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12699 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12700 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12701 | |
| 12702 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12703 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12704 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12705 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12706 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12707 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12708 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12709 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12710 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12711 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12712 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12713 | -c "14 03 03 00 01" |
| 12714 | |
| 12715 | requires_gnutls_tls1_3 |
| 12716 | requires_gnutls_next_no_ticket |
| 12717 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12718 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12719 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12720 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12721 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12722 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12723 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12724 | "$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] | 12725 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12726 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12727 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12728 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12729 | |
| 12730 | requires_gnutls_tls1_3 |
| 12731 | requires_gnutls_next_no_ticket |
| 12732 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12733 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12734 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12735 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12736 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12737 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12738 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12739 | "$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] | 12740 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12741 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12742 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12743 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12744 | -c "discarding change cipher spec in TLS1.3" |
| 12745 | |
| 12746 | requires_gnutls_tls1_3 |
| 12747 | requires_gnutls_next_no_ticket |
| 12748 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12749 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12750 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12751 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12752 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12753 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12754 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12755 | "$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] | 12756 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12757 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12758 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12759 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12760 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12761 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12762 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12763 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12764 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12765 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12766 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12767 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12768 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12769 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12770 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12771 | 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] | 12772 | 0 \ |
| 12773 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12774 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12775 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12776 | |
| 12777 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12778 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12779 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12780 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12781 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12782 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12783 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12784 | -d 4 |
| 12785 | --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 " \ |
| 12786 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12787 | 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] | 12788 | 0 \ |
| 12789 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12790 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12791 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12792 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12793 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12794 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12795 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12796 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12797 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12798 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12799 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12800 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12801 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12802 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12803 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12804 | 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] | 12805 | 0 \ |
| 12806 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12807 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12808 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12809 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12810 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12811 | |
| 12812 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12814 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12815 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12816 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12817 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12818 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12819 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12820 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12821 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12822 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12823 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12824 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12825 | 0 \ |
| 12826 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12827 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12828 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12829 | |
| 12830 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12831 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12832 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12833 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12834 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12835 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12836 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12837 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12838 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12839 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12840 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12841 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12842 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12843 | 0 \ |
| 12844 | -c "Negotiated version: 3.4" \ |
| 12845 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12846 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12847 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12848 | |
| 12849 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12850 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12851 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12852 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12853 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12854 | 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] | 12855 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12856 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12857 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12858 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12859 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12860 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12861 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12862 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12863 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12864 | |
| 12865 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12866 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12867 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12868 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12869 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12870 | 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] | 12871 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12872 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12873 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12874 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12875 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12876 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12877 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12878 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12879 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12880 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12881 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12882 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12883 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12884 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12885 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12886 | 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] | 12887 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12888 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12889 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12890 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12891 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12892 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12893 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12894 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12895 | |
| 12896 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12897 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12898 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12899 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12900 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12901 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12902 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12903 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12904 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12905 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12906 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12907 | 1 \ |
| 12908 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12909 | |
| 12910 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12911 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12912 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12913 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12914 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12915 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12916 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12917 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12918 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12919 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12920 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12921 | 1 \ |
| 12922 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12923 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12924 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12925 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12926 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12927 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12928 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12929 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12930 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12931 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12932 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12933 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12934 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12935 | 1 \ |
| 12936 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12937 | |
| 12938 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12939 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12940 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12941 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12942 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12943 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12944 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12945 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12946 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12947 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12948 | 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] | 12949 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12950 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12951 | |
| 12952 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12953 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12954 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12955 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12956 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12957 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12958 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12959 | -d 4 |
| 12960 | --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 " \ |
| 12961 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12962 | 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] | 12963 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12964 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12965 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12966 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12967 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12968 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12969 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12970 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12971 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12972 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12973 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12974 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12975 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12976 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12977 | 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] | 12978 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12979 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12980 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12981 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12982 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12983 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12984 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12985 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12986 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12987 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12988 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12989 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12990 | 0 \ |
| 12991 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12992 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12993 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12994 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12995 | -c "HTTP/1.0 200 ok" |
| 12996 | |
| 12997 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12998 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12999 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13000 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13001 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13002 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13003 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 13004 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13005 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13006 | 0 \ |
| 13007 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13008 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13009 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13010 | -c "Reconnecting with saved session" \ |
| 13011 | -c "HTTP/1.0 200 OK" \ |
| 13012 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13013 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13014 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13015 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13016 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13017 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13018 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13019 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13020 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13021 | # https://github.com/openssl/openssl/issues/10714 |
| 13022 | # Until now, OpenSSL client does not support reconnect. |
| 13023 | skip_next_test |
| 13024 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13025 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13026 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 13027 | 0 \ |
| 13028 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13029 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13030 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13031 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13032 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13033 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13034 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13035 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13036 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13037 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13038 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13039 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13040 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13041 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13042 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13043 | -c "Connecting again- trying to resume previous session" \ |
| 13044 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13045 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13046 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13047 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13048 | -s "key exchange mode: ephemeral" \ |
| 13049 | -s "key exchange mode: psk_ephemeral" \ |
| 13050 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13051 | |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13052 | requires_gnutls_tls1_3 |
| 13053 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13054 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13055 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13056 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13057 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13058 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | d89360b | 2023-02-21 08:53:33 +0100 | [diff] [blame] | 13059 | # Test the session resumption when the cipher suite for the original session is |
| 13060 | # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not |
| 13061 | # 256 bits long as with all the other TLS 1.3 cipher suites. |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13062 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 13063 | run_test "TLS 1.3: NewSessionTicket: Basic check with AES-256-GCM only, G->m" \ |
| 13064 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13065 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r" \ |
| 13066 | 0 \ |
| 13067 | -c "Connecting again- trying to resume previous session" \ |
| 13068 | -c "NEW SESSION TICKET (4) was received" \ |
| 13069 | -s "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 13070 | -s "=> write NewSessionTicket msg" \ |
| 13071 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13072 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
| 13073 | -s "key exchange mode: ephemeral" \ |
| 13074 | -s "key exchange mode: psk_ephemeral" \ |
| 13075 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13076 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13077 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13078 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13079 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13080 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13081 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13082 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13083 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13084 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13085 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13086 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13087 | 0 \ |
| 13088 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13089 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13090 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13091 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13092 | -c "HTTP/1.0 200 OK" \ |
| 13093 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13094 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13095 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13096 | -s "key exchange mode: ephemeral" \ |
| 13097 | -s "key exchange mode: psk_ephemeral" \ |
| 13098 | -s "found pre_shared_key extension" |
| 13099 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13100 | requires_openssl_tls1_3 |
| 13101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13102 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13103 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13104 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13105 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13106 | -msg -tls1_2 |
| 13107 | -Verify 10 " \ |
| 13108 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13109 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13110 | min_version=tls12 max_version=tls13 " \ |
| 13111 | 0 \ |
| 13112 | -c "Protocol is TLSv1.2" \ |
| 13113 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13114 | |
| 13115 | |
| 13116 | requires_gnutls_tls1_3 |
| 13117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13118 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13119 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13120 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13121 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13122 | -d 4 |
| 13123 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13124 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13125 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13126 | min_version=tls12 max_version=tls13 " \ |
| 13127 | 0 \ |
| 13128 | -c "Protocol is TLSv1.2" \ |
| 13129 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13130 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13131 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13132 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13133 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13134 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13135 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13136 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13137 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13138 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13139 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13140 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13141 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13142 | 0 \ |
| 13143 | -c "Protocol is TLSv1.3" \ |
| 13144 | -c "got new session ticket." \ |
| 13145 | -c "Saving session for reuse... ok" \ |
| 13146 | -c "Reconnecting with saved session" \ |
| 13147 | -c "HTTP/1.0 200 OK" \ |
| 13148 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13149 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13150 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13151 | -s "key exchange mode: ephemeral" \ |
| 13152 | -s "key exchange mode: psk_ephemeral" \ |
| 13153 | -s "found pre_shared_key extension" |
| 13154 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13156 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13158 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13159 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13160 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13161 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13162 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13163 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13164 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Jerry Yu | ad9e99b | 2022-10-28 12:18:52 +0800 | [diff] [blame] | 13165 | "$P_CLI debug_level=4 server_name=localhost reco_server_name=remote reco_mode=1 reconnect=1" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13166 | 1 \ |
| 13167 | -c "Protocol is TLSv1.3" \ |
| 13168 | -c "got new session ticket." \ |
| 13169 | -c "Saving session for reuse... ok" \ |
| 13170 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13171 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13172 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13173 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13174 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13175 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13176 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13178 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13179 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13180 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13181 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13182 | run_tests_memory_after_hanshake |
| 13183 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13184 | # Final report |
| 13185 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13186 | echo "------------------------------------------------------------------------" |
| 13187 | |
| 13188 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13189 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13190 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13191 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13192 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13193 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13194 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13195 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13196 | if [ $FAILS -gt 255 ]; then |
| 13197 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13198 | # (so 256 would be 0, or success, etc) |
| 13199 | FAILS=255 |
| 13200 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13201 | exit $FAILS |