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 | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
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 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | 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] | 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | 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] | 68 | 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] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 84 | 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] | 85 | 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] | 86 | else |
| 87 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 88 | O_NEXT_SRV_NO_CERT=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 89 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 90 | O_NEXT_CLI=false |
| 91 | fi |
| 92 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 93 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | 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] | 95 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | else |
| 97 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 98 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 99 | fi |
| 100 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 101 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 102 | 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] | 103 | 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] | 104 | else |
| 105 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 106 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 107 | fi |
| 108 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 109 | TESTS=0 |
| 110 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 111 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 112 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 113 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 114 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 115 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 116 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 117 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 118 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 119 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 120 | RUN_TEST_NUMBER='' |
| 121 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 122 | PRESERVE_LOGS=0 |
| 123 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 124 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 125 | # port which is this plus 10000. Each port number may be independently |
| 126 | # overridden by a command line option. |
| 127 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 128 | PXY_PORT=$((SRV_PORT + 10000)) |
| 129 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 130 | print_usage() { |
| 131 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 132 | printf " -h|--help\tPrint this help.\n" |
| 133 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 134 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 135 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 136 | 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] | 137 | 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] | 138 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 140 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 141 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 142 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 143 | 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] | 144 | } |
| 145 | |
| 146 | get_options() { |
| 147 | while [ $# -gt 0 ]; do |
| 148 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 149 | -f|--filter) |
| 150 | shift; FILTER=$1 |
| 151 | ;; |
| 152 | -e|--exclude) |
| 153 | shift; EXCLUDE=$1 |
| 154 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | -m|--memcheck) |
| 156 | MEMCHECK=1 |
| 157 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 158 | -n|--number) |
| 159 | shift; RUN_TEST_NUMBER=$1 |
| 160 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 161 | -s|--show-numbers) |
| 162 | SHOW_TEST_NUMBER=1 |
| 163 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 164 | -p|--preserve-logs) |
| 165 | PRESERVE_LOGS=1 |
| 166 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 167 | --port) |
| 168 | shift; SRV_PORT=$1 |
| 169 | ;; |
| 170 | --proxy-port) |
| 171 | shift; PXY_PORT=$1 |
| 172 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 173 | --seed) |
| 174 | shift; SEED="$1" |
| 175 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 176 | -h|--help) |
| 177 | print_usage |
| 178 | exit 0 |
| 179 | ;; |
| 180 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 181 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 182 | print_usage |
| 183 | exit 1 |
| 184 | ;; |
| 185 | esac |
| 186 | shift |
| 187 | done |
| 188 | } |
| 189 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 190 | # Make the outcome file path relative to the original directory, not |
| 191 | # to .../tests |
| 192 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 193 | [!/]*) |
| 194 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 195 | ;; |
| 196 | esac |
| 197 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 198 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 199 | # testing. Skip non-boolean options (with something other than spaces |
| 200 | # and a comment after "#define SYMBOL"). The variable contains a |
| 201 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 202 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 203 | # Skip next test; use this macro to skip tests which are legitimate |
| 204 | # in theory and expected to be re-introduced at some point, but |
| 205 | # aren't expected to succeed at the moment due to problems outside |
| 206 | # our control (such as bugs in other TLS implementations). |
| 207 | skip_next_test() { |
| 208 | SKIP_NEXT="YES" |
| 209 | } |
| 210 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 211 | # 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] | 212 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 214 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | *) SKIP_NEXT="YES";; |
| 216 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 217 | } |
| 218 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 219 | # 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] | 220 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 221 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 222 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 223 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 224 | } |
| 225 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 226 | requires_all_configs_enabled() { |
| 227 | if ! $P_QUERY -all $* |
| 228 | then |
| 229 | SKIP_NEXT="YES" |
| 230 | fi |
| 231 | } |
| 232 | |
| 233 | requires_all_configs_disabled() { |
| 234 | if $P_QUERY -any $* |
| 235 | then |
| 236 | SKIP_NEXT="YES" |
| 237 | fi |
| 238 | } |
| 239 | |
| 240 | requires_any_configs_enabled() { |
| 241 | if ! $P_QUERY -any $* |
| 242 | then |
| 243 | SKIP_NEXT="YES" |
| 244 | fi |
| 245 | } |
| 246 | |
| 247 | requires_any_configs_disabled() { |
| 248 | if $P_QUERY -all $* |
| 249 | then |
| 250 | SKIP_NEXT="YES" |
| 251 | fi |
| 252 | } |
| 253 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 254 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 255 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 256 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 257 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 258 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 259 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 260 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 261 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 262 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 263 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 264 | then |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 265 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 266 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 267 | then |
| 268 | SKIP_NEXT="YES" |
| 269 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 270 | } |
| 271 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 272 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 273 | # This function uses the query_config command line option to query the |
| 274 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 275 | # program. The command will always return a success value if the |
| 276 | # configuration is defined and the value will be printed to stdout. |
| 277 | # |
| 278 | # Note that if the configuration is not defined or is defined to nothing, |
| 279 | # the output of this function will be an empty string. |
| 280 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 284 | VAL="$( get_config_value_or_default "$1" )" |
| 285 | if [ -z "$VAL" ]; then |
| 286 | # Should never happen |
| 287 | echo "Mbed TLS configuration $1 is not defined" |
| 288 | exit 1 |
| 289 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 290 | SKIP_NEXT="YES" |
| 291 | fi |
| 292 | } |
| 293 | |
| 294 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 295 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 296 | if [ -z "$VAL" ]; then |
| 297 | # Should never happen |
| 298 | echo "Mbed TLS configuration $1 is not defined" |
| 299 | exit 1 |
| 300 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 301 | SKIP_NEXT="YES" |
| 302 | fi |
| 303 | } |
| 304 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 305 | requires_config_value_equals() { |
| 306 | VAL=$( get_config_value_or_default "$1" ) |
| 307 | if [ -z "$VAL" ]; then |
| 308 | # Should never happen |
| 309 | echo "Mbed TLS configuration $1 is not defined" |
| 310 | exit 1 |
| 311 | elif [ "$VAL" -ne "$2" ]; then |
| 312 | SKIP_NEXT="YES" |
| 313 | fi |
| 314 | } |
| 315 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 316 | # Require Mbed TLS to support the given protocol version. |
| 317 | # |
| 318 | # Inputs: |
| 319 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 320 | requires_protocol_version() { |
| 321 | # Support for DTLS is detected separately in detect_dtls(). |
| 322 | case "$1" in |
| 323 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 324 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 325 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 326 | esac |
| 327 | } |
| 328 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 329 | # Space-separated list of ciphersuites supported by this build of |
| 330 | # Mbed TLS. |
| 331 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 332 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 333 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 334 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 335 | case $P_CIPHERSUITES in |
| 336 | *" $1 "*) :;; |
| 337 | *) SKIP_NEXT="YES";; |
| 338 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 339 | } |
| 340 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 341 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 342 | # If CMD (call to a TLS client or server program) requires certain features, |
| 343 | # arrange to only run the following test case if those features are enabled. |
| 344 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 345 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 346 | *\ force_version=*) |
| 347 | tmp="${1##*\ force_version=}" |
| 348 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 349 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 350 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 351 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 352 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 353 | *\ force_ciphersuite=*) |
| 354 | tmp="${1##*\ force_ciphersuite=}" |
| 355 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 356 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 357 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 358 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 359 | case " $1 " in |
| 360 | *[-_\ =]tickets=[^0]*) |
| 361 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 362 | esac |
| 363 | case " $1 " in |
| 364 | *[-_\ =]alpn=*) |
| 365 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 366 | esac |
| 367 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 368 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 369 | } |
| 370 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 371 | requires_certificate_authentication () { |
| 372 | if [ "$PSK_ONLY" = "YES" ]; then |
| 373 | SKIP_NEXT="YES" |
| 374 | fi |
| 375 | } |
| 376 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 377 | adapt_cmd_for_psk () { |
| 378 | case "$2" in |
| 379 | *openssl*) s='-psk abc123 -nocert';; |
| 380 | *gnutls-*) s='--pskkey=abc123';; |
| 381 | *) s='psk=abc123';; |
| 382 | esac |
| 383 | eval $1='"$2 $s"' |
| 384 | unset s |
| 385 | } |
| 386 | |
| 387 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 388 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 389 | # |
| 390 | # If not running in a PSK-only build, do nothing. |
| 391 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 392 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 393 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 394 | # a pre-shared key, do nothing. |
| 395 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 396 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 397 | # |
| 398 | # Inputs: |
| 399 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 400 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 401 | # * "$@": options passed to run_test. |
| 402 | # |
| 403 | # Outputs: |
| 404 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 405 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 406 | maybe_adapt_for_psk() { |
| 407 | if [ "$PSK_ONLY" != "YES" ]; then |
| 408 | return |
| 409 | fi |
| 410 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 411 | return |
| 412 | fi |
| 413 | case "$CLI_CMD $SRV_CMD" in |
| 414 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 415 | return;; |
| 416 | *force_ciphersuite*) |
| 417 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 418 | # PSK cipher suite could be substituted, but we're not ready for |
| 419 | # that yet. |
| 420 | SKIP_NEXT="YES" |
| 421 | return;; |
| 422 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 423 | # The test case involves certificates. PSK won't do. |
| 424 | SKIP_NEXT="YES" |
| 425 | return;; |
| 426 | esac |
| 427 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 428 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 429 | } |
| 430 | |
| 431 | case " $CONFIGS_ENABLED " in |
| 432 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 433 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 434 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 435 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 436 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 437 | *) PSK_ONLY="NO";; |
| 438 | esac |
| 439 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 440 | HAS_ALG_SHA_1="NO" |
| 441 | HAS_ALG_SHA_224="NO" |
| 442 | HAS_ALG_SHA_256="NO" |
| 443 | HAS_ALG_SHA_384="NO" |
| 444 | HAS_ALG_SHA_512="NO" |
| 445 | |
| 446 | check_for_hash_alg() |
| 447 | { |
| 448 | CURR_ALG="INVALID"; |
| 449 | USE_PSA="NO" |
| 450 | case $CONFIGS_ENABLED in |
| 451 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 452 | USE_PSA="YES"; |
| 453 | ;; |
| 454 | *) :;; |
| 455 | esac |
| 456 | if [ $USE_PSA = "YES" ]; then |
| 457 | CURR_ALG=PSA_WANT_ALG_${1} |
| 458 | else |
| 459 | CURR_ALG=MBEDTLS_${1}_C |
| 460 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 461 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 462 | fi |
| 463 | |
| 464 | case $CONFIGS_ENABLED in |
| 465 | *" $CURR_ALG"[\ =]*) |
| 466 | return 0 |
| 467 | ;; |
| 468 | *) :;; |
| 469 | esac |
| 470 | return 1 |
| 471 | } |
| 472 | |
| 473 | populate_enabled_hash_algs() |
| 474 | { |
| 475 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 476 | if check_for_hash_alg "$hash_alg"; then |
| 477 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 478 | eval ${hash_alg_variable}=YES |
| 479 | fi |
| 480 | done |
| 481 | } |
| 482 | |
| 483 | # skip next test if the given hash alg is not supported |
| 484 | requires_hash_alg() { |
| 485 | HASH_DEFINE="Invalid" |
| 486 | HAS_HASH_ALG="NO" |
| 487 | case $1 in |
| 488 | SHA_1):;; |
| 489 | SHA_224):;; |
| 490 | SHA_256):;; |
| 491 | SHA_384):;; |
| 492 | SHA_512):;; |
| 493 | *) |
| 494 | echo "Unsupported hash alg - $1" |
| 495 | exit 1 |
| 496 | ;; |
| 497 | esac |
| 498 | |
| 499 | HASH_DEFINE=HAS_ALG_${1} |
| 500 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 501 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 502 | then |
| 503 | SKIP_NEXT="YES" |
| 504 | fi |
| 505 | } |
| 506 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 507 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 508 | requires_openssl_with_fallback_scsv() { |
| 509 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 510 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 511 | then |
| 512 | OPENSSL_HAS_FBSCSV="YES" |
| 513 | else |
| 514 | OPENSSL_HAS_FBSCSV="NO" |
| 515 | fi |
| 516 | fi |
| 517 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 518 | SKIP_NEXT="YES" |
| 519 | fi |
| 520 | } |
| 521 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 522 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 523 | requires_max_content_len() { |
| 524 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 525 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 526 | } |
| 527 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 528 | # skip next test if GnuTLS isn't available |
| 529 | requires_gnutls() { |
| 530 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 531 | 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] | 532 | GNUTLS_AVAILABLE="YES" |
| 533 | else |
| 534 | GNUTLS_AVAILABLE="NO" |
| 535 | fi |
| 536 | fi |
| 537 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 538 | SKIP_NEXT="YES" |
| 539 | fi |
| 540 | } |
| 541 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 542 | # skip next test if GnuTLS-next isn't available |
| 543 | requires_gnutls_next() { |
| 544 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 545 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 546 | GNUTLS_NEXT_AVAILABLE="YES" |
| 547 | else |
| 548 | GNUTLS_NEXT_AVAILABLE="NO" |
| 549 | fi |
| 550 | fi |
| 551 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 552 | SKIP_NEXT="YES" |
| 553 | fi |
| 554 | } |
| 555 | |
| 556 | # skip next test if OpenSSL-legacy isn't available |
| 557 | requires_openssl_legacy() { |
| 558 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 559 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 560 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 561 | else |
| 562 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 563 | fi |
| 564 | fi |
| 565 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 566 | SKIP_NEXT="YES" |
| 567 | fi |
| 568 | } |
| 569 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 570 | requires_openssl_next() { |
| 571 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 572 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 573 | OPENSSL_NEXT_AVAILABLE="YES" |
| 574 | else |
| 575 | OPENSSL_NEXT_AVAILABLE="NO" |
| 576 | fi |
| 577 | fi |
| 578 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 579 | SKIP_NEXT="YES" |
| 580 | fi |
| 581 | } |
| 582 | |
| 583 | # skip next test if tls1_3 is not available |
| 584 | requires_openssl_tls1_3() { |
| 585 | requires_openssl_next |
| 586 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 587 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 588 | fi |
| 589 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 590 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 591 | then |
| 592 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 593 | else |
| 594 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 595 | fi |
| 596 | fi |
| 597 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 598 | SKIP_NEXT="YES" |
| 599 | fi |
| 600 | } |
| 601 | |
| 602 | # skip next test if tls1_3 is not available |
| 603 | requires_gnutls_tls1_3() { |
| 604 | requires_gnutls_next |
| 605 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 606 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 607 | fi |
| 608 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 609 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 610 | then |
| 611 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 612 | else |
| 613 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 614 | fi |
| 615 | fi |
| 616 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 617 | SKIP_NEXT="YES" |
| 618 | fi |
| 619 | } |
| 620 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 621 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 622 | requires_gnutls_next_no_ticket() { |
| 623 | requires_gnutls_next |
| 624 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 625 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 626 | fi |
| 627 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 628 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 629 | then |
| 630 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 631 | else |
| 632 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 633 | fi |
| 634 | fi |
| 635 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 636 | SKIP_NEXT="YES" |
| 637 | fi |
| 638 | } |
| 639 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 640 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 641 | requires_gnutls_next_disable_tls13_compat() { |
| 642 | requires_gnutls_next |
| 643 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 644 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 645 | fi |
| 646 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 647 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 648 | then |
| 649 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 650 | else |
| 651 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 652 | fi |
| 653 | fi |
| 654 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 655 | SKIP_NEXT="YES" |
| 656 | fi |
| 657 | } |
| 658 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 659 | # skip next test if IPv6 isn't available on this host |
| 660 | requires_ipv6() { |
| 661 | if [ -z "${HAS_IPV6:-}" ]; then |
| 662 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 663 | SRV_PID=$! |
| 664 | sleep 1 |
| 665 | kill $SRV_PID >/dev/null 2>&1 |
| 666 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 667 | HAS_IPV6="NO" |
| 668 | else |
| 669 | HAS_IPV6="YES" |
| 670 | fi |
| 671 | rm -r $SRV_OUT |
| 672 | fi |
| 673 | |
| 674 | if [ "$HAS_IPV6" = "NO" ]; then |
| 675 | SKIP_NEXT="YES" |
| 676 | fi |
| 677 | } |
| 678 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 679 | # skip next test if it's i686 or uname is not available |
| 680 | requires_not_i686() { |
| 681 | if [ -z "${IS_I686:-}" ]; then |
| 682 | IS_I686="YES" |
| 683 | if which "uname" >/dev/null 2>&1; then |
| 684 | if [ -z "$(uname -a | grep i686)" ]; then |
| 685 | IS_I686="NO" |
| 686 | fi |
| 687 | fi |
| 688 | fi |
| 689 | if [ "$IS_I686" = "YES" ]; then |
| 690 | SKIP_NEXT="YES" |
| 691 | fi |
| 692 | } |
| 693 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 694 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 695 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 696 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 697 | 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] | 698 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 699 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 700 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 701 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 702 | fi |
| 703 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 704 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 705 | fi |
| 706 | |
| 707 | # skip the next test if the SSL output buffer is less than 16KB |
| 708 | requires_full_size_output_buffer() { |
| 709 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 710 | SKIP_NEXT="YES" |
| 711 | fi |
| 712 | } |
| 713 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 714 | # skip the next test if valgrind is in use |
| 715 | not_with_valgrind() { |
| 716 | if [ "$MEMCHECK" -gt 0 ]; then |
| 717 | SKIP_NEXT="YES" |
| 718 | fi |
| 719 | } |
| 720 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 721 | # skip the next test if valgrind is NOT in use |
| 722 | only_with_valgrind() { |
| 723 | if [ "$MEMCHECK" -eq 0 ]; then |
| 724 | SKIP_NEXT="YES" |
| 725 | fi |
| 726 | } |
| 727 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 728 | # 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] | 729 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 730 | CLI_DELAY_FACTOR=$1 |
| 731 | } |
| 732 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 733 | # wait for the given seconds after the client finished in the next test |
| 734 | server_needs_more_time() { |
| 735 | SRV_DELAY_SECONDS=$1 |
| 736 | } |
| 737 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 738 | # print_name <name> |
| 739 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 740 | TESTS=$(( $TESTS + 1 )) |
| 741 | LINE="" |
| 742 | |
| 743 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 744 | LINE="$TESTS " |
| 745 | fi |
| 746 | |
| 747 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 748 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 749 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 750 | for i in `seq 1 $LEN`; do printf '.'; done |
| 751 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 752 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 753 | } |
| 754 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 755 | # record_outcome <outcome> [<failure-reason>] |
| 756 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 757 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 758 | record_outcome() { |
| 759 | echo "$1" |
| 760 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 761 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 762 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 763 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 764 | "$1" "${2-}" \ |
| 765 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 766 | fi |
| 767 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 768 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 769 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 770 | # True if the presence of the given pattern in a log definitely indicates |
| 771 | # that the test has failed. False if the presence is inconclusive. |
| 772 | # |
| 773 | # Inputs: |
| 774 | # * $1: pattern found in the logs |
| 775 | # * $TIMES_LEFT: >0 if retrying is an option |
| 776 | # |
| 777 | # Outputs: |
| 778 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 779 | # unchanged otherwise. |
| 780 | # * Return value: 1 if the pattern is inconclusive, |
| 781 | # 0 if the failure is definitive. |
| 782 | log_pattern_presence_is_conclusive() { |
| 783 | # If we've run out of attempts, then don't retry no matter what. |
| 784 | if [ $TIMES_LEFT -eq 0 ]; then |
| 785 | return 0 |
| 786 | fi |
| 787 | case $1 in |
| 788 | "resend") |
| 789 | # An undesired resend may have been caused by the OS dropping or |
| 790 | # delaying a packet at an inopportune time. |
| 791 | outcome="RETRY(resend)" |
| 792 | return 1;; |
| 793 | esac |
| 794 | } |
| 795 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 796 | # fail <message> |
| 797 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 798 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 799 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 800 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 801 | mv $SRV_OUT o-srv-${TESTS}.log |
| 802 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 803 | if [ -n "$PXY_CMD" ]; then |
| 804 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 805 | fi |
| 806 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 807 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 808 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 809 | echo " ! server output:" |
| 810 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 811 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 812 | echo " ! client output:" |
| 813 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 814 | if [ -n "$PXY_CMD" ]; then |
| 815 | echo " ! ========================================================" |
| 816 | echo " ! proxy output:" |
| 817 | cat o-pxy-${TESTS}.log |
| 818 | fi |
| 819 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 820 | fi |
| 821 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 822 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 823 | } |
| 824 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 825 | # is_polar <cmd_line> |
| 826 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 827 | case "$1" in |
| 828 | *ssl_client2*) true;; |
| 829 | *ssl_server2*) true;; |
| 830 | *) false;; |
| 831 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 832 | } |
| 833 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 834 | # openssl s_server doesn't have -www with DTLS |
| 835 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 836 | case "$SRV_CMD" in |
| 837 | *s_server*-dtls*) |
| 838 | NEEDS_INPUT=1 |
| 839 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 840 | *) NEEDS_INPUT=0;; |
| 841 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 842 | } |
| 843 | |
| 844 | # provide input to commands that need it |
| 845 | provide_input() { |
| 846 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 847 | return |
| 848 | fi |
| 849 | |
| 850 | while true; do |
| 851 | echo "HTTP/1.0 200 OK" |
| 852 | sleep 1 |
| 853 | done |
| 854 | } |
| 855 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 856 | # has_mem_err <log_file_name> |
| 857 | has_mem_err() { |
| 858 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 859 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 860 | then |
| 861 | return 1 # false: does not have errors |
| 862 | else |
| 863 | return 0 # true: has errors |
| 864 | fi |
| 865 | } |
| 866 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 867 | # 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] | 868 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 869 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 870 | newline=' |
| 871 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 872 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 873 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 874 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 875 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 876 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 877 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 878 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 879 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 880 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 881 | # When we use a proxy, it will be listening on the same port we |
| 882 | # 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] | 883 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 884 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 885 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 886 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 887 | echo "$3 START TIMEOUT" |
| 888 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 889 | break |
| 890 | fi |
| 891 | # Linux and *BSD support decimal arguments to sleep. On other |
| 892 | # OSes this may be a tight loop. |
| 893 | sleep 0.1 2>/dev/null || true |
| 894 | done |
| 895 | } |
| 896 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 897 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 898 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 899 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 900 | } |
| 901 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 902 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 903 | # Wait for server process $2 to be listening on port $1. |
| 904 | wait_server_start() { |
| 905 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 906 | } |
| 907 | |
| 908 | # Wait for proxy process $2 to be listening on port $1. |
| 909 | wait_proxy_start() { |
| 910 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 911 | } |
| 912 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 913 | # 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] | 914 | # 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] | 915 | # acceptable bounds |
| 916 | check_server_hello_time() { |
| 917 | # 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] | 918 | 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] | 919 | # Get the Unix timestamp for now |
| 920 | CUR_TIME=$(date +'%s') |
| 921 | THRESHOLD_IN_SECS=300 |
| 922 | |
| 923 | # Check if the ServerHello time was printed |
| 924 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 925 | return 1 |
| 926 | fi |
| 927 | |
| 928 | # Check the time in ServerHello is within acceptable bounds |
| 929 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 930 | # The time in ServerHello is at least 5 minutes before now |
| 931 | return 1 |
| 932 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 933 | # 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] | 934 | return 1 |
| 935 | else |
| 936 | return 0 |
| 937 | fi |
| 938 | } |
| 939 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 940 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 941 | handshake_memory_get() { |
| 942 | OUTPUT_VARIABLE="$1" |
| 943 | OUTPUT_FILE="$2" |
| 944 | |
| 945 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 946 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 947 | |
| 948 | # Check if memory usage was read |
| 949 | if [ -z "$MEM_USAGE" ]; then |
| 950 | echo "Error: Can not read the value of handshake memory usage" |
| 951 | return 1 |
| 952 | else |
| 953 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 954 | return 0 |
| 955 | fi |
| 956 | } |
| 957 | |
| 958 | # Get handshake memory usage from server or client output and check if this value |
| 959 | # is not higher than the maximum given by the first argument |
| 960 | handshake_memory_check() { |
| 961 | MAX_MEMORY="$1" |
| 962 | OUTPUT_FILE="$2" |
| 963 | |
| 964 | # Get memory usage |
| 965 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 966 | return 1 |
| 967 | fi |
| 968 | |
| 969 | # Check if memory usage is below max value |
| 970 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 971 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 972 | "but should be below $MAX_MEMORY bytes" |
| 973 | return 1 |
| 974 | else |
| 975 | return 0 |
| 976 | fi |
| 977 | } |
| 978 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 979 | # wait for client to terminate and set CLI_EXIT |
| 980 | # must be called right after starting the client |
| 981 | wait_client_done() { |
| 982 | CLI_PID=$! |
| 983 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 984 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 985 | CLI_DELAY_FACTOR=1 |
| 986 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 987 | ( 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] | 988 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 989 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 990 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 991 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 992 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 993 | CLI_EXIT=$? |
| 994 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 995 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 996 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 997 | |
| 998 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 999 | |
| 1000 | sleep $SRV_DELAY_SECONDS |
| 1001 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1002 | } |
| 1003 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1004 | # check if the given command uses dtls and sets global variable DTLS |
| 1005 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1006 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1007 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1008 | *) DTLS=0;; |
| 1009 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1010 | } |
| 1011 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1012 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1013 | is_gnutls() { |
| 1014 | case "$1" in |
| 1015 | *gnutls-cli*) |
| 1016 | CMD_IS_GNUTLS=1 |
| 1017 | ;; |
| 1018 | *gnutls-serv*) |
| 1019 | CMD_IS_GNUTLS=1 |
| 1020 | ;; |
| 1021 | *) |
| 1022 | CMD_IS_GNUTLS=0 |
| 1023 | ;; |
| 1024 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1025 | } |
| 1026 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1027 | # Determine what calc_verify trace is to be expected, if any. |
| 1028 | # |
| 1029 | # calc_verify is only called for two things: to calculate the |
| 1030 | # extended master secret, and to process client authentication. |
| 1031 | # |
| 1032 | # Warning: the current implementation assumes that extended_ms is not |
| 1033 | # disabled on the client or on the server. |
| 1034 | # |
| 1035 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1036 | # * $1: the value of the server auth_mode parameter. |
| 1037 | # 'required' if client authentication is expected, |
| 1038 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1039 | # * $CONFIGS_ENABLED |
| 1040 | # |
| 1041 | # Outputs: |
| 1042 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1043 | set_maybe_calc_verify() { |
| 1044 | maybe_calc_verify= |
| 1045 | case $CONFIGS_ENABLED in |
| 1046 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1047 | *) |
| 1048 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1049 | ''|none) return;; |
| 1050 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1051 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1052 | esac |
| 1053 | esac |
| 1054 | case $CONFIGS_ENABLED in |
| 1055 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1056 | *) maybe_calc_verify="<= calc verify";; |
| 1057 | esac |
| 1058 | } |
| 1059 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1060 | # Compare file content |
| 1061 | # Usage: find_in_both pattern file1 file2 |
| 1062 | # extract from file1 the first line matching the pattern |
| 1063 | # check in file2 that the same line can be found |
| 1064 | find_in_both() { |
| 1065 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1066 | if [ -z "$srv_pattern" ]; then |
| 1067 | return 1; |
| 1068 | fi |
| 1069 | |
| 1070 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1071 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1072 | else |
| 1073 | return 1; |
| 1074 | fi |
| 1075 | } |
| 1076 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1077 | SKIP_HANDSHAKE_CHECK="NO" |
| 1078 | skip_handshake_stage_check() { |
| 1079 | SKIP_HANDSHAKE_CHECK="YES" |
| 1080 | } |
| 1081 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1082 | # Analyze the commands that will be used in a test. |
| 1083 | # |
| 1084 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1085 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1086 | # |
| 1087 | # Inputs: |
| 1088 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1089 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1090 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1091 | # |
| 1092 | # Outputs: |
| 1093 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1094 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1095 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1096 | # 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] | 1097 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1098 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1099 | case " $SRV_CMD " in |
| 1100 | *' server_addr=::1 '*) |
| 1101 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1102 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1103 | fi |
| 1104 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1105 | # update CMD_IS_GNUTLS variable |
| 1106 | is_gnutls "$SRV_CMD" |
| 1107 | |
| 1108 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1109 | # set the default priority |
| 1110 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1111 | case "$SRV_CMD" in |
| 1112 | *--priority*) :;; |
| 1113 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1114 | esac |
| 1115 | fi |
| 1116 | |
| 1117 | # update CMD_IS_GNUTLS variable |
| 1118 | is_gnutls "$CLI_CMD" |
| 1119 | |
| 1120 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1121 | # set the default priority |
| 1122 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1123 | case "$CLI_CMD" in |
| 1124 | *--priority*) :;; |
| 1125 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1126 | esac |
| 1127 | fi |
| 1128 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1129 | # fix client port |
| 1130 | if [ -n "$PXY_CMD" ]; then |
| 1131 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1132 | else |
| 1133 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1134 | fi |
| 1135 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1136 | # prepend valgrind to our commands if active |
| 1137 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1138 | if is_polar "$SRV_CMD"; then |
| 1139 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1140 | fi |
| 1141 | if is_polar "$CLI_CMD"; then |
| 1142 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1143 | fi |
| 1144 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1145 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1146 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1147 | # Check for failure conditions after a test case. |
| 1148 | # |
| 1149 | # Inputs from run_test: |
| 1150 | # * positional parameters: test options (see run_test documentation) |
| 1151 | # * $CLI_EXIT: client return code |
| 1152 | # * $CLI_EXPECT: expected client return code |
| 1153 | # * $SRV_RET: server return code |
| 1154 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1155 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1156 | # |
| 1157 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1158 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1159 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1160 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1161 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1162 | if [ $TIMES_LEFT -gt 0 ] && |
| 1163 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1164 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1165 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1166 | return |
| 1167 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1168 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1169 | # 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] | 1170 | # (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] | 1171 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1172 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1173 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1174 | then |
| 1175 | if is_polar "$SRV_CMD"; then |
| 1176 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1177 | else |
| 1178 | fail "server or client failed to reach handshake stage" |
| 1179 | return |
| 1180 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1181 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1182 | if is_polar "$CLI_CMD"; then |
| 1183 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1184 | else |
| 1185 | fail "server or client failed to reach handshake stage" |
| 1186 | return |
| 1187 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1188 | fi |
| 1189 | fi |
| 1190 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1191 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1192 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1193 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1194 | # care anyway), in case e.g. the server reports a memory leak. |
| 1195 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1196 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1197 | return |
| 1198 | fi |
| 1199 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1200 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1201 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1202 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1203 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1204 | 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] | 1205 | return |
| 1206 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1207 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1208 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1209 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1210 | # 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] | 1211 | while [ $# -gt 0 ] |
| 1212 | do |
| 1213 | case $1 in |
| 1214 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1215 | 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] | 1216 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1217 | return |
| 1218 | fi |
| 1219 | ;; |
| 1220 | |
| 1221 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1222 | 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] | 1223 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1224 | return |
| 1225 | fi |
| 1226 | ;; |
| 1227 | |
| 1228 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1229 | 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] | 1230 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1231 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1232 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1233 | return |
| 1234 | fi |
| 1235 | ;; |
| 1236 | |
| 1237 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1238 | 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] | 1239 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1240 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1241 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1242 | return |
| 1243 | fi |
| 1244 | ;; |
| 1245 | |
| 1246 | # The filtering in the following two options (-u and -U) do the following |
| 1247 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1248 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1249 | # - keep one of each non-unique line |
| 1250 | # - count how many lines remain |
| 1251 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1252 | # if there were no duplicates. |
| 1253 | "-U") |
| 1254 | 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 |
| 1255 | fail "lines following pattern '$2' must be unique in Server output" |
| 1256 | return |
| 1257 | fi |
| 1258 | ;; |
| 1259 | |
| 1260 | "-u") |
| 1261 | 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 |
| 1262 | 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] | 1263 | return |
| 1264 | fi |
| 1265 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1266 | "-F") |
| 1267 | if ! $2 "$SRV_OUT"; then |
| 1268 | fail "function call to '$2' failed on Server output" |
| 1269 | return |
| 1270 | fi |
| 1271 | ;; |
| 1272 | "-f") |
| 1273 | if ! $2 "$CLI_OUT"; then |
| 1274 | fail "function call to '$2' failed on Client output" |
| 1275 | return |
| 1276 | fi |
| 1277 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1278 | "-g") |
| 1279 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1280 | fail "function call to '$2' failed on Server and Client output" |
| 1281 | return |
| 1282 | fi |
| 1283 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1284 | |
| 1285 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1286 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1287 | exit 1 |
| 1288 | esac |
| 1289 | shift 2 |
| 1290 | done |
| 1291 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1292 | # check valgrind's results |
| 1293 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1294 | 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] | 1295 | fail "Server has memory errors" |
| 1296 | return |
| 1297 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1298 | 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] | 1299 | fail "Client has memory errors" |
| 1300 | return |
| 1301 | fi |
| 1302 | fi |
| 1303 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1304 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1305 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1306 | } |
| 1307 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1308 | # Run the current test case: start the server and if applicable the proxy, run |
| 1309 | # the client, wait for all processes to finish or time out. |
| 1310 | # |
| 1311 | # Inputs: |
| 1312 | # * $NAME: test case name |
| 1313 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1314 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1315 | # |
| 1316 | # Outputs: |
| 1317 | # * $CLI_EXIT: client return code |
| 1318 | # * $SRV_RET: server return code |
| 1319 | do_run_test_once() { |
| 1320 | # run the commands |
| 1321 | if [ -n "$PXY_CMD" ]; then |
| 1322 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1323 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1324 | PXY_PID=$! |
| 1325 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1326 | fi |
| 1327 | |
| 1328 | check_osrv_dtls |
| 1329 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1330 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1331 | SRV_PID=$! |
| 1332 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1333 | |
| 1334 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1335 | # The client must be a subprocess of the script in order for killing it to |
| 1336 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1337 | # not at the end of the line: the latter approach will spawn eval as a |
| 1338 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1339 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1340 | wait_client_done |
| 1341 | |
| 1342 | sleep 0.05 |
| 1343 | |
| 1344 | # terminate the server (and the proxy) |
| 1345 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1346 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1347 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1348 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1349 | SRV_RET=$? |
| 1350 | |
| 1351 | if [ -n "$PXY_CMD" ]; then |
| 1352 | kill $PXY_PID >/dev/null 2>&1 |
| 1353 | wait $PXY_PID |
| 1354 | fi |
| 1355 | } |
| 1356 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1357 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1358 | # Options: -s pattern pattern that must be present in server output |
| 1359 | # -c pattern pattern that must be present in client output |
| 1360 | # -u pattern lines after pattern must be unique in client output |
| 1361 | # -f call shell function on client output |
| 1362 | # -S pattern pattern that must be absent in server output |
| 1363 | # -C pattern pattern that must be absent in client output |
| 1364 | # -U pattern lines after pattern must be unique in server output |
| 1365 | # -F call shell function on server output |
| 1366 | # -g call shell function on server and client output |
| 1367 | run_test() { |
| 1368 | NAME="$1" |
| 1369 | shift 1 |
| 1370 | |
| 1371 | if is_excluded "$NAME"; then |
| 1372 | SKIP_NEXT="NO" |
| 1373 | # There was no request to run the test, so don't record its outcome. |
| 1374 | return |
| 1375 | fi |
| 1376 | |
| 1377 | print_name "$NAME" |
| 1378 | |
| 1379 | # Do we only run numbered tests? |
| 1380 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1381 | case ",$RUN_TEST_NUMBER," in |
| 1382 | *",$TESTS,"*) :;; |
| 1383 | *) SKIP_NEXT="YES";; |
| 1384 | esac |
| 1385 | fi |
| 1386 | |
| 1387 | # does this test use a proxy? |
| 1388 | if [ "X$1" = "X-p" ]; then |
| 1389 | PXY_CMD="$2" |
| 1390 | shift 2 |
| 1391 | else |
| 1392 | PXY_CMD="" |
| 1393 | fi |
| 1394 | |
| 1395 | # get commands and client output |
| 1396 | SRV_CMD="$1" |
| 1397 | CLI_CMD="$2" |
| 1398 | CLI_EXPECT="$3" |
| 1399 | shift 3 |
| 1400 | |
| 1401 | # Check if test uses files |
| 1402 | case "$SRV_CMD $CLI_CMD" in |
| 1403 | *data_files/*) |
| 1404 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1405 | esac |
| 1406 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1407 | # Check if the test uses DTLS. |
| 1408 | detect_dtls "$SRV_CMD" |
| 1409 | if [ "$DTLS" -eq 1 ]; then |
| 1410 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1411 | fi |
| 1412 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1413 | # If the client or server requires certain features that can be detected |
| 1414 | # from their command-line arguments, check that they're enabled. |
| 1415 | detect_required_features "$SRV_CMD" "$@" |
| 1416 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1417 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1418 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1419 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1420 | |
| 1421 | # should we skip? |
| 1422 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1423 | SKIP_NEXT="NO" |
| 1424 | record_outcome "SKIP" |
| 1425 | SKIPS=$(( $SKIPS + 1 )) |
| 1426 | return |
| 1427 | fi |
| 1428 | |
| 1429 | analyze_test_commands "$@" |
| 1430 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1431 | # One regular run and two retries |
| 1432 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1433 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1434 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1435 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1436 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1437 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1438 | check_test_failure "$@" |
| 1439 | case $outcome in |
| 1440 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1441 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1442 | FAIL) return;; |
| 1443 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1444 | done |
| 1445 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1446 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1447 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1448 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1449 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1450 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1451 | if [ -n "$PXY_CMD" ]; then |
| 1452 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1453 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1454 | fi |
| 1455 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1456 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1457 | } |
| 1458 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1459 | run_test_psa() { |
| 1460 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1461 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1462 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1463 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1464 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1465 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1466 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1467 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1468 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1469 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1470 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1471 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1472 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1473 | -S "error" \ |
| 1474 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1475 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1476 | } |
| 1477 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1478 | run_test_psa_force_curve() { |
| 1479 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1480 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1481 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1482 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1483 | "$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] | 1484 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1485 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1486 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1487 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1488 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1489 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1490 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1491 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1492 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1493 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1494 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1495 | } |
| 1496 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1497 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1498 | # a maximum fragment length. |
| 1499 | # first argument ($1) is MFL for SSL client |
| 1500 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1501 | run_test_memory_after_hanshake_with_mfl() |
| 1502 | { |
| 1503 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1504 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1505 | |
| 1506 | # Leave some margin for robustness |
| 1507 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1508 | |
| 1509 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1510 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1511 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1512 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1513 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1514 | 0 \ |
| 1515 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1516 | } |
| 1517 | |
| 1518 | |
| 1519 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1520 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1521 | run_tests_memory_after_hanshake() |
| 1522 | { |
| 1523 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1524 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1525 | |
| 1526 | # first test with default MFU is to get reference memory usage |
| 1527 | MEMORY_USAGE_MFL_16K=0 |
| 1528 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1529 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1530 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1531 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1532 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1533 | 0 \ |
| 1534 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1535 | |
| 1536 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1537 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1538 | |
| 1539 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1540 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1541 | |
| 1542 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1543 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1544 | |
| 1545 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1546 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1547 | } |
| 1548 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1549 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1550 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1551 | rm -f context_srv.txt |
| 1552 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1553 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1554 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1555 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1556 | 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] | 1557 | exit 1 |
| 1558 | } |
| 1559 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1560 | # |
| 1561 | # MAIN |
| 1562 | # |
| 1563 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1564 | get_options "$@" |
| 1565 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1566 | populate_enabled_hash_algs |
| 1567 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1568 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1569 | # patterns rather than regular expressions, use a case statement instead |
| 1570 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1571 | # detects simple cases: plain substring, everything, nothing. |
| 1572 | # |
| 1573 | # As an exception, the character '.' is treated as an ordinary character |
| 1574 | # if it is the only special character in the string. This is because it's |
| 1575 | # rare to need "any one character", but needing a literal '.' is common |
| 1576 | # (e.g. '-f "DTLS 1.2"'). |
| 1577 | need_grep= |
| 1578 | case "$FILTER" in |
| 1579 | '^$') simple_filter=;; |
| 1580 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1581 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1582 | need_grep=1;; |
| 1583 | *) # No regexp or shell-pattern special character |
| 1584 | simple_filter="*$FILTER*";; |
| 1585 | esac |
| 1586 | case "$EXCLUDE" in |
| 1587 | '^$') simple_exclude=;; |
| 1588 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1589 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1590 | need_grep=1;; |
| 1591 | *) # No regexp or shell-pattern special character |
| 1592 | simple_exclude="*$EXCLUDE*";; |
| 1593 | esac |
| 1594 | if [ -n "$need_grep" ]; then |
| 1595 | is_excluded () { |
| 1596 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1597 | } |
| 1598 | else |
| 1599 | is_excluded () { |
| 1600 | case "$1" in |
| 1601 | $simple_exclude) true;; |
| 1602 | $simple_filter) false;; |
| 1603 | *) true;; |
| 1604 | esac |
| 1605 | } |
| 1606 | fi |
| 1607 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1608 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1609 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1610 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1611 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1612 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1613 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1614 | exit 1 |
| 1615 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1616 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1617 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1618 | exit 1 |
| 1619 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1620 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1621 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1622 | exit 1 |
| 1623 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1624 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1625 | if which valgrind >/dev/null 2>&1; then :; else |
| 1626 | echo "Memcheck not possible. Valgrind not found" |
| 1627 | exit 1 |
| 1628 | fi |
| 1629 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1630 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1631 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1632 | exit 1 |
| 1633 | fi |
| 1634 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1635 | # used by watchdog |
| 1636 | MAIN_PID="$$" |
| 1637 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1638 | # We use somewhat arbitrary delays for tests: |
| 1639 | # - how long do we wait for the server to start (when lsof not available)? |
| 1640 | # - how long do we allow for the client to finish? |
| 1641 | # (not to check performance, just to avoid waiting indefinitely) |
| 1642 | # Things are slower with valgrind, so give extra time here. |
| 1643 | # |
| 1644 | # Note: without lsof, there is a trade-off between the running time of this |
| 1645 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1646 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1647 | # 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] | 1648 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1649 | START_DELAY=6 |
| 1650 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1651 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1652 | START_DELAY=2 |
| 1653 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1654 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1655 | |
| 1656 | # some particular tests need more time: |
| 1657 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1658 | # - for the server, we sleep for a number of seconds after the client exits |
| 1659 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1660 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1661 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1662 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1663 | # 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] | 1664 | # +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] | 1665 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1666 | # 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] | 1667 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1668 | 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] | 1669 | 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] | 1670 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1671 | 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] | 1672 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1673 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1674 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1675 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1676 | 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] | 1677 | 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] | 1678 | fi |
| 1679 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1680 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1681 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1682 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1683 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1684 | 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] | 1685 | fi |
| 1686 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1687 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1688 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1689 | 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] | 1690 | fi |
| 1691 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1692 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1693 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1694 | 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] | 1695 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1696 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1697 | # Allow SHA-1, because many of our test certificates use it |
| 1698 | P_SRV="$P_SRV allow_sha1=1" |
| 1699 | P_CLI="$P_CLI allow_sha1=1" |
| 1700 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1701 | # Also pick a unique name for intermediate files |
| 1702 | SRV_OUT="srv_out.$$" |
| 1703 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1704 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1705 | SESSION="session.$$" |
| 1706 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1707 | SKIP_NEXT="NO" |
| 1708 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1709 | trap cleanup INT TERM HUP |
| 1710 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1711 | # Basic test |
| 1712 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1713 | # Checks that: |
| 1714 | # - 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] | 1715 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1717 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1718 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1719 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1720 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1721 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1722 | "$P_CLI" \ |
| 1723 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1724 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1725 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1726 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1727 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1728 | -S "error" \ |
| 1729 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1732 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1733 | run_test "Default, DTLS" \ |
| 1734 | "$P_SRV dtls=1" \ |
| 1735 | "$P_CLI dtls=1" \ |
| 1736 | 0 \ |
| 1737 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1738 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1741 | run_test "TLS client auth: required" \ |
| 1742 | "$P_SRV auth_mode=required" \ |
| 1743 | "$P_CLI" \ |
| 1744 | 0 \ |
| 1745 | -s "Verifying peer X.509 certificate... ok" |
| 1746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1748 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1749 | "$P_SRV" \ |
| 1750 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1751 | 0 \ |
| 1752 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1753 | -c "Key size is 256" |
| 1754 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1756 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1757 | "$P_SRV" \ |
| 1758 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1759 | 0 \ |
| 1760 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1761 | -c "Key size is 128" |
| 1762 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1765 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1766 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1767 | run_test "TLS: password protected client key" \ |
| 1768 | "$P_SRV auth_mode=required" \ |
| 1769 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1770 | 0 |
| 1771 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1773 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1774 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1775 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1776 | run_test "TLS: password protected server key" \ |
| 1777 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1778 | "$P_CLI" \ |
| 1779 | 0 |
| 1780 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1783 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1784 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1785 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1786 | run_test "TLS: password protected server key, two certificates" \ |
| 1787 | "$P_SRV \ |
| 1788 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1789 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1790 | "$P_CLI" \ |
| 1791 | 0 |
| 1792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1795 | run_test "CA callback on client" \ |
| 1796 | "$P_SRV debug_level=3" \ |
| 1797 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1798 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1799 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1800 | -S "error" \ |
| 1801 | -C "error" |
| 1802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1804 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1805 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1806 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1807 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1808 | run_test "CA callback on server" \ |
| 1809 | "$P_SRV auth_mode=required" \ |
| 1810 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1811 | key_file=data_files/server5.key" \ |
| 1812 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1813 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1814 | -s "Verifying peer X.509 certificate... ok" \ |
| 1815 | -S "error" \ |
| 1816 | -C "error" |
| 1817 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1818 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1820 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1821 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1822 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1823 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1824 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1825 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1826 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1827 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1828 | 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] | 1829 | 0 \ |
| 1830 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1831 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1832 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1833 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1834 | -S "error" \ |
| 1835 | -C "error" |
| 1836 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1837 | # Test using a RSA opaque private key for client authentication |
| 1838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1839 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1840 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1841 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1842 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1843 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1844 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1845 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1846 | key_file=data_files/server2.key" \ |
| 1847 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1848 | 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] | 1849 | 0 \ |
| 1850 | -c "key type: Opaque" \ |
| 1851 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1852 | -s "Verifying peer X.509 certificate... ok" \ |
| 1853 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1854 | -S "error" \ |
| 1855 | -C "error" |
| 1856 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1859 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1860 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1861 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1862 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1863 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1864 | key_file=data_files/server2.key" \ |
| 1865 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1866 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1867 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1868 | 0 \ |
| 1869 | -c "key type: Opaque" \ |
| 1870 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1871 | -s "Verifying peer X.509 certificate... ok" \ |
| 1872 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1873 | -S "error" \ |
| 1874 | -C "error" |
| 1875 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1876 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1879 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1880 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1881 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1882 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1883 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1884 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1885 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1886 | 0 \ |
| 1887 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1888 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1889 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1890 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1891 | -S "error" \ |
| 1892 | -C "error" |
| 1893 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1895 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1896 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1897 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1898 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1899 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1900 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1901 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1902 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1903 | "$P_CLI" \ |
| 1904 | 0 \ |
| 1905 | -c "Verifying peer X.509 certificate... ok" \ |
| 1906 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1907 | -s "key types: Opaque, none" \ |
| 1908 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1909 | -S "error" \ |
| 1910 | -C "error" |
| 1911 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1913 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1914 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1915 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1916 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1917 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1918 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1919 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1920 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1921 | debug_level=1" \ |
| 1922 | "$P_CLI" \ |
| 1923 | 1 \ |
| 1924 | -s "key types: Opaque, none" \ |
| 1925 | -s "error" \ |
| 1926 | -c "error" \ |
| 1927 | -c "Public key type mismatch" |
| 1928 | |
| 1929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1930 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1931 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1932 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1933 | requires_config_enabled MBEDTLS_RSA_C |
| 1934 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1935 | requires_hash_alg SHA_256 |
| 1936 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1937 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1938 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1939 | debug_level=1" \ |
| 1940 | "$P_CLI" \ |
| 1941 | 1 \ |
| 1942 | -s "key types: Opaque, none" \ |
| 1943 | -s "error" \ |
| 1944 | -c "error" \ |
| 1945 | -c "Public key type mismatch" |
| 1946 | |
| 1947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1948 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1949 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1950 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1951 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1952 | requires_hash_alg SHA_256 |
| 1953 | 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] | 1954 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1955 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1956 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1957 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1958 | 1 \ |
| 1959 | -s "key types: Opaque, none" \ |
| 1960 | -s "got ciphersuites in common, but none of them usable" \ |
| 1961 | -s "error" \ |
| 1962 | -c "error" |
| 1963 | |
| 1964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1965 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1966 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1967 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1970 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1971 | 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] | 1972 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1973 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1974 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1975 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1976 | 1 \ |
| 1977 | -s "key types: Opaque, none" \ |
| 1978 | -s "got ciphersuites in common, but none of them usable" \ |
| 1979 | -s "error" \ |
| 1980 | -c "error" |
| 1981 | |
| 1982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1983 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1984 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1985 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1986 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1987 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1988 | 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] | 1989 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1990 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 1991 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1992 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1993 | 1 \ |
| 1994 | -s "key types: Opaque, none" \ |
| 1995 | -s "got ciphersuites in common, but none of them usable" \ |
| 1996 | -s "error" \ |
| 1997 | -c "error" |
| 1998 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2000 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2001 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2002 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2003 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2004 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2005 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2006 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2007 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2008 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2009 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2010 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2011 | 0 \ |
| 2012 | -c "Verifying peer X.509 certificate... ok" \ |
| 2013 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2014 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2015 | -s "key types: Opaque, Opaque" \ |
| 2016 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2017 | -S "error" \ |
| 2018 | -C "error" |
| 2019 | |
| 2020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2021 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2022 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2023 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2024 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2025 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2026 | 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] | 2027 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2028 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2029 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2030 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2031 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2032 | 0 \ |
| 2033 | -c "Verifying peer X.509 certificate... ok" \ |
| 2034 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2035 | -c "CN=Polarssl Test EC CA" \ |
| 2036 | -s "key types: Opaque, Opaque" \ |
| 2037 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2038 | -S "error" \ |
| 2039 | -C "error" |
| 2040 | |
| 2041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2042 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2043 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2044 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2045 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2047 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2048 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2049 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2050 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2051 | crt_file2=data_files/server2-sha256.crt \ |
| 2052 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2053 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2054 | 0 \ |
| 2055 | -c "Verifying peer X.509 certificate... ok" \ |
| 2056 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2057 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2058 | -s "key types: Opaque, Opaque" \ |
| 2059 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2060 | -S "error" \ |
| 2061 | -C "error" |
| 2062 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2064 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2065 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2066 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2067 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2068 | "$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] | 2069 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2070 | -s "The SSL configuration is tls13 only" \ |
| 2071 | -c "key type: Opaque" \ |
| 2072 | -s "key types: Opaque, Opaque" \ |
| 2073 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2074 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2075 | |
| 2076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2077 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2078 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2079 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2080 | "$P_SRV debug_level=4 force_version=tls13 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] | 2081 | "$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] | 2082 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2083 | -s "The SSL configuration is tls13 only" \ |
| 2084 | -c "key type: Opaque" \ |
| 2085 | -s "key types: Opaque, Opaque" \ |
| 2086 | -C "error" \ |
| 2087 | -S "error" \ |
| 2088 | |
| 2089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2090 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2091 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2092 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2093 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2094 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2095 | 0 \ |
| 2096 | -s "The SSL configuration is tls13 only" \ |
| 2097 | -s "key types: Opaque, Opaque" \ |
| 2098 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2099 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2100 | -C "error" \ |
| 2101 | -S "error" \ |
| 2102 | |
| 2103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2104 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2105 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2106 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2107 | "$P_SRV debug_level=4 force_version=tls13 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] | 2108 | "$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] | 2109 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2110 | -s "The SSL configuration is tls13 only" \ |
| 2111 | -c "key type: Opaque" \ |
| 2112 | -s "key types: Opaque, Opaque" \ |
| 2113 | -C "error" \ |
| 2114 | -S "error" \ |
| 2115 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2116 | # Test using a RSA opaque private key for server authentication |
| 2117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2118 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2119 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2120 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2121 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2122 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2123 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2124 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2125 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2126 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2127 | 0 \ |
| 2128 | -c "Verifying peer X.509 certificate... ok" \ |
| 2129 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2130 | -s "key types: Opaque, none" \ |
| 2131 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2132 | -S "error" \ |
| 2133 | -C "error" |
| 2134 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2136 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2137 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2138 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2139 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2140 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2141 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2142 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2143 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2144 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2145 | 0 \ |
| 2146 | -c "Verifying peer X.509 certificate... ok" \ |
| 2147 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2148 | -s "key types: Opaque, none" \ |
| 2149 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2150 | -S "error" \ |
| 2151 | -C "error" |
| 2152 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2154 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2155 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2157 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2158 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2159 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2160 | psk=abc123 psk_identity=foo" \ |
| 2161 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2162 | psk=abc123 psk_identity=foo" \ |
| 2163 | 0 \ |
| 2164 | -c "Verifying peer X.509 certificate... ok" \ |
| 2165 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2166 | -s "key types: Opaque, Opaque" \ |
| 2167 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2168 | -S "error" \ |
| 2169 | -C "error" |
| 2170 | |
| 2171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2172 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2173 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2174 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2175 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2176 | run_test "Opaque key for server authentication: RSA-" \ |
| 2177 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2178 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2179 | 0 \ |
| 2180 | -c "Verifying peer X.509 certificate... ok" \ |
| 2181 | -c "Ciphersuite is TLS-RSA-" \ |
| 2182 | -s "key types: Opaque, Opaque" \ |
| 2183 | -s "Ciphersuite is TLS-RSA-" \ |
| 2184 | -S "error" \ |
| 2185 | -C "error" |
| 2186 | |
| 2187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2188 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2189 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2191 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2192 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2193 | 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] | 2194 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2195 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2196 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2197 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2198 | 1 \ |
| 2199 | -s "key types: Opaque, none" \ |
| 2200 | -s "got ciphersuites in common, but none of them usable" \ |
| 2201 | -s "error" \ |
| 2202 | -c "error" |
| 2203 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2205 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2206 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2207 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2208 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2209 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2210 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2211 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2212 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2213 | 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] | 2214 | crt_file2=data_files/server4.crt \ |
| 2215 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2216 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2217 | 0 \ |
| 2218 | -c "Verifying peer X.509 certificate... ok" \ |
| 2219 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2220 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2221 | -s "key types: Opaque, Opaque" \ |
| 2222 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2223 | -S "error" \ |
| 2224 | -C "error" |
| 2225 | |
| 2226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2227 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2228 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2229 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2230 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2231 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2233 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2234 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2235 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2236 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2237 | crt_file2=data_files/server4.crt \ |
| 2238 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2239 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2240 | 0 \ |
| 2241 | -c "Verifying peer X.509 certificate... ok" \ |
| 2242 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2243 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2244 | -s "key types: Opaque, Opaque" \ |
| 2245 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2246 | -S "error" \ |
| 2247 | -C "error" |
| 2248 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2249 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2252 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2253 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2254 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2255 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2256 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2257 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2258 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2259 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2260 | 0 \ |
| 2261 | -c "key type: Opaque" \ |
| 2262 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2263 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2264 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2265 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2266 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2267 | -S "error" \ |
| 2268 | -C "error" |
| 2269 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2270 | # Test using a RSA opaque private key for client/server authentication |
| 2271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2272 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2273 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2274 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2275 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2276 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2277 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2278 | "$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] | 2279 | 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] | 2280 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2281 | 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] | 2282 | 0 \ |
| 2283 | -c "key type: Opaque" \ |
| 2284 | -c "Verifying peer X.509 certificate... ok" \ |
| 2285 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2286 | -s "key types: Opaque, none" \ |
| 2287 | -s "Verifying peer X.509 certificate... ok" \ |
| 2288 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2289 | -S "error" \ |
| 2290 | -C "error" |
| 2291 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2293 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2294 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2295 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2296 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2297 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2298 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2299 | "$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] | 2300 | 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] | 2301 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2302 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2303 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2304 | 0 \ |
| 2305 | -c "key type: Opaque" \ |
| 2306 | -c "Verifying peer X.509 certificate... ok" \ |
| 2307 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2308 | -s "key types: Opaque, none" \ |
| 2309 | -s "Verifying peer X.509 certificate... ok" \ |
| 2310 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2311 | -S "error" \ |
| 2312 | -C "error" |
| 2313 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2314 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2315 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2316 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2317 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2318 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2319 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2320 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2321 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2322 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2323 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2324 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2325 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2326 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2328 | run_test_psa_force_curve "secp521r1" |
| 2329 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2330 | run_test_psa_force_curve "brainpoolP512r1" |
| 2331 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2332 | run_test_psa_force_curve "secp384r1" |
| 2333 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2334 | run_test_psa_force_curve "brainpoolP384r1" |
| 2335 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2336 | run_test_psa_force_curve "secp256r1" |
| 2337 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2338 | run_test_psa_force_curve "secp256k1" |
| 2339 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2340 | run_test_psa_force_curve "brainpoolP256r1" |
| 2341 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2342 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2343 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2344 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2345 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2346 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2347 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2348 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2349 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2351 | run_test_psa_force_curve "secp192r1" |
| 2352 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2353 | run_test_psa_force_curve "secp192k1" |
| 2354 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2355 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2358 | run_test "ServerHello contains gmt_unix_time" \ |
| 2359 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2360 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2361 | 0 \ |
| 2362 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2363 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2364 | |
| 2365 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2367 | run_test "Unique IV in GCM" \ |
| 2368 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2369 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2370 | 0 \ |
| 2371 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2372 | -U "IV used" |
| 2373 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2374 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2376 | run_test "Configuration-specific CRT verification callback" \ |
| 2377 | "$P_SRV debug_level=3" \ |
| 2378 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2379 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2380 | -S "error" \ |
| 2381 | -c "Verify requested for " \ |
| 2382 | -c "Use configuration-specific verification callback" \ |
| 2383 | -C "Use context-specific verification callback" \ |
| 2384 | -C "error" |
| 2385 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2387 | run_test "Context-specific CRT verification callback" \ |
| 2388 | "$P_SRV debug_level=3" \ |
| 2389 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2390 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2391 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2392 | -c "Verify requested for " \ |
| 2393 | -c "Use context-specific verification callback" \ |
| 2394 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2395 | -C "error" |
| 2396 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2397 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2399 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2400 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2401 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2402 | 1 \ |
| 2403 | -c "The certificate is signed with an unacceptable hash" |
| 2404 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2406 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2407 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2408 | "$P_CLI allow_sha1=1" \ |
| 2409 | 0 |
| 2410 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2412 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2413 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2414 | "$P_CLI allow_sha1=0" \ |
| 2415 | 0 |
| 2416 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2418 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2419 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2420 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2421 | 1 \ |
| 2422 | -s "The certificate is signed with an unacceptable hash" |
| 2423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2425 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2426 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2427 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2428 | 0 |
| 2429 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2431 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2432 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2433 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2434 | 0 |
| 2435 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2436 | # Dummy TLS 1.3 test |
| 2437 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2438 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2441 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2442 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2443 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2444 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2445 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2446 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2447 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2451 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2452 | run_test "TLS 1.3: key exchange mode parameter passing: PSK-ephemeral only" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2453 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2454 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2455 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2456 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2460 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2461 | run_test "TLS 1.3: key exchange mode parameter passing: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 2462 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2463 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2464 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2465 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2468 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2469 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2470 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2471 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2472 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2473 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2474 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2478 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2479 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2480 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2481 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2482 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2483 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2486 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2487 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2488 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2489 | "$P_SRV tls13_kex_modes=all" \ |
| 2490 | "$P_CLI tls13_kex_modes=all" \ |
| 2491 | 0 |
| 2492 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2493 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2495 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2496 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2497 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2498 | 0 \ |
| 2499 | -c "next record in same datagram" \ |
| 2500 | -s "next record in same datagram" |
| 2501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2503 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2504 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2505 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2506 | 0 \ |
| 2507 | -s "next record in same datagram" \ |
| 2508 | -C "next record in same datagram" |
| 2509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2511 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2512 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2513 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2514 | 0 \ |
| 2515 | -S "next record in same datagram" \ |
| 2516 | -c "next record in same datagram" |
| 2517 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2519 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2520 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2521 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2522 | 0 \ |
| 2523 | -S "next record in same datagram" \ |
| 2524 | -C "next record in same datagram" |
| 2525 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2526 | # Tests for Context serialization |
| 2527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2530 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2531 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2532 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2533 | 0 \ |
| 2534 | -c "Deserializing connection..." \ |
| 2535 | -S "Deserializing connection..." |
| 2536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2539 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2540 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2541 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2542 | 0 \ |
| 2543 | -c "Deserializing connection..." \ |
| 2544 | -S "Deserializing connection..." |
| 2545 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2548 | run_test "Context serialization, client serializes, GCM" \ |
| 2549 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2550 | "$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] | 2551 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2552 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2553 | -S "Deserializing connection..." |
| 2554 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2557 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2558 | run_test "Context serialization, client serializes, with CID" \ |
| 2559 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2560 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2561 | 0 \ |
| 2562 | -c "Deserializing connection..." \ |
| 2563 | -S "Deserializing connection..." |
| 2564 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2565 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2566 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2567 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2568 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2569 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2570 | 0 \ |
| 2571 | -C "Deserializing connection..." \ |
| 2572 | -s "Deserializing connection..." |
| 2573 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2575 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2576 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2577 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2578 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2579 | 0 \ |
| 2580 | -C "Deserializing connection..." \ |
| 2581 | -s "Deserializing connection..." |
| 2582 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2584 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2585 | run_test "Context serialization, server serializes, GCM" \ |
| 2586 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2587 | "$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] | 2588 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2589 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2590 | -s "Deserializing connection..." |
| 2591 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2594 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2595 | run_test "Context serialization, server serializes, with CID" \ |
| 2596 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2597 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2598 | 0 \ |
| 2599 | -C "Deserializing connection..." \ |
| 2600 | -s "Deserializing connection..." |
| 2601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2603 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2604 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2605 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2606 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2607 | 0 \ |
| 2608 | -c "Deserializing connection..." \ |
| 2609 | -s "Deserializing connection..." |
| 2610 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2613 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2614 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2615 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2616 | 0 \ |
| 2617 | -c "Deserializing connection..." \ |
| 2618 | -s "Deserializing connection..." |
| 2619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2622 | run_test "Context serialization, both serialize, GCM" \ |
| 2623 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2624 | "$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] | 2625 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2626 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2627 | -s "Deserializing connection..." |
| 2628 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2630 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2632 | run_test "Context serialization, both serialize, with CID" \ |
| 2633 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2634 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2635 | 0 \ |
| 2636 | -c "Deserializing connection..." \ |
| 2637 | -s "Deserializing connection..." |
| 2638 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2641 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2642 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2643 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2644 | 0 \ |
| 2645 | -c "Deserializing connection..." \ |
| 2646 | -S "Deserializing connection..." |
| 2647 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2649 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2650 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2651 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2652 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2653 | 0 \ |
| 2654 | -c "Deserializing connection..." \ |
| 2655 | -S "Deserializing connection..." |
| 2656 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2658 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2659 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2660 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2661 | "$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] | 2662 | 0 \ |
| 2663 | -c "Deserializing connection..." \ |
| 2664 | -S "Deserializing connection..." |
| 2665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2668 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2669 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2670 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2671 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2672 | 0 \ |
| 2673 | -c "Deserializing connection..." \ |
| 2674 | -S "Deserializing connection..." |
| 2675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2678 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2679 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2680 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2681 | 0 \ |
| 2682 | -C "Deserializing connection..." \ |
| 2683 | -s "Deserializing connection..." |
| 2684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2687 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2688 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2689 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2690 | 0 \ |
| 2691 | -C "Deserializing connection..." \ |
| 2692 | -s "Deserializing connection..." |
| 2693 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2696 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2697 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2698 | "$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] | 2699 | 0 \ |
| 2700 | -C "Deserializing connection..." \ |
| 2701 | -s "Deserializing connection..." |
| 2702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2705 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2706 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2707 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2708 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2709 | 0 \ |
| 2710 | -C "Deserializing connection..." \ |
| 2711 | -s "Deserializing connection..." |
| 2712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2714 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2715 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2716 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2717 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2718 | 0 \ |
| 2719 | -c "Deserializing connection..." \ |
| 2720 | -s "Deserializing connection..." |
| 2721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2723 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2724 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2725 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2726 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2727 | 0 \ |
| 2728 | -c "Deserializing connection..." \ |
| 2729 | -s "Deserializing connection..." |
| 2730 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2732 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2733 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2734 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2735 | "$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] | 2736 | 0 \ |
| 2737 | -c "Deserializing connection..." \ |
| 2738 | -s "Deserializing connection..." |
| 2739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2741 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2742 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2743 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2744 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2745 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2746 | 0 \ |
| 2747 | -c "Deserializing connection..." \ |
| 2748 | -s "Deserializing connection..." |
| 2749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2751 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2752 | run_test "Saving the serialized context to a file" \ |
| 2753 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2754 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2755 | 0 \ |
| 2756 | -s "Save serialized context to a file... ok" \ |
| 2757 | -c "Save serialized context to a file... ok" |
| 2758 | rm -f context_srv.txt |
| 2759 | rm -f context_cli.txt |
| 2760 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2761 | # Tests for DTLS Connection ID extension |
| 2762 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2763 | # So far, the CID API isn't implemented, so we can't |
| 2764 | # grep for output witnessing its use. This needs to be |
| 2765 | # changed once the CID extension is implemented. |
| 2766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2768 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2769 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2770 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2771 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2772 | 0 \ |
| 2773 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2774 | -s "found CID extension" \ |
| 2775 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2776 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2777 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2778 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2779 | -C "found CID extension" \ |
| 2780 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2781 | -C "Copy CIDs into SSL transform" \ |
| 2782 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2785 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2786 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2787 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2788 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2789 | 0 \ |
| 2790 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2791 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2792 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2793 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2794 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2795 | -C "found CID extension" \ |
| 2796 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2797 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2798 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2799 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2801 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2802 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2803 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2804 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2805 | 0 \ |
| 2806 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2807 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2808 | -c "client hello, adding CID extension" \ |
| 2809 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2810 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2811 | -s "server hello, adding CID extension" \ |
| 2812 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2813 | -c "Use of CID extension negotiated" \ |
| 2814 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2815 | -c "Copy CIDs into SSL transform" \ |
| 2816 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2817 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2818 | -s "Use of Connection ID has been negotiated" \ |
| 2819 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2820 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2822 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2823 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2824 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2826 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2827 | 0 \ |
| 2828 | -c "Enable use of CID extension." \ |
| 2829 | -s "Enable use of CID extension." \ |
| 2830 | -c "client hello, adding CID extension" \ |
| 2831 | -s "found CID extension" \ |
| 2832 | -s "Use of CID extension negotiated" \ |
| 2833 | -s "server hello, adding CID extension" \ |
| 2834 | -c "found CID extension" \ |
| 2835 | -c "Use of CID extension negotiated" \ |
| 2836 | -s "Copy CIDs into SSL transform" \ |
| 2837 | -c "Copy CIDs into SSL transform" \ |
| 2838 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2839 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2840 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2841 | -c "Use of Connection ID has been negotiated" \ |
| 2842 | -c "ignoring unexpected CID" \ |
| 2843 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2846 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2847 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2848 | -p "$P_PXY mtu=800" \ |
| 2849 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2850 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2851 | 0 \ |
| 2852 | -c "Enable use of CID extension." \ |
| 2853 | -s "Enable use of CID extension." \ |
| 2854 | -c "client hello, adding CID extension" \ |
| 2855 | -s "found CID extension" \ |
| 2856 | -s "Use of CID extension negotiated" \ |
| 2857 | -s "server hello, adding CID extension" \ |
| 2858 | -c "found CID extension" \ |
| 2859 | -c "Use of CID extension negotiated" \ |
| 2860 | -s "Copy CIDs into SSL transform" \ |
| 2861 | -c "Copy CIDs into SSL transform" \ |
| 2862 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2863 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2864 | -s "Use of Connection ID has been negotiated" \ |
| 2865 | -c "Use of Connection ID has been negotiated" |
| 2866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2869 | 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] | 2870 | -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] | 2871 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2872 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2873 | 0 \ |
| 2874 | -c "Enable use of CID extension." \ |
| 2875 | -s "Enable use of CID extension." \ |
| 2876 | -c "client hello, adding CID extension" \ |
| 2877 | -s "found CID extension" \ |
| 2878 | -s "Use of CID extension negotiated" \ |
| 2879 | -s "server hello, adding CID extension" \ |
| 2880 | -c "found CID extension" \ |
| 2881 | -c "Use of CID extension negotiated" \ |
| 2882 | -s "Copy CIDs into SSL transform" \ |
| 2883 | -c "Copy CIDs into SSL transform" \ |
| 2884 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2885 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2886 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2887 | -c "Use of Connection ID has been negotiated" \ |
| 2888 | -c "ignoring unexpected CID" \ |
| 2889 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2890 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2893 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2894 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2895 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2896 | 0 \ |
| 2897 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2898 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2899 | -c "client hello, adding CID extension" \ |
| 2900 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2901 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2902 | -s "server hello, adding CID extension" \ |
| 2903 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2904 | -c "Use of CID extension negotiated" \ |
| 2905 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2906 | -c "Copy CIDs into SSL transform" \ |
| 2907 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2908 | -s "Peer CID (length 0 Bytes):" \ |
| 2909 | -s "Use of Connection ID has been negotiated" \ |
| 2910 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2911 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2913 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2914 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2915 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2916 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2917 | 0 \ |
| 2918 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2919 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2920 | -c "client hello, adding CID extension" \ |
| 2921 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2922 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2923 | -s "server hello, adding CID extension" \ |
| 2924 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2925 | -c "Use of CID extension negotiated" \ |
| 2926 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2927 | -c "Copy CIDs into SSL transform" \ |
| 2928 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2929 | -c "Peer CID (length 0 Bytes):" \ |
| 2930 | -s "Use of Connection ID has been negotiated" \ |
| 2931 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2932 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2934 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2935 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2936 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2937 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2938 | 0 \ |
| 2939 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2940 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2941 | -c "client hello, adding CID extension" \ |
| 2942 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2943 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2944 | -s "server hello, adding CID extension" \ |
| 2945 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2946 | -c "Use of CID extension negotiated" \ |
| 2947 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2948 | -c "Copy CIDs into SSL transform" \ |
| 2949 | -S "Use of Connection ID has been negotiated" \ |
| 2950 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 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+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2955 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2956 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2957 | 0 \ |
| 2958 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2959 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2960 | -c "client hello, adding CID extension" \ |
| 2961 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2962 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2963 | -s "server hello, adding CID extension" \ |
| 2964 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2965 | -c "Use of CID extension negotiated" \ |
| 2966 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2967 | -c "Copy CIDs into SSL transform" \ |
| 2968 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2969 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2970 | -s "Use of Connection ID has been negotiated" \ |
| 2971 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2974 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2975 | 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] | 2976 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2977 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2978 | 0 \ |
| 2979 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2980 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2981 | -c "client hello, adding CID extension" \ |
| 2982 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2983 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2984 | -s "server hello, adding CID extension" \ |
| 2985 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2986 | -c "Use of CID extension negotiated" \ |
| 2987 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2988 | -c "Copy CIDs into SSL transform" \ |
| 2989 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2990 | -s "Peer CID (length 0 Bytes):" \ |
| 2991 | -s "Use of Connection ID has been negotiated" \ |
| 2992 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2993 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2996 | 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] | 2997 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2998 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2999 | 0 \ |
| 3000 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3001 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3002 | -c "client hello, adding CID extension" \ |
| 3003 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3004 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3005 | -s "server hello, adding CID extension" \ |
| 3006 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3007 | -c "Use of CID extension negotiated" \ |
| 3008 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3009 | -c "Copy CIDs into SSL transform" \ |
| 3010 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3011 | -c "Peer CID (length 0 Bytes):" \ |
| 3012 | -s "Use of Connection ID has been negotiated" \ |
| 3013 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3014 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3017 | 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] | 3018 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3019 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3020 | 0 \ |
| 3021 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3022 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3023 | -c "client hello, adding CID extension" \ |
| 3024 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3025 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3026 | -s "server hello, adding CID extension" \ |
| 3027 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3028 | -c "Use of CID extension negotiated" \ |
| 3029 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3030 | -c "Copy CIDs into SSL transform" \ |
| 3031 | -S "Use of Connection ID has been negotiated" \ |
| 3032 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3033 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3036 | 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] | 3037 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3038 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3039 | 0 \ |
| 3040 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3041 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3042 | -c "client hello, adding CID extension" \ |
| 3043 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3044 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3045 | -s "server hello, adding CID extension" \ |
| 3046 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3047 | -c "Use of CID extension negotiated" \ |
| 3048 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3049 | -c "Copy CIDs into SSL transform" \ |
| 3050 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3051 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3052 | -s "Use of Connection ID has been negotiated" \ |
| 3053 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3054 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3056 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3057 | 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] | 3058 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3059 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3060 | 0 \ |
| 3061 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3062 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3063 | -c "client hello, adding CID extension" \ |
| 3064 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3065 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3066 | -s "server hello, adding CID extension" \ |
| 3067 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3068 | -c "Use of CID extension negotiated" \ |
| 3069 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3070 | -c "Copy CIDs into SSL transform" \ |
| 3071 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3072 | -s "Peer CID (length 0 Bytes):" \ |
| 3073 | -s "Use of Connection ID has been negotiated" \ |
| 3074 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +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, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3079 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3080 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 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 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3093 | -c "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, Cli+Srv CID empty, AES-128-CBC" \ |
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 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 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 | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3112 | -c "Copy CIDs into SSL transform" \ |
| 3113 | -S "Use of Connection ID has been negotiated" \ |
| 3114 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3117 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3118 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3119 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3120 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3121 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3122 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3123 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3124 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3125 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3126 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3127 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3128 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3129 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3130 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3131 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3134 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3135 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3136 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3137 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3138 | 0 \ |
| 3139 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3140 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3141 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3142 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3143 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3144 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3145 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3146 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3147 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3149 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3151 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3152 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3153 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3154 | 0 \ |
| 3155 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3156 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3157 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3158 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3159 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3160 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3161 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3162 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3166 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3167 | 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] | 3168 | -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] | 3169 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3170 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3171 | 0 \ |
| 3172 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3173 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3174 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3175 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3176 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3177 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3178 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3179 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3180 | -c "ignoring unexpected CID" \ |
| 3181 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3186 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3187 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3188 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3189 | 0 \ |
| 3190 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3191 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3192 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3193 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3194 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3195 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3196 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3197 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3200 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3201 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3202 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3203 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3204 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3205 | 0 \ |
| 3206 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3207 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3208 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3209 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3210 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3211 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3212 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3213 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3214 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3218 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3219 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3220 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3221 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3222 | 0 \ |
| 3223 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3224 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3225 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3226 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3227 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3228 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3229 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3230 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3231 | -c "ignoring unexpected CID" \ |
| 3232 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3233 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
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 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3237 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3238 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3239 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3240 | 0 \ |
| 3241 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3242 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3243 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3244 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3245 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3246 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3247 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3251 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3252 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3253 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3254 | 0 \ |
| 3255 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3256 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3257 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3258 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3259 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3260 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3263 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3264 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3265 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3266 | -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] | 3267 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3268 | "$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" \ |
| 3269 | 0 \ |
| 3270 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3271 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3272 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3273 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3274 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3275 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3276 | -c "ignoring unexpected CID" \ |
| 3277 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3278 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3280 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3282 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3283 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3284 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3285 | 0 \ |
| 3286 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3287 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3288 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3289 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3290 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3291 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3292 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3293 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3294 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3295 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3297 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3299 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3300 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3301 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3302 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3303 | 0 \ |
| 3304 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3305 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3306 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3307 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3308 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3309 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3310 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3311 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3312 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3313 | -c "ignoring unexpected CID" \ |
| 3314 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3315 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3318 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3319 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3320 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3321 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3322 | 0 \ |
| 3323 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3324 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3325 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3326 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3327 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3328 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3329 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3330 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3331 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3332 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3334 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3335 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3336 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3337 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3338 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3339 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3340 | 0 \ |
| 3341 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3342 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3343 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3344 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3345 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3346 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3347 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3348 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3349 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3350 | -c "ignoring unexpected CID" \ |
| 3351 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3352 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3353 | # 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] | 3354 | # tests check that the buffer contents are reallocated when the message is |
| 3355 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3358 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3359 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3360 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3361 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3362 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3363 | 0 \ |
| 3364 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3365 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3366 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3367 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3368 | -s "Reallocating in_buf" \ |
| 3369 | -s "Reallocating out_buf" |
| 3370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3373 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3374 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3375 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3376 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3377 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3378 | 0 \ |
| 3379 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3380 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3381 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3382 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3383 | -s "Reallocating in_buf" \ |
| 3384 | -s "Reallocating out_buf" |
| 3385 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3386 | # Tests for Encrypt-then-MAC extension |
| 3387 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3389 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3390 | "$P_SRV debug_level=3 \ |
| 3391 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3392 | "$P_CLI debug_level=3" \ |
| 3393 | 0 \ |
| 3394 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3395 | -s "found encrypt then mac extension" \ |
| 3396 | -s "server hello, adding encrypt then mac extension" \ |
| 3397 | -c "found encrypt_then_mac extension" \ |
| 3398 | -c "using encrypt then mac" \ |
| 3399 | -s "using encrypt then mac" |
| 3400 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3402 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3403 | "$P_SRV debug_level=3 etm=0 \ |
| 3404 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3405 | "$P_CLI debug_level=3 etm=1" \ |
| 3406 | 0 \ |
| 3407 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3408 | -s "found encrypt then mac extension" \ |
| 3409 | -S "server hello, adding encrypt then mac extension" \ |
| 3410 | -C "found encrypt_then_mac extension" \ |
| 3411 | -C "using encrypt then mac" \ |
| 3412 | -S "using encrypt then mac" |
| 3413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3415 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3416 | "$P_SRV debug_level=3 etm=1 \ |
| 3417 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3418 | "$P_CLI debug_level=3 etm=1" \ |
| 3419 | 0 \ |
| 3420 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3421 | -s "found encrypt then mac extension" \ |
| 3422 | -S "server hello, adding encrypt then mac extension" \ |
| 3423 | -C "found encrypt_then_mac extension" \ |
| 3424 | -C "using encrypt then mac" \ |
| 3425 | -S "using encrypt then mac" |
| 3426 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3428 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3429 | "$P_SRV debug_level=3 etm=1 \ |
| 3430 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3431 | "$P_CLI debug_level=3 etm=0" \ |
| 3432 | 0 \ |
| 3433 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3434 | -S "found encrypt then mac extension" \ |
| 3435 | -S "server hello, adding encrypt then mac extension" \ |
| 3436 | -C "found encrypt_then_mac extension" \ |
| 3437 | -C "using encrypt then mac" \ |
| 3438 | -S "using encrypt then mac" |
| 3439 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3440 | # Tests for Extended Master Secret extension |
| 3441 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3444 | run_test "Extended Master Secret: default" \ |
| 3445 | "$P_SRV debug_level=3" \ |
| 3446 | "$P_CLI debug_level=3" \ |
| 3447 | 0 \ |
| 3448 | -c "client hello, adding extended_master_secret extension" \ |
| 3449 | -s "found extended master secret extension" \ |
| 3450 | -s "server hello, adding extended master secret extension" \ |
| 3451 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3452 | -c "session hash for extended master secret" \ |
| 3453 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3454 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3457 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3458 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3459 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3460 | 0 \ |
| 3461 | -c "client hello, adding extended_master_secret extension" \ |
| 3462 | -s "found extended master secret extension" \ |
| 3463 | -S "server hello, adding extended master secret extension" \ |
| 3464 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3465 | -C "session hash for extended master secret" \ |
| 3466 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3467 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3470 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3471 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3472 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3473 | 0 \ |
| 3474 | -C "client hello, adding extended_master_secret extension" \ |
| 3475 | -S "found extended master secret extension" \ |
| 3476 | -S "server hello, adding extended master secret extension" \ |
| 3477 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3478 | -C "session hash for extended master secret" \ |
| 3479 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3480 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3481 | # Test sending and receiving empty application data records |
| 3482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3484 | run_test "Encrypt then MAC: empty application data record" \ |
| 3485 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3486 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3487 | 0 \ |
| 3488 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3489 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3490 | -c "0 bytes written in 1 fragments" |
| 3491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3493 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3494 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3495 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3496 | 0 \ |
| 3497 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3498 | -c "0 bytes written in 1 fragments" |
| 3499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3501 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3502 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3503 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3504 | 0 \ |
| 3505 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3506 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3507 | -c "0 bytes written in 1 fragments" |
| 3508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3510 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3511 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3512 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3513 | 0 \ |
| 3514 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3515 | -c "0 bytes written in 1 fragments" |
| 3516 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3517 | # Tests for CBC 1/n-1 record splitting |
| 3518 | |
| 3519 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3520 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3521 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3522 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3523 | 0 \ |
| 3524 | -s "Read from client: 123 bytes read" \ |
| 3525 | -S "Read from client: 1 bytes read" \ |
| 3526 | -S "122 bytes read" |
| 3527 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3528 | # Tests for Session Tickets |
| 3529 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3531 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3532 | "$P_SRV debug_level=3 tickets=1" \ |
| 3533 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3534 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3535 | -c "client hello, adding session ticket extension" \ |
| 3536 | -s "found session ticket extension" \ |
| 3537 | -s "server hello, adding session ticket extension" \ |
| 3538 | -c "found session_ticket extension" \ |
| 3539 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3540 | -S "session successfully restored from cache" \ |
| 3541 | -s "session successfully restored from ticket" \ |
| 3542 | -s "a session has been resumed" \ |
| 3543 | -c "a session has been resumed" |
| 3544 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3546 | run_test "Session resume using tickets: manual rotation" \ |
| 3547 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3548 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3549 | 0 \ |
| 3550 | -c "client hello, adding session ticket extension" \ |
| 3551 | -s "found session ticket extension" \ |
| 3552 | -s "server hello, adding session ticket extension" \ |
| 3553 | -c "found session_ticket extension" \ |
| 3554 | -c "parse new session ticket" \ |
| 3555 | -S "session successfully restored from cache" \ |
| 3556 | -s "session successfully restored from ticket" \ |
| 3557 | -s "a session has been resumed" \ |
| 3558 | -c "a session has been resumed" |
| 3559 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3561 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3562 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3563 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3564 | 0 \ |
| 3565 | -c "client hello, adding session ticket extension" \ |
| 3566 | -s "found session ticket extension" \ |
| 3567 | -s "server hello, adding session ticket extension" \ |
| 3568 | -c "found session_ticket extension" \ |
| 3569 | -c "parse new session ticket" \ |
| 3570 | -S "session successfully restored from cache" \ |
| 3571 | -s "session successfully restored from ticket" \ |
| 3572 | -s "a session has been resumed" \ |
| 3573 | -c "a session has been resumed" |
| 3574 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3576 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3577 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3578 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3579 | 0 \ |
| 3580 | -c "client hello, adding session ticket extension" \ |
| 3581 | -s "found session ticket extension" \ |
| 3582 | -s "server hello, adding session ticket extension" \ |
| 3583 | -c "found session_ticket extension" \ |
| 3584 | -c "parse new session ticket" \ |
| 3585 | -S "session successfully restored from cache" \ |
| 3586 | -S "session successfully restored from ticket" \ |
| 3587 | -S "a session has been resumed" \ |
| 3588 | -C "a session has been resumed" |
| 3589 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3591 | run_test "Session resume using tickets: session copy" \ |
| 3592 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3593 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3594 | 0 \ |
| 3595 | -c "client hello, adding session ticket extension" \ |
| 3596 | -s "found session ticket extension" \ |
| 3597 | -s "server hello, adding session ticket extension" \ |
| 3598 | -c "found session_ticket extension" \ |
| 3599 | -c "parse new session ticket" \ |
| 3600 | -S "session successfully restored from cache" \ |
| 3601 | -s "session successfully restored from ticket" \ |
| 3602 | -s "a session has been resumed" \ |
| 3603 | -c "a session has been resumed" |
| 3604 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3606 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3607 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3608 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3609 | 0 \ |
| 3610 | -c "client hello, adding session ticket extension" \ |
| 3611 | -c "found session_ticket extension" \ |
| 3612 | -c "parse new session ticket" \ |
| 3613 | -c "a session has been resumed" |
| 3614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3616 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3617 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3618 | "( $O_CLI -sess_out $SESSION; \ |
| 3619 | $O_CLI -sess_in $SESSION; \ |
| 3620 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3621 | 0 \ |
| 3622 | -s "found session ticket extension" \ |
| 3623 | -s "server hello, adding session ticket extension" \ |
| 3624 | -S "session successfully restored from cache" \ |
| 3625 | -s "session successfully restored from ticket" \ |
| 3626 | -s "a session has been resumed" |
| 3627 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3629 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3630 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3631 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3632 | 0 \ |
| 3633 | -c "client hello, adding session ticket extension" \ |
| 3634 | -s "found session ticket extension" \ |
| 3635 | -s "server hello, adding session ticket extension" \ |
| 3636 | -c "found session_ticket extension" \ |
| 3637 | -c "parse new session ticket" \ |
| 3638 | -S "session successfully restored from cache" \ |
| 3639 | -s "session successfully restored from ticket" \ |
| 3640 | -s "a session has been resumed" \ |
| 3641 | -c "a session has been resumed" |
| 3642 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3644 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3645 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3646 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3647 | 0 \ |
| 3648 | -c "client hello, adding session ticket extension" \ |
| 3649 | -s "found session ticket extension" \ |
| 3650 | -s "server hello, adding session ticket extension" \ |
| 3651 | -c "found session_ticket extension" \ |
| 3652 | -c "parse new session ticket" \ |
| 3653 | -S "session successfully restored from cache" \ |
| 3654 | -s "session successfully restored from ticket" \ |
| 3655 | -s "a session has been resumed" \ |
| 3656 | -c "a session has been resumed" |
| 3657 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3659 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3660 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3661 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3662 | 0 \ |
| 3663 | -c "client hello, adding session ticket extension" \ |
| 3664 | -s "found session ticket extension" \ |
| 3665 | -s "server hello, adding session ticket extension" \ |
| 3666 | -c "found session_ticket extension" \ |
| 3667 | -c "parse new session ticket" \ |
| 3668 | -S "session successfully restored from cache" \ |
| 3669 | -s "session successfully restored from ticket" \ |
| 3670 | -s "a session has been resumed" \ |
| 3671 | -c "a session has been resumed" |
| 3672 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3674 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3675 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3676 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3677 | 0 \ |
| 3678 | -c "client hello, adding session ticket extension" \ |
| 3679 | -s "found session ticket extension" \ |
| 3680 | -s "server hello, adding session ticket extension" \ |
| 3681 | -c "found session_ticket extension" \ |
| 3682 | -c "parse new session ticket" \ |
| 3683 | -S "session successfully restored from cache" \ |
| 3684 | -s "session successfully restored from ticket" \ |
| 3685 | -s "a session has been resumed" \ |
| 3686 | -c "a session has been resumed" |
| 3687 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3689 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3690 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3691 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3692 | 0 \ |
| 3693 | -c "client hello, adding session ticket extension" \ |
| 3694 | -s "found session ticket extension" \ |
| 3695 | -s "server hello, adding session ticket extension" \ |
| 3696 | -c "found session_ticket extension" \ |
| 3697 | -c "parse new session ticket" \ |
| 3698 | -S "session successfully restored from cache" \ |
| 3699 | -s "session successfully restored from ticket" \ |
| 3700 | -s "a session has been resumed" \ |
| 3701 | -c "a session has been resumed" |
| 3702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3704 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3705 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3706 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3707 | 0 \ |
| 3708 | -c "client hello, adding session ticket extension" \ |
| 3709 | -s "found session ticket extension" \ |
| 3710 | -s "server hello, adding session ticket extension" \ |
| 3711 | -c "found session_ticket extension" \ |
| 3712 | -c "parse new session ticket" \ |
| 3713 | -S "session successfully restored from cache" \ |
| 3714 | -s "session successfully restored from ticket" \ |
| 3715 | -s "a session has been resumed" \ |
| 3716 | -c "a session has been resumed" |
| 3717 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3719 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3720 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3721 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3722 | 0 \ |
| 3723 | -c "client hello, adding session ticket extension" \ |
| 3724 | -s "found session ticket extension" \ |
| 3725 | -s "server hello, adding session ticket extension" \ |
| 3726 | -c "found session_ticket extension" \ |
| 3727 | -c "parse new session ticket" \ |
| 3728 | -S "session successfully restored from cache" \ |
| 3729 | -s "session successfully restored from ticket" \ |
| 3730 | -s "a session has been resumed" \ |
| 3731 | -c "a session has been resumed" |
| 3732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3734 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3735 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3736 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3737 | 0 \ |
| 3738 | -c "client hello, adding session ticket extension" \ |
| 3739 | -s "found session ticket extension" \ |
| 3740 | -s "server hello, adding session ticket extension" \ |
| 3741 | -c "found session_ticket extension" \ |
| 3742 | -c "parse new session ticket" \ |
| 3743 | -S "session successfully restored from cache" \ |
| 3744 | -s "session successfully restored from ticket" \ |
| 3745 | -s "a session has been resumed" \ |
| 3746 | -c "a session has been resumed" |
| 3747 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3749 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3750 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3751 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3752 | 0 \ |
| 3753 | -c "client hello, adding session ticket extension" \ |
| 3754 | -s "found session ticket extension" \ |
| 3755 | -s "server hello, adding session ticket extension" \ |
| 3756 | -c "found session_ticket extension" \ |
| 3757 | -c "parse new session ticket" \ |
| 3758 | -S "session successfully restored from cache" \ |
| 3759 | -s "session successfully restored from ticket" \ |
| 3760 | -s "a session has been resumed" \ |
| 3761 | -c "a session has been resumed" |
| 3762 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3764 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3765 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3766 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3767 | 0 \ |
| 3768 | -c "client hello, adding session ticket extension" \ |
| 3769 | -s "found session ticket extension" \ |
| 3770 | -s "server hello, adding session ticket extension" \ |
| 3771 | -c "found session_ticket extension" \ |
| 3772 | -c "parse new session ticket" \ |
| 3773 | -S "session successfully restored from cache" \ |
| 3774 | -s "session successfully restored from ticket" \ |
| 3775 | -s "a session has been resumed" \ |
| 3776 | -c "a session has been resumed" |
| 3777 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3779 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3780 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3781 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3782 | 0 \ |
| 3783 | -c "client hello, adding session ticket extension" \ |
| 3784 | -s "found session ticket extension" \ |
| 3785 | -s "server hello, adding session ticket extension" \ |
| 3786 | -c "found session_ticket extension" \ |
| 3787 | -c "parse new session ticket" \ |
| 3788 | -S "session successfully restored from cache" \ |
| 3789 | -s "session successfully restored from ticket" \ |
| 3790 | -s "a session has been resumed" \ |
| 3791 | -c "a session has been resumed" |
| 3792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3794 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3795 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3796 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3797 | 0 \ |
| 3798 | -c "client hello, adding session ticket extension" \ |
| 3799 | -s "found session ticket extension" \ |
| 3800 | -s "server hello, adding session ticket extension" \ |
| 3801 | -c "found session_ticket extension" \ |
| 3802 | -c "parse new session ticket" \ |
| 3803 | -S "session successfully restored from cache" \ |
| 3804 | -s "session successfully restored from ticket" \ |
| 3805 | -s "a session has been resumed" \ |
| 3806 | -c "a session has been resumed" |
| 3807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3809 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3810 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3811 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3812 | 0 \ |
| 3813 | -c "client hello, adding session ticket extension" \ |
| 3814 | -s "found session ticket extension" \ |
| 3815 | -s "server hello, adding session ticket extension" \ |
| 3816 | -c "found session_ticket extension" \ |
| 3817 | -c "parse new session ticket" \ |
| 3818 | -S "session successfully restored from cache" \ |
| 3819 | -s "session successfully restored from ticket" \ |
| 3820 | -s "a session has been resumed" \ |
| 3821 | -c "a session has been resumed" |
| 3822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3824 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3825 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3826 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3827 | 0 \ |
| 3828 | -c "client hello, adding session ticket extension" \ |
| 3829 | -s "found session ticket extension" \ |
| 3830 | -s "server hello, adding session ticket extension" \ |
| 3831 | -c "found session_ticket extension" \ |
| 3832 | -c "parse new session ticket" \ |
| 3833 | -S "session successfully restored from cache" \ |
| 3834 | -s "session successfully restored from ticket" \ |
| 3835 | -s "a session has been resumed" \ |
| 3836 | -c "a session has been resumed" |
| 3837 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3839 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3840 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3841 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3842 | 0 \ |
| 3843 | -c "client hello, adding session ticket extension" \ |
| 3844 | -s "found session ticket extension" \ |
| 3845 | -s "server hello, adding session ticket extension" \ |
| 3846 | -c "found session_ticket extension" \ |
| 3847 | -c "parse new session ticket" \ |
| 3848 | -S "session successfully restored from cache" \ |
| 3849 | -s "session successfully restored from ticket" \ |
| 3850 | -s "a session has been resumed" \ |
| 3851 | -c "a session has been resumed" |
| 3852 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3853 | # Tests for Session Tickets with DTLS |
| 3854 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3856 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3857 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3858 | "$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] | 3859 | 0 \ |
| 3860 | -c "client hello, adding session ticket extension" \ |
| 3861 | -s "found session ticket extension" \ |
| 3862 | -s "server hello, adding session ticket extension" \ |
| 3863 | -c "found session_ticket extension" \ |
| 3864 | -c "parse new session ticket" \ |
| 3865 | -S "session successfully restored from cache" \ |
| 3866 | -s "session successfully restored from ticket" \ |
| 3867 | -s "a session has been resumed" \ |
| 3868 | -c "a session has been resumed" |
| 3869 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3871 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3872 | "$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] | 3873 | "$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] | 3874 | 0 \ |
| 3875 | -c "client hello, adding session ticket extension" \ |
| 3876 | -s "found session ticket extension" \ |
| 3877 | -s "server hello, adding session ticket extension" \ |
| 3878 | -c "found session_ticket extension" \ |
| 3879 | -c "parse new session ticket" \ |
| 3880 | -S "session successfully restored from cache" \ |
| 3881 | -s "session successfully restored from ticket" \ |
| 3882 | -s "a session has been resumed" \ |
| 3883 | -c "a session has been resumed" |
| 3884 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3886 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3887 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3888 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3889 | 0 \ |
| 3890 | -c "client hello, adding session ticket extension" \ |
| 3891 | -s "found session ticket extension" \ |
| 3892 | -s "server hello, adding session ticket extension" \ |
| 3893 | -c "found session_ticket extension" \ |
| 3894 | -c "parse new session ticket" \ |
| 3895 | -S "session successfully restored from cache" \ |
| 3896 | -S "session successfully restored from ticket" \ |
| 3897 | -S "a session has been resumed" \ |
| 3898 | -C "a session has been resumed" |
| 3899 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3901 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3902 | "$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] | 3903 | "$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] | 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 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3916 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3917 | "$O_SRV -dtls" \ |
| 3918 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3919 | 0 \ |
| 3920 | -c "client hello, adding session ticket extension" \ |
| 3921 | -c "found session_ticket extension" \ |
| 3922 | -c "parse new session ticket" \ |
| 3923 | -c "a session has been resumed" |
| 3924 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3925 | # 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] | 3926 | # 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] | 3927 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3929 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3930 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3931 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3932 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3933 | rm -f $SESSION )" \ |
| 3934 | 0 \ |
| 3935 | -s "found session ticket extension" \ |
| 3936 | -s "server hello, adding session ticket extension" \ |
| 3937 | -S "session successfully restored from cache" \ |
| 3938 | -s "session successfully restored from ticket" \ |
| 3939 | -s "a session has been resumed" |
| 3940 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3941 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3944 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3945 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3946 | "$P_SRV debug_level=3 tickets=0" \ |
| 3947 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3948 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3949 | -c "client hello, adding session ticket extension" \ |
| 3950 | -s "found session ticket extension" \ |
| 3951 | -S "server hello, adding session ticket extension" \ |
| 3952 | -C "found session_ticket extension" \ |
| 3953 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3954 | -s "session successfully restored from cache" \ |
| 3955 | -S "session successfully restored from ticket" \ |
| 3956 | -s "a session has been resumed" \ |
| 3957 | -c "a session has been resumed" |
| 3958 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3960 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3961 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3962 | "$P_SRV debug_level=3 tickets=1" \ |
| 3963 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3964 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3965 | -C "client hello, adding session ticket extension" \ |
| 3966 | -S "found session ticket extension" \ |
| 3967 | -S "server hello, adding session ticket extension" \ |
| 3968 | -C "found session_ticket extension" \ |
| 3969 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3970 | -s "session successfully restored from cache" \ |
| 3971 | -S "session successfully restored from ticket" \ |
| 3972 | -s "a session has been resumed" \ |
| 3973 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3974 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3976 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3977 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3978 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3979 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3980 | 0 \ |
| 3981 | -S "session successfully restored from cache" \ |
| 3982 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3983 | -S "a session has been resumed" \ |
| 3984 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3987 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3988 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3989 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3990 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3991 | 0 \ |
| 3992 | -s "session successfully restored from cache" \ |
| 3993 | -S "session successfully restored from ticket" \ |
| 3994 | -s "a session has been resumed" \ |
| 3995 | -c "a session has been resumed" |
| 3996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3998 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3999 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4000 | "$P_SRV debug_level=3 tickets=0" \ |
| 4001 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4002 | 0 \ |
| 4003 | -s "session successfully restored from cache" \ |
| 4004 | -S "session successfully restored from ticket" \ |
| 4005 | -s "a session has been resumed" \ |
| 4006 | -c "a session has been resumed" |
| 4007 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4009 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4010 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4011 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 4012 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4013 | 0 \ |
| 4014 | -S "session successfully restored from cache" \ |
| 4015 | -S "session successfully restored from ticket" \ |
| 4016 | -S "a session has been resumed" \ |
| 4017 | -C "a session has been resumed" |
| 4018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4020 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4021 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4022 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 4023 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -s "session successfully restored from cache" \ |
| 4026 | -S "session successfully restored from ticket" \ |
| 4027 | -s "a session has been resumed" \ |
| 4028 | -c "a session has been resumed" |
| 4029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4031 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4032 | run_test "Session resume using cache: session copy" \ |
| 4033 | "$P_SRV debug_level=3 tickets=0" \ |
| 4034 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4035 | 0 \ |
| 4036 | -s "session successfully restored from cache" \ |
| 4037 | -S "session successfully restored from ticket" \ |
| 4038 | -s "a session has been resumed" \ |
| 4039 | -c "a session has been resumed" |
| 4040 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4042 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4043 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4044 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4045 | "( $O_CLI -sess_out $SESSION; \ |
| 4046 | $O_CLI -sess_in $SESSION; \ |
| 4047 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4048 | 0 \ |
| 4049 | -s "found session ticket extension" \ |
| 4050 | -S "server hello, adding session ticket extension" \ |
| 4051 | -s "session successfully restored from cache" \ |
| 4052 | -S "session successfully restored from ticket" \ |
| 4053 | -s "a session has been resumed" |
| 4054 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4056 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4057 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4058 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4059 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4060 | 0 \ |
| 4061 | -C "found session_ticket extension" \ |
| 4062 | -C "parse new session ticket" \ |
| 4063 | -c "a session has been resumed" |
| 4064 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4065 | # Tests for Session resume and extensions |
| 4066 | |
| 4067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4068 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4069 | run_test "Session resume and connection ID" \ |
| 4070 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4071 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4072 | 0 \ |
| 4073 | -c "Enable use of CID extension." \ |
| 4074 | -s "Enable use of CID extension." \ |
| 4075 | -c "client hello, adding CID extension" \ |
| 4076 | -s "found CID extension" \ |
| 4077 | -s "Use of CID extension negotiated" \ |
| 4078 | -s "server hello, adding CID extension" \ |
| 4079 | -c "found CID extension" \ |
| 4080 | -c "Use of CID extension negotiated" \ |
| 4081 | -s "Copy CIDs into SSL transform" \ |
| 4082 | -c "Copy CIDs into SSL transform" \ |
| 4083 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4084 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4085 | -s "Use of Connection ID has been negotiated" \ |
| 4086 | -c "Use of Connection ID has been negotiated" |
| 4087 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4088 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4089 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4091 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4092 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4093 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4094 | "$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] | 4095 | 0 \ |
| 4096 | -c "client hello, adding session ticket extension" \ |
| 4097 | -s "found session ticket extension" \ |
| 4098 | -S "server hello, adding session ticket extension" \ |
| 4099 | -C "found session_ticket extension" \ |
| 4100 | -C "parse new session ticket" \ |
| 4101 | -s "session successfully restored from cache" \ |
| 4102 | -S "session successfully restored from ticket" \ |
| 4103 | -s "a session has been resumed" \ |
| 4104 | -c "a session has been resumed" |
| 4105 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4108 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4109 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4110 | "$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] | 4111 | 0 \ |
| 4112 | -C "client hello, adding session ticket extension" \ |
| 4113 | -S "found session ticket extension" \ |
| 4114 | -S "server hello, adding session ticket extension" \ |
| 4115 | -C "found session_ticket extension" \ |
| 4116 | -C "parse new session ticket" \ |
| 4117 | -s "session successfully restored from cache" \ |
| 4118 | -S "session successfully restored from ticket" \ |
| 4119 | -s "a session has been resumed" \ |
| 4120 | -c "a session has been resumed" |
| 4121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4123 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4124 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4125 | "$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] | 4126 | "$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] | 4127 | 0 \ |
| 4128 | -S "session successfully restored from cache" \ |
| 4129 | -S "session successfully restored from ticket" \ |
| 4130 | -S "a session has been resumed" \ |
| 4131 | -C "a session has been resumed" |
| 4132 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4134 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4135 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4136 | "$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] | 4137 | "$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] | 4138 | 0 \ |
| 4139 | -s "session successfully restored from cache" \ |
| 4140 | -S "session successfully restored from ticket" \ |
| 4141 | -s "a session has been resumed" \ |
| 4142 | -c "a session has been resumed" |
| 4143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4146 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4147 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4148 | "$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] | 4149 | 0 \ |
| 4150 | -s "session successfully restored from cache" \ |
| 4151 | -S "session successfully restored from ticket" \ |
| 4152 | -s "a session has been resumed" \ |
| 4153 | -c "a session has been resumed" |
| 4154 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4156 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4157 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4158 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4159 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4160 | 0 \ |
| 4161 | -S "session successfully restored from cache" \ |
| 4162 | -S "session successfully restored from ticket" \ |
| 4163 | -S "a session has been resumed" \ |
| 4164 | -C "a session has been resumed" |
| 4165 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4167 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4168 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4169 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4170 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4171 | 0 \ |
| 4172 | -s "session successfully restored from cache" \ |
| 4173 | -S "session successfully restored from ticket" \ |
| 4174 | -s "a session has been resumed" \ |
| 4175 | -c "a session has been resumed" |
| 4176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4179 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4180 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4181 | "$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] | 4182 | 0 \ |
| 4183 | -s "session successfully restored from cache" \ |
| 4184 | -S "session successfully restored from ticket" \ |
| 4185 | -s "a session has been resumed" \ |
| 4186 | -c "a session has been resumed" |
| 4187 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4188 | # 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] | 4189 | # 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] | 4190 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4192 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4193 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4194 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4195 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4196 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4197 | rm -f $SESSION )" \ |
| 4198 | 0 \ |
| 4199 | -s "found session ticket extension" \ |
| 4200 | -S "server hello, adding session ticket extension" \ |
| 4201 | -s "session successfully restored from cache" \ |
| 4202 | -S "session successfully restored from ticket" \ |
| 4203 | -s "a session has been resumed" |
| 4204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4206 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4207 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4208 | "$O_SRV -dtls" \ |
| 4209 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4210 | 0 \ |
| 4211 | -C "found session_ticket extension" \ |
| 4212 | -C "parse new session ticket" \ |
| 4213 | -c "a session has been resumed" |
| 4214 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4215 | # Tests for Max Fragment Length extension |
| 4216 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4219 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4220 | "$P_SRV debug_level=3" \ |
| 4221 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4222 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4223 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4224 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4225 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4226 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4227 | -C "client hello, adding max_fragment_length extension" \ |
| 4228 | -S "found max fragment length extension" \ |
| 4229 | -S "server hello, max_fragment_length extension" \ |
| 4230 | -C "found max_fragment_length extension" |
| 4231 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4232 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4234 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4235 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4236 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4237 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4238 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4239 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4240 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4241 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4242 | -C "client hello, adding max_fragment_length extension" \ |
| 4243 | -S "found max fragment length extension" \ |
| 4244 | -S "server hello, max_fragment_length extension" \ |
| 4245 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4246 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4247 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4248 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4249 | |
| 4250 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4252 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4253 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4254 | "$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] | 4255 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4256 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4257 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4258 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4259 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4260 | -C "client hello, adding max_fragment_length extension" \ |
| 4261 | -S "found max fragment length extension" \ |
| 4262 | -S "server hello, max_fragment_length extension" \ |
| 4263 | -C "found max_fragment_length extension" \ |
| 4264 | -c "fragment larger than.*maximum " |
| 4265 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4266 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4267 | # (session fragment length will be 16384 regardless of mbedtls |
| 4268 | # content length configuration.) |
| 4269 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4270 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4272 | run_test "Max fragment length: disabled, larger message" \ |
| 4273 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4274 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4275 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4276 | -C "Maximum incoming record payload length is 16384" \ |
| 4277 | -C "Maximum outgoing record payload length is 16384" \ |
| 4278 | -S "Maximum incoming record payload length is 16384" \ |
| 4279 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4280 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4281 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4282 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4283 | |
| 4284 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4286 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4287 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4288 | "$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] | 4289 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4290 | -C "Maximum incoming record payload length is 16384" \ |
| 4291 | -C "Maximum outgoing record payload length is 16384" \ |
| 4292 | -S "Maximum incoming record payload length is 16384" \ |
| 4293 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4294 | -c "fragment larger than.*maximum " |
| 4295 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4296 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4297 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4299 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4300 | "$P_SRV debug_level=3" \ |
| 4301 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4302 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4303 | -c "Maximum incoming record payload length is 4096" \ |
| 4304 | -c "Maximum outgoing record payload length is 4096" \ |
| 4305 | -s "Maximum incoming record payload length is 4096" \ |
| 4306 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4307 | -c "client hello, adding max_fragment_length extension" \ |
| 4308 | -s "found max fragment length extension" \ |
| 4309 | -s "server hello, max_fragment_length extension" \ |
| 4310 | -c "found max_fragment_length extension" |
| 4311 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4312 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4313 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4315 | run_test "Max fragment length: client 512, server 1024" \ |
| 4316 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4317 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4318 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4319 | -c "Maximum incoming record payload length is 512" \ |
| 4320 | -c "Maximum outgoing record payload length is 512" \ |
| 4321 | -s "Maximum incoming record payload length is 512" \ |
| 4322 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4323 | -c "client hello, adding max_fragment_length extension" \ |
| 4324 | -s "found max fragment length extension" \ |
| 4325 | -s "server hello, max_fragment_length extension" \ |
| 4326 | -c "found max_fragment_length extension" |
| 4327 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4328 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4329 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4331 | run_test "Max fragment length: client 512, server 2048" \ |
| 4332 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4333 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4334 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4335 | -c "Maximum incoming record payload length is 512" \ |
| 4336 | -c "Maximum outgoing record payload length is 512" \ |
| 4337 | -s "Maximum incoming record payload length is 512" \ |
| 4338 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4339 | -c "client hello, adding max_fragment_length extension" \ |
| 4340 | -s "found max fragment length extension" \ |
| 4341 | -s "server hello, max_fragment_length extension" \ |
| 4342 | -c "found max_fragment_length extension" |
| 4343 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4344 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4347 | run_test "Max fragment length: client 512, server 4096" \ |
| 4348 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4349 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4350 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4351 | -c "Maximum incoming record payload length is 512" \ |
| 4352 | -c "Maximum outgoing record payload length is 512" \ |
| 4353 | -s "Maximum incoming record payload length is 512" \ |
| 4354 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4355 | -c "client hello, adding max_fragment_length extension" \ |
| 4356 | -s "found max fragment length extension" \ |
| 4357 | -s "server hello, max_fragment_length extension" \ |
| 4358 | -c "found max_fragment_length extension" |
| 4359 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4360 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4361 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4362 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4363 | run_test "Max fragment length: client 1024, server 512" \ |
| 4364 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4365 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4366 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4367 | -c "Maximum incoming record payload length is 1024" \ |
| 4368 | -c "Maximum outgoing record payload length is 1024" \ |
| 4369 | -s "Maximum incoming record payload length is 1024" \ |
| 4370 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4371 | -c "client hello, adding max_fragment_length extension" \ |
| 4372 | -s "found max fragment length extension" \ |
| 4373 | -s "server hello, max_fragment_length extension" \ |
| 4374 | -c "found max_fragment_length extension" |
| 4375 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4376 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4379 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4380 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4381 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4382 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4383 | -c "Maximum incoming record payload length is 1024" \ |
| 4384 | -c "Maximum outgoing record payload length is 1024" \ |
| 4385 | -s "Maximum incoming record payload length is 1024" \ |
| 4386 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4387 | -c "client hello, adding max_fragment_length extension" \ |
| 4388 | -s "found max fragment length extension" \ |
| 4389 | -s "server hello, max_fragment_length extension" \ |
| 4390 | -c "found max_fragment_length extension" |
| 4391 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4392 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4393 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4395 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4396 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4397 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4398 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4399 | -c "Maximum incoming record payload length is 1024" \ |
| 4400 | -c "Maximum outgoing record payload length is 1024" \ |
| 4401 | -s "Maximum incoming record payload length is 1024" \ |
| 4402 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4403 | -c "client hello, adding max_fragment_length extension" \ |
| 4404 | -s "found max fragment length extension" \ |
| 4405 | -s "server hello, max_fragment_length extension" \ |
| 4406 | -c "found max_fragment_length extension" |
| 4407 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4408 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4409 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4411 | run_test "Max fragment length: client 2048, server 512" \ |
| 4412 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4413 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4414 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4415 | -c "Maximum incoming record payload length is 2048" \ |
| 4416 | -c "Maximum outgoing record payload length is 2048" \ |
| 4417 | -s "Maximum incoming record payload length is 2048" \ |
| 4418 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4419 | -c "client hello, adding max_fragment_length extension" \ |
| 4420 | -s "found max fragment length extension" \ |
| 4421 | -s "server hello, max_fragment_length extension" \ |
| 4422 | -c "found max_fragment_length extension" |
| 4423 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4424 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4427 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4428 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4429 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4430 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4431 | -c "Maximum incoming record payload length is 2048" \ |
| 4432 | -c "Maximum outgoing record payload length is 2048" \ |
| 4433 | -s "Maximum incoming record payload length is 2048" \ |
| 4434 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4435 | -c "client hello, adding max_fragment_length extension" \ |
| 4436 | -s "found max fragment length extension" \ |
| 4437 | -s "server hello, max_fragment_length extension" \ |
| 4438 | -c "found max_fragment_length extension" |
| 4439 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4440 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4441 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4443 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4444 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4445 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4446 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4447 | -c "Maximum incoming record payload length is 2048" \ |
| 4448 | -c "Maximum outgoing record payload length is 2048" \ |
| 4449 | -s "Maximum incoming record payload length is 2048" \ |
| 4450 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4451 | -c "client hello, adding max_fragment_length extension" \ |
| 4452 | -s "found max fragment length extension" \ |
| 4453 | -s "server hello, max_fragment_length extension" \ |
| 4454 | -c "found max_fragment_length extension" |
| 4455 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4456 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4457 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4459 | run_test "Max fragment length: client 4096, server 512" \ |
| 4460 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4461 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4462 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4463 | -c "Maximum incoming record payload length is 4096" \ |
| 4464 | -c "Maximum outgoing record payload length is 4096" \ |
| 4465 | -s "Maximum incoming record payload length is 4096" \ |
| 4466 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4467 | -c "client hello, adding max_fragment_length extension" \ |
| 4468 | -s "found max fragment length extension" \ |
| 4469 | -s "server hello, max_fragment_length extension" \ |
| 4470 | -c "found max_fragment_length extension" |
| 4471 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4472 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4473 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4475 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4476 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4477 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4478 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4479 | -c "Maximum incoming record payload length is 4096" \ |
| 4480 | -c "Maximum outgoing record payload length is 4096" \ |
| 4481 | -s "Maximum incoming record payload length is 4096" \ |
| 4482 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4483 | -c "client hello, adding max_fragment_length extension" \ |
| 4484 | -s "found max fragment length extension" \ |
| 4485 | -s "server hello, max_fragment_length extension" \ |
| 4486 | -c "found max_fragment_length extension" |
| 4487 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4488 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4489 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4491 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4492 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4493 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4494 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4495 | -c "Maximum incoming record payload length is 4096" \ |
| 4496 | -c "Maximum outgoing record payload length is 4096" \ |
| 4497 | -s "Maximum incoming record payload length is 4096" \ |
| 4498 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4499 | -c "client hello, adding max_fragment_length extension" \ |
| 4500 | -s "found max fragment length extension" \ |
| 4501 | -s "server hello, max_fragment_length extension" \ |
| 4502 | -c "found max_fragment_length extension" |
| 4503 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4504 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4505 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4507 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4508 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4509 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4510 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4511 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4512 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4513 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4514 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4515 | -C "client hello, adding max_fragment_length extension" \ |
| 4516 | -S "found max fragment length extension" \ |
| 4517 | -S "server hello, max_fragment_length extension" \ |
| 4518 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4519 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4520 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4521 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4522 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4524 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4525 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4526 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4527 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4528 | -c "Maximum incoming record payload length is 4096" \ |
| 4529 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4530 | -c "client hello, adding max_fragment_length extension" \ |
| 4531 | -c "found max_fragment_length extension" |
| 4532 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4533 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4536 | run_test "Max fragment length: client, message just fits" \ |
| 4537 | "$P_SRV debug_level=3" \ |
| 4538 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4539 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4540 | -c "Maximum incoming record payload length is 2048" \ |
| 4541 | -c "Maximum outgoing record payload length is 2048" \ |
| 4542 | -s "Maximum incoming record payload length is 2048" \ |
| 4543 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4544 | -c "client hello, adding max_fragment_length extension" \ |
| 4545 | -s "found max fragment length extension" \ |
| 4546 | -s "server hello, max_fragment_length extension" \ |
| 4547 | -c "found max_fragment_length extension" \ |
| 4548 | -c "2048 bytes written in 1 fragments" \ |
| 4549 | -s "2048 bytes read" |
| 4550 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4551 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4554 | run_test "Max fragment length: client, larger message" \ |
| 4555 | "$P_SRV debug_level=3" \ |
| 4556 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4557 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4558 | -c "Maximum incoming record payload length is 2048" \ |
| 4559 | -c "Maximum outgoing record payload length is 2048" \ |
| 4560 | -s "Maximum incoming record payload length is 2048" \ |
| 4561 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4562 | -c "client hello, adding max_fragment_length extension" \ |
| 4563 | -s "found max fragment length extension" \ |
| 4564 | -s "server hello, max_fragment_length extension" \ |
| 4565 | -c "found max_fragment_length extension" \ |
| 4566 | -c "2345 bytes written in 2 fragments" \ |
| 4567 | -s "2048 bytes read" \ |
| 4568 | -s "297 bytes read" |
| 4569 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4570 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4571 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4573 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4574 | "$P_SRV debug_level=3 dtls=1" \ |
| 4575 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4576 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4577 | -c "Maximum incoming record payload length is 2048" \ |
| 4578 | -c "Maximum outgoing record payload length is 2048" \ |
| 4579 | -s "Maximum incoming record payload length is 2048" \ |
| 4580 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4581 | -c "client hello, adding max_fragment_length extension" \ |
| 4582 | -s "found max fragment length extension" \ |
| 4583 | -s "server hello, max_fragment_length extension" \ |
| 4584 | -c "found max_fragment_length extension" \ |
| 4585 | -c "fragment larger than.*maximum" |
| 4586 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4587 | # Tests for renegotiation |
| 4588 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4589 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4592 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4593 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4594 | 0 \ |
| 4595 | -C "client hello, adding renegotiation extension" \ |
| 4596 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4597 | -S "found renegotiation extension" \ |
| 4598 | -s "server hello, secure renegotiation extension" \ |
| 4599 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4600 | -C "=> renegotiate" \ |
| 4601 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4602 | -S "write hello request" |
| 4603 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4604 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4606 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4607 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4608 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4609 | 0 \ |
| 4610 | -c "client hello, adding renegotiation extension" \ |
| 4611 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4612 | -s "found renegotiation extension" \ |
| 4613 | -s "server hello, secure renegotiation extension" \ |
| 4614 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4615 | -c "=> renegotiate" \ |
| 4616 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4617 | -S "write hello request" |
| 4618 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4619 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4621 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4622 | "$P_SRV 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] | 4623 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4624 | 0 \ |
| 4625 | -c "client hello, adding renegotiation extension" \ |
| 4626 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4627 | -s "found renegotiation extension" \ |
| 4628 | -s "server hello, secure renegotiation extension" \ |
| 4629 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4630 | -c "=> renegotiate" \ |
| 4631 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4632 | -s "write hello request" |
| 4633 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4634 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4635 | # 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] | 4636 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4637 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4639 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4640 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4641 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4642 | 0 \ |
| 4643 | -c "client hello, adding renegotiation extension" \ |
| 4644 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4645 | -s "found renegotiation extension" \ |
| 4646 | -s "server hello, secure renegotiation extension" \ |
| 4647 | -c "found renegotiation extension" \ |
| 4648 | -c "=> renegotiate" \ |
| 4649 | -s "=> renegotiate" \ |
| 4650 | -S "write hello request" \ |
| 4651 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4652 | |
| 4653 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4654 | # 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] | 4655 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4658 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4659 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4660 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4661 | 0 \ |
| 4662 | -c "client hello, adding renegotiation extension" \ |
| 4663 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4664 | -s "found renegotiation extension" \ |
| 4665 | -s "server hello, secure renegotiation extension" \ |
| 4666 | -c "found renegotiation extension" \ |
| 4667 | -c "=> renegotiate" \ |
| 4668 | -s "=> renegotiate" \ |
| 4669 | -s "write hello request" \ |
| 4670 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4671 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4674 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4675 | "$P_SRV 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] | 4676 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4677 | 0 \ |
| 4678 | -c "client hello, adding renegotiation extension" \ |
| 4679 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4680 | -s "found renegotiation extension" \ |
| 4681 | -s "server hello, secure renegotiation extension" \ |
| 4682 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4683 | -c "=> renegotiate" \ |
| 4684 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4685 | -s "write hello request" |
| 4686 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4687 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4688 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4689 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4691 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4692 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4693 | "$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" \ |
| 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 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [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 "client hello, adding renegotiation extension" \ |
| 4704 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4705 | -s "found renegotiation extension" \ |
| 4706 | -s "server hello, secure renegotiation extension" \ |
| 4707 | -c "found renegotiation extension" \ |
| 4708 | -c "=> renegotiate" \ |
| 4709 | -s "=> renegotiate" \ |
| 4710 | -s "write hello request" |
| 4711 | |
| 4712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4714 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4715 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4716 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4717 | 1 \ |
| 4718 | -c "client hello, adding renegotiation extension" \ |
| 4719 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4720 | -S "found renegotiation extension" \ |
| 4721 | -s "server hello, secure renegotiation extension" \ |
| 4722 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4723 | -c "=> renegotiate" \ |
| 4724 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4725 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4726 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4727 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4728 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4731 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4732 | "$P_SRV 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] | 4733 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4734 | 0 \ |
| 4735 | -C "client hello, adding renegotiation extension" \ |
| 4736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4737 | -S "found renegotiation extension" \ |
| 4738 | -s "server hello, secure renegotiation extension" \ |
| 4739 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4740 | -C "=> renegotiate" \ |
| 4741 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4742 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4743 | -S "SSL - An unexpected message was received from our peer" \ |
| 4744 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4745 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4748 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4749 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4750 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4751 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4752 | 0 \ |
| 4753 | -C "client hello, adding renegotiation extension" \ |
| 4754 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4755 | -S "found renegotiation extension" \ |
| 4756 | -s "server hello, secure renegotiation extension" \ |
| 4757 | -c "found renegotiation extension" \ |
| 4758 | -C "=> renegotiate" \ |
| 4759 | -S "=> renegotiate" \ |
| 4760 | -s "write hello request" \ |
| 4761 | -S "SSL - An unexpected message was received from our peer" \ |
| 4762 | -S "failed" |
| 4763 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4764 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4767 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4768 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4769 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4770 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4771 | 0 \ |
| 4772 | -C "client hello, adding renegotiation extension" \ |
| 4773 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4774 | -S "found renegotiation extension" \ |
| 4775 | -s "server hello, secure renegotiation extension" \ |
| 4776 | -c "found renegotiation extension" \ |
| 4777 | -C "=> renegotiate" \ |
| 4778 | -S "=> renegotiate" \ |
| 4779 | -s "write hello request" \ |
| 4780 | -S "SSL - An unexpected message was received from our peer" \ |
| 4781 | -S "failed" |
| 4782 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4783 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4785 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4786 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4787 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4788 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4789 | 0 \ |
| 4790 | -C "client hello, adding renegotiation extension" \ |
| 4791 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4792 | -S "found renegotiation extension" \ |
| 4793 | -s "server hello, secure renegotiation extension" \ |
| 4794 | -c "found renegotiation extension" \ |
| 4795 | -C "=> renegotiate" \ |
| 4796 | -S "=> renegotiate" \ |
| 4797 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4798 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4799 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4802 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4803 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4804 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4805 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4806 | 0 \ |
| 4807 | -c "client hello, adding renegotiation extension" \ |
| 4808 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4809 | -s "found renegotiation extension" \ |
| 4810 | -s "server hello, secure renegotiation extension" \ |
| 4811 | -c "found renegotiation extension" \ |
| 4812 | -c "=> renegotiate" \ |
| 4813 | -s "=> renegotiate" \ |
| 4814 | -s "write hello request" \ |
| 4815 | -S "SSL - An unexpected message was received from our peer" \ |
| 4816 | -S "failed" |
| 4817 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4819 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4820 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4821 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4822 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4823 | 0 \ |
| 4824 | -C "client hello, adding renegotiation extension" \ |
| 4825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4826 | -S "found renegotiation extension" \ |
| 4827 | -s "server hello, secure renegotiation extension" \ |
| 4828 | -c "found renegotiation extension" \ |
| 4829 | -S "record counter limit reached: renegotiate" \ |
| 4830 | -C "=> renegotiate" \ |
| 4831 | -S "=> renegotiate" \ |
| 4832 | -S "write hello request" \ |
| 4833 | -S "SSL - An unexpected message was received from our peer" \ |
| 4834 | -S "failed" |
| 4835 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4836 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4837 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4839 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4840 | "$P_SRV 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] | 4841 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +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" \ |
| 4848 | -s "record counter limit reached: renegotiate" \ |
| 4849 | -c "=> renegotiate" \ |
| 4850 | -s "=> renegotiate" \ |
| 4851 | -s "write hello request" \ |
| 4852 | -S "SSL - An unexpected message was received from our peer" \ |
| 4853 | -S "failed" |
| 4854 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4855 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4857 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4858 | "$P_SRV 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] | 4859 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4860 | 0 \ |
| 4861 | -c "client hello, adding renegotiation extension" \ |
| 4862 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4863 | -s "found renegotiation extension" \ |
| 4864 | -s "server hello, secure renegotiation extension" \ |
| 4865 | -c "found renegotiation extension" \ |
| 4866 | -s "record counter limit reached: renegotiate" \ |
| 4867 | -c "=> renegotiate" \ |
| 4868 | -s "=> renegotiate" \ |
| 4869 | -s "write hello request" \ |
| 4870 | -S "SSL - An unexpected message was received from our peer" \ |
| 4871 | -S "failed" |
| 4872 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4873 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4875 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4876 | "$P_SRV 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] | 4877 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4878 | 0 \ |
| 4879 | -C "client hello, adding renegotiation extension" \ |
| 4880 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4881 | -S "found renegotiation extension" \ |
| 4882 | -s "server hello, secure renegotiation extension" \ |
| 4883 | -c "found renegotiation extension" \ |
| 4884 | -S "record counter limit reached: renegotiate" \ |
| 4885 | -C "=> renegotiate" \ |
| 4886 | -S "=> renegotiate" \ |
| 4887 | -S "write hello request" \ |
| 4888 | -S "SSL - An unexpected message was received from our peer" \ |
| 4889 | -S "failed" |
| 4890 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4891 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4893 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4894 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4895 | "$P_CLI 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] | 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" \ |
| 4902 | -c "=> renegotiate" \ |
| 4903 | -s "=> renegotiate" \ |
| 4904 | -S "write hello request" |
| 4905 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4906 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4908 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4909 | "$P_SRV 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] | 4910 | "$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] | 4911 | 0 \ |
| 4912 | -c "client hello, adding renegotiation extension" \ |
| 4913 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4914 | -s "found renegotiation extension" \ |
| 4915 | -s "server hello, secure renegotiation extension" \ |
| 4916 | -c "found renegotiation extension" \ |
| 4917 | -c "=> renegotiate" \ |
| 4918 | -s "=> renegotiate" \ |
| 4919 | -s "write hello request" |
| 4920 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4921 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4923 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4924 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4925 | "$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] | 4926 | 0 \ |
| 4927 | -c "client hello, adding renegotiation extension" \ |
| 4928 | -c "found renegotiation extension" \ |
| 4929 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4930 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4931 | -C "error" \ |
| 4932 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4933 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4934 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4935 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4937 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4938 | "$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] | 4939 | "$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] | 4940 | 0 \ |
| 4941 | -c "client hello, adding renegotiation extension" \ |
| 4942 | -c "found renegotiation extension" \ |
| 4943 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4944 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4945 | -C "error" \ |
| 4946 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4947 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4948 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4949 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4951 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4952 | "$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] | 4953 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4954 | 1 \ |
| 4955 | -c "client hello, adding renegotiation extension" \ |
| 4956 | -C "found renegotiation extension" \ |
| 4957 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4958 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4959 | -c "error" \ |
| 4960 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4961 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4962 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4965 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4966 | "$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] | 4967 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4968 | allow_legacy=0" \ |
| 4969 | 1 \ |
| 4970 | -c "client hello, adding renegotiation extension" \ |
| 4971 | -C "found renegotiation extension" \ |
| 4972 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4973 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4974 | -c "error" \ |
| 4975 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4976 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4977 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4978 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4980 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4981 | "$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] | 4982 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4983 | allow_legacy=1" \ |
| 4984 | 0 \ |
| 4985 | -c "client hello, adding renegotiation extension" \ |
| 4986 | -C "found renegotiation extension" \ |
| 4987 | -c "=> renegotiate" \ |
| 4988 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4989 | -C "error" \ |
| 4990 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4991 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4994 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4995 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4996 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4997 | 0 \ |
| 4998 | -c "client hello, adding renegotiation extension" \ |
| 4999 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5000 | -s "found renegotiation extension" \ |
| 5001 | -s "server hello, secure renegotiation extension" \ |
| 5002 | -c "found renegotiation extension" \ |
| 5003 | -c "=> renegotiate" \ |
| 5004 | -s "=> renegotiate" \ |
| 5005 | -S "write hello request" |
| 5006 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5007 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5009 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5010 | "$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] | 5011 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5012 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5013 | 0 \ |
| 5014 | -c "client hello, adding renegotiation extension" \ |
| 5015 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5016 | -s "found renegotiation extension" \ |
| 5017 | -s "server hello, secure renegotiation extension" \ |
| 5018 | -c "found renegotiation extension" \ |
| 5019 | -c "=> renegotiate" \ |
| 5020 | -s "=> renegotiate" \ |
| 5021 | -s "write hello request" |
| 5022 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5023 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5025 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5026 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5027 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5028 | 0 \ |
| 5029 | -c "client hello, adding renegotiation extension" \ |
| 5030 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5031 | -s "found renegotiation extension" \ |
| 5032 | -s "server hello, secure renegotiation extension" \ |
| 5033 | -s "record counter limit reached: renegotiate" \ |
| 5034 | -c "=> renegotiate" \ |
| 5035 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5036 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5037 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5038 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5039 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5041 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5042 | "$G_SRV -u --mtu 4096" \ |
| 5043 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5044 | 0 \ |
| 5045 | -c "client hello, adding renegotiation extension" \ |
| 5046 | -c "found renegotiation extension" \ |
| 5047 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5048 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5049 | -C "error" \ |
| 5050 | -s "Extra-header:" |
| 5051 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5052 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5053 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5054 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5055 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5056 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5057 | "$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] | 5058 | "$P_CLI debug_level=3" \ |
| 5059 | 0 \ |
| 5060 | -c "found renegotiation extension" \ |
| 5061 | -C "error" \ |
| 5062 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5063 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5064 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5066 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5067 | "$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] | 5068 | "$P_CLI debug_level=3" \ |
| 5069 | 0 \ |
| 5070 | -C "found renegotiation extension" \ |
| 5071 | -C "error" \ |
| 5072 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5073 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5074 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5076 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5077 | "$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] | 5078 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5079 | 1 \ |
| 5080 | -C "found renegotiation extension" \ |
| 5081 | -c "error" \ |
| 5082 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5083 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5084 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5086 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5087 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5088 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5089 | 0 \ |
| 5090 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5091 | -s "server hello, secure renegotiation extension" |
| 5092 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5093 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5095 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5096 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5097 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5098 | 0 \ |
| 5099 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5100 | -S "server hello, secure renegotiation extension" |
| 5101 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5102 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5104 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5105 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5106 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5107 | 1 \ |
| 5108 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5109 | -S "server hello, secure renegotiation extension" |
| 5110 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5111 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5112 | |
| 5113 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5115 | run_test "DER format: no trailing bytes" \ |
| 5116 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5117 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5118 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5119 | 0 \ |
| 5120 | -c "Handshake was completed" \ |
| 5121 | |
| 5122 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5124 | run_test "DER format: with a trailing zero byte" \ |
| 5125 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5126 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5127 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5128 | 0 \ |
| 5129 | -c "Handshake was completed" \ |
| 5130 | |
| 5131 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5133 | run_test "DER format: with a trailing random byte" \ |
| 5134 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5135 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5136 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5137 | 0 \ |
| 5138 | -c "Handshake was completed" \ |
| 5139 | |
| 5140 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5142 | run_test "DER format: with 2 trailing random bytes" \ |
| 5143 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5144 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5145 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5146 | 0 \ |
| 5147 | -c "Handshake was completed" \ |
| 5148 | |
| 5149 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5151 | run_test "DER format: with 4 trailing random bytes" \ |
| 5152 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5153 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5154 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5155 | 0 \ |
| 5156 | -c "Handshake was completed" \ |
| 5157 | |
| 5158 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5160 | run_test "DER format: with 8 trailing random bytes" \ |
| 5161 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5162 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5163 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5164 | 0 \ |
| 5165 | -c "Handshake was completed" \ |
| 5166 | |
| 5167 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5168 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5169 | run_test "DER format: with 9 trailing random bytes" \ |
| 5170 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5171 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5172 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5173 | 0 \ |
| 5174 | -c "Handshake was completed" \ |
| 5175 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5176 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5177 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5178 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5179 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5180 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5181 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5182 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5183 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5184 | 1 \ |
| 5185 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5186 | -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] | 5187 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5188 | -c "X509 - Certificate verification failed" |
| 5189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5191 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5192 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5193 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5194 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5195 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5196 | 0 \ |
| 5197 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5198 | -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] | 5199 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5200 | -C "X509 - Certificate verification failed" |
| 5201 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5203 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5204 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5205 | "$P_SRV" \ |
| 5206 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5207 | 0 \ |
| 5208 | -c "x509_verify_cert() returned" \ |
| 5209 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5210 | -c "! Certificate verification flags"\ |
| 5211 | -C "! mbedtls_ssl_handshake returned" \ |
| 5212 | -C "X509 - Certificate verification failed" \ |
| 5213 | -C "SSL - No CA Chain is set, but required to operate" |
| 5214 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5215 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5216 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5217 | "$P_SRV" \ |
| 5218 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5219 | 1 \ |
| 5220 | -c "x509_verify_cert() returned" \ |
| 5221 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5222 | -c "! Certificate verification flags"\ |
| 5223 | -c "! mbedtls_ssl_handshake returned" \ |
| 5224 | -c "SSL - No CA Chain is set, but required to operate" |
| 5225 | |
| 5226 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5227 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5228 | # the client informs the server about the supported curves - it does, though, in the |
| 5229 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5230 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5231 | # different means to have the server ignoring the client's supported curve list. |
| 5232 | |
| 5233 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5235 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5236 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5237 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5238 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5239 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5240 | 1 \ |
| 5241 | -c "bad certificate (EC key curve)"\ |
| 5242 | -c "! Certificate verification flags"\ |
| 5243 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5244 | |
| 5245 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5247 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5248 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5249 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5250 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5251 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5252 | 1 \ |
| 5253 | -c "bad certificate (EC key curve)"\ |
| 5254 | -c "! Certificate verification flags"\ |
| 5255 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5258 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5259 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5260 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5261 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5262 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5263 | 0 \ |
| 5264 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5265 | -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] | 5266 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5267 | -C "X509 - Certificate verification failed" |
| 5268 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5270 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5271 | run_test "Authentication: client SHA256, server required" \ |
| 5272 | "$P_SRV auth_mode=required" \ |
| 5273 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5274 | key_file=data_files/server6.key \ |
| 5275 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5276 | 0 \ |
| 5277 | -c "Supported Signature Algorithm found: 4," \ |
| 5278 | -c "Supported Signature Algorithm found: 5," |
| 5279 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5281 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5282 | run_test "Authentication: client SHA384, server required" \ |
| 5283 | "$P_SRV auth_mode=required" \ |
| 5284 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5285 | key_file=data_files/server6.key \ |
| 5286 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5287 | 0 \ |
| 5288 | -c "Supported Signature Algorithm found: 4," \ |
| 5289 | -c "Supported Signature Algorithm found: 5," |
| 5290 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5291 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5292 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5293 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5294 | "$P_CLI debug_level=3 crt_file=none \ |
| 5295 | key_file=data_files/server5.key" \ |
| 5296 | 1 \ |
| 5297 | -S "skip write certificate request" \ |
| 5298 | -C "skip parse certificate request" \ |
| 5299 | -c "got a certificate request" \ |
| 5300 | -c "= write certificate$" \ |
| 5301 | -C "skip write certificate$" \ |
| 5302 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5303 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5304 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5305 | -s "No client certification received from the client, but required by the authentication mode" |
| 5306 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5307 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5308 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5309 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5310 | "$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] | 5311 | key_file=data_files/server5.key" \ |
| 5312 | 1 \ |
| 5313 | -S "skip write certificate request" \ |
| 5314 | -C "skip parse certificate request" \ |
| 5315 | -c "got a certificate request" \ |
| 5316 | -C "skip write certificate" \ |
| 5317 | -C "skip write certificate verify" \ |
| 5318 | -S "skip parse certificate verify" \ |
| 5319 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5320 | -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] | 5321 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5322 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5323 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5324 | # We don't check that the client receives the alert because it might |
| 5325 | # detect that its write end of the connection is closed and abort |
| 5326 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5327 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5328 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5329 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5330 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5331 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5332 | key_file=data_files/server5.key" \ |
| 5333 | 0 \ |
| 5334 | -S "skip write certificate request" \ |
| 5335 | -C "skip parse certificate request" \ |
| 5336 | -c "got a certificate request" \ |
| 5337 | -C "skip write certificate" \ |
| 5338 | -C "skip write certificate verify" \ |
| 5339 | -S "skip parse certificate verify" \ |
| 5340 | -S "x509_verify_cert() returned" \ |
| 5341 | -S "! The certificate is not correctly signed" \ |
| 5342 | -S "X509 - Certificate verification failed" |
| 5343 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5344 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5345 | run_test "Authentication: client cert not trusted, server required" \ |
| 5346 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5347 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5348 | key_file=data_files/server5.key" \ |
| 5349 | 1 \ |
| 5350 | -S "skip write certificate request" \ |
| 5351 | -C "skip parse certificate request" \ |
| 5352 | -c "got a certificate request" \ |
| 5353 | -C "skip write certificate" \ |
| 5354 | -C "skip write certificate verify" \ |
| 5355 | -S "skip parse certificate verify" \ |
| 5356 | -s "x509_verify_cert() returned" \ |
| 5357 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5358 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5359 | -s "X509 - Certificate verification failed" |
| 5360 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5361 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5362 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5363 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5364 | "$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] | 5365 | key_file=data_files/server5.key" \ |
| 5366 | 0 \ |
| 5367 | -S "skip write certificate request" \ |
| 5368 | -C "skip parse certificate request" \ |
| 5369 | -c "got a certificate request" \ |
| 5370 | -C "skip write certificate" \ |
| 5371 | -C "skip write certificate verify" \ |
| 5372 | -S "skip parse certificate verify" \ |
| 5373 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5374 | -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] | 5375 | -S "! mbedtls_ssl_handshake returned" \ |
| 5376 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5377 | -S "X509 - Certificate verification failed" |
| 5378 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5379 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5380 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5381 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5382 | "$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] | 5383 | key_file=data_files/server5.key" \ |
| 5384 | 0 \ |
| 5385 | -s "skip write certificate request" \ |
| 5386 | -C "skip parse certificate request" \ |
| 5387 | -c "got no certificate request" \ |
| 5388 | -c "skip write certificate" \ |
| 5389 | -c "skip write certificate verify" \ |
| 5390 | -s "skip parse certificate verify" \ |
| 5391 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5392 | -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] | 5393 | -S "! mbedtls_ssl_handshake returned" \ |
| 5394 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5395 | -S "X509 - Certificate verification failed" |
| 5396 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5397 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5398 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5399 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5400 | "$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] | 5401 | 0 \ |
| 5402 | -S "skip write certificate request" \ |
| 5403 | -C "skip parse certificate request" \ |
| 5404 | -c "got a certificate request" \ |
| 5405 | -C "skip write certificate$" \ |
| 5406 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5407 | -c "skip write certificate verify" \ |
| 5408 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5409 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5410 | -S "! mbedtls_ssl_handshake returned" \ |
| 5411 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5412 | -S "X509 - Certificate verification failed" |
| 5413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5415 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5416 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5417 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5418 | "$O_CLI" \ |
| 5419 | 0 \ |
| 5420 | -S "skip write certificate request" \ |
| 5421 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5422 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5423 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5424 | -S "X509 - Certificate verification failed" |
| 5425 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5427 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5428 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5429 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5430 | "$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] | 5431 | 0 \ |
| 5432 | -C "skip parse certificate request" \ |
| 5433 | -c "got a certificate request" \ |
| 5434 | -C "skip write certificate$" \ |
| 5435 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5436 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5439 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5440 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5441 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5442 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5443 | 1 \ |
| 5444 | -C "skip parse certificate request" \ |
| 5445 | -c "got a certificate request" \ |
| 5446 | -C "skip write certificate$" \ |
| 5447 | -c "skip write certificate verify" \ |
| 5448 | -c "! mbedtls_ssl_handshake returned" |
| 5449 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5450 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5451 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5452 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5453 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5454 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5455 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5456 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5457 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5458 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5459 | # 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] | 5460 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5461 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5462 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5463 | run_test "Authentication: server max_int chain, client default" \ |
| 5464 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5465 | key_file=data_files/dir-maxpath/09.key" \ |
| 5466 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5467 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5468 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5469 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5470 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5471 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5472 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5473 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5474 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5475 | key_file=data_files/dir-maxpath/10.key" \ |
| 5476 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5477 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5478 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5479 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5480 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5481 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5483 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5484 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5485 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5486 | key_file=data_files/dir-maxpath/10.key" \ |
| 5487 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5488 | auth_mode=optional" \ |
| 5489 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5490 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5491 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5492 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5493 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5495 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5496 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5497 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5498 | key_file=data_files/dir-maxpath/10.key" \ |
| 5499 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5500 | auth_mode=none" \ |
| 5501 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5502 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5503 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5504 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5505 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5506 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5507 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5508 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5509 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5510 | key_file=data_files/dir-maxpath/10.key" \ |
| 5511 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5512 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5513 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5514 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5515 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5516 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5517 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5518 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5519 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5520 | key_file=data_files/dir-maxpath/10.key" \ |
| 5521 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5522 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5523 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5524 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5525 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5526 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5527 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5528 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5529 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5530 | key_file=data_files/dir-maxpath/10.key" \ |
| 5531 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5532 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5533 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5534 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5535 | requires_full_size_output_buffer |
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 | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5537 | run_test "Authentication: client max_int chain, server required" \ |
| 5538 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5539 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5540 | key_file=data_files/dir-maxpath/09.key" \ |
| 5541 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5542 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5543 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5544 | # Tests for CA list in CertificateRequest messages |
| 5545 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5547 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5548 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5549 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5550 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5551 | key_file=data_files/server6.key" \ |
| 5552 | 0 \ |
| 5553 | -s "requested DN" |
| 5554 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5556 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5557 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5558 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5559 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5560 | key_file=data_files/server6.key" \ |
| 5561 | 0 \ |
| 5562 | -S "requested DN" |
| 5563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5565 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5566 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5567 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5568 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5569 | key_file=data_files/server5.key" \ |
| 5570 | 1 \ |
| 5571 | -S "requested DN" \ |
| 5572 | -s "x509_verify_cert() returned" \ |
| 5573 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5574 | -s "! mbedtls_ssl_handshake returned" \ |
| 5575 | -c "! mbedtls_ssl_handshake returned" \ |
| 5576 | -s "X509 - Certificate verification failed" |
| 5577 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5579 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5580 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5581 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5582 | crt_file2=data_files/server1.crt \ |
| 5583 | key_file2=data_files/server1.key" \ |
| 5584 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5585 | crt_file=data_files/server6.crt \ |
| 5586 | key_file=data_files/server6.key" \ |
| 5587 | 0 \ |
| 5588 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5589 | |
| 5590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5591 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5592 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5593 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5594 | crt_file2=data_files/server2.crt \ |
| 5595 | key_file2=data_files/server2.key" \ |
| 5596 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5597 | crt_file=data_files/server6.crt \ |
| 5598 | key_file=data_files/server6.key" \ |
| 5599 | 0 \ |
| 5600 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5601 | |
| 5602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5603 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5604 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5605 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5606 | crt_file2=data_files/server1.crt \ |
| 5607 | key_file2=data_files/server1.key" \ |
| 5608 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5609 | crt_file=data_files/server6.crt \ |
| 5610 | key_file=data_files/server6.key" \ |
| 5611 | 0 \ |
| 5612 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5613 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5614 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5615 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5616 | |
| 5617 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5619 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5620 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5621 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5622 | key_file=data_files/server5.key" \ |
| 5623 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5624 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5625 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5626 | -c "x509_verify_cert() returned" \ |
| 5627 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5628 | -c "! mbedtls_ssl_handshake returned" \ |
| 5629 | -c "X509 - Certificate verification failed" |
| 5630 | |
| 5631 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5633 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5634 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5635 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5636 | key_file=data_files/server5.key" \ |
| 5637 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5638 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5639 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5640 | -c "x509_verify_cert() returned" \ |
| 5641 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5642 | -C "! mbedtls_ssl_handshake returned" \ |
| 5643 | -C "X509 - Certificate verification failed" |
| 5644 | |
| 5645 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5646 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5647 | # the client informs the server about the supported curves - it does, though, in the |
| 5648 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5649 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5650 | # different means to have the server ignoring the client's supported curve list. |
| 5651 | |
| 5652 | requires_config_enabled MBEDTLS_ECP_C |
| 5653 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5655 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5656 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5657 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5658 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5659 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5660 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5661 | -c "use CA callback for X.509 CRT verification" \ |
| 5662 | -c "bad certificate (EC key curve)" \ |
| 5663 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5664 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5665 | |
| 5666 | requires_config_enabled MBEDTLS_ECP_C |
| 5667 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5669 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5670 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5671 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5672 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5673 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5674 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5675 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5676 | -c "bad certificate (EC key curve)"\ |
| 5677 | -c "! Certificate verification flags"\ |
| 5678 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5679 | |
| 5680 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5682 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5683 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5684 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5685 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5686 | key_file=data_files/server6.key \ |
| 5687 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5688 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5689 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5690 | -c "Supported Signature Algorithm found: 4," \ |
| 5691 | -c "Supported Signature Algorithm found: 5," |
| 5692 | |
| 5693 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5695 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5696 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5697 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5698 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5699 | key_file=data_files/server6.key \ |
| 5700 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5701 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5702 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5703 | -c "Supported Signature Algorithm found: 4," \ |
| 5704 | -c "Supported Signature Algorithm found: 5," |
| 5705 | |
| 5706 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5708 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5709 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5710 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5711 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5712 | key_file=data_files/server5.key" \ |
| 5713 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5714 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5715 | -S "skip write certificate request" \ |
| 5716 | -C "skip parse certificate request" \ |
| 5717 | -c "got a certificate request" \ |
| 5718 | -C "skip write certificate" \ |
| 5719 | -C "skip write certificate verify" \ |
| 5720 | -S "skip parse certificate verify" \ |
| 5721 | -s "x509_verify_cert() returned" \ |
| 5722 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5723 | -s "! mbedtls_ssl_handshake returned" \ |
| 5724 | -s "send alert level=2 message=48" \ |
| 5725 | -c "! mbedtls_ssl_handshake returned" \ |
| 5726 | -s "X509 - Certificate verification failed" |
| 5727 | # We don't check that the client receives the alert because it might |
| 5728 | # detect that its write end of the connection is closed and abort |
| 5729 | # before reading the alert message. |
| 5730 | |
| 5731 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5733 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5734 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5735 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5736 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5737 | key_file=data_files/server5.key" \ |
| 5738 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5739 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5740 | -S "skip write certificate request" \ |
| 5741 | -C "skip parse certificate request" \ |
| 5742 | -c "got a certificate request" \ |
| 5743 | -C "skip write certificate" \ |
| 5744 | -C "skip write certificate verify" \ |
| 5745 | -S "skip parse certificate verify" \ |
| 5746 | -s "x509_verify_cert() returned" \ |
| 5747 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5748 | -s "! mbedtls_ssl_handshake returned" \ |
| 5749 | -c "! mbedtls_ssl_handshake returned" \ |
| 5750 | -s "X509 - Certificate verification failed" |
| 5751 | |
| 5752 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5754 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5755 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5756 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5757 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5758 | key_file=data_files/server5.key" \ |
| 5759 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5760 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5761 | -S "skip write certificate request" \ |
| 5762 | -C "skip parse certificate request" \ |
| 5763 | -c "got a certificate request" \ |
| 5764 | -C "skip write certificate" \ |
| 5765 | -C "skip write certificate verify" \ |
| 5766 | -S "skip parse certificate verify" \ |
| 5767 | -s "x509_verify_cert() returned" \ |
| 5768 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5769 | -S "! mbedtls_ssl_handshake returned" \ |
| 5770 | -C "! mbedtls_ssl_handshake returned" \ |
| 5771 | -S "X509 - Certificate verification failed" |
| 5772 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5773 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5774 | requires_full_size_output_buffer |
| 5775 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5777 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5778 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5779 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5780 | key_file=data_files/dir-maxpath/09.key" \ |
| 5781 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5782 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5783 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5784 | -C "X509 - A fatal error occurred" |
| 5785 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5786 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5787 | requires_full_size_output_buffer |
| 5788 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5790 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5791 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5792 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5793 | key_file=data_files/dir-maxpath/10.key" \ |
| 5794 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5795 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5796 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5797 | -c "X509 - A fatal error occurred" |
| 5798 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5799 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5800 | requires_full_size_output_buffer |
| 5801 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
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: server max_int+1 chain, client optional" \ |
| 5805 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5806 | key_file=data_files/dir-maxpath/10.key" \ |
| 5807 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5808 | debug_level=3 auth_mode=optional" \ |
| 5809 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5810 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5811 | -c "X509 - A fatal error occurred" |
| 5812 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5813 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5814 | requires_full_size_output_buffer |
| 5815 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5817 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5818 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5819 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5820 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5821 | key_file=data_files/dir-maxpath/10.key" \ |
| 5822 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5823 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5824 | -s "X509 - A fatal error occurred" |
| 5825 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5826 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5827 | requires_full_size_output_buffer |
| 5828 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5830 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5831 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5832 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5833 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5834 | key_file=data_files/dir-maxpath/10.key" \ |
| 5835 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5836 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5837 | -s "X509 - A fatal error occurred" |
| 5838 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5839 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5840 | requires_full_size_output_buffer |
| 5841 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5843 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5844 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5845 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5846 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5847 | key_file=data_files/dir-maxpath/09.key" \ |
| 5848 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5849 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5850 | -S "X509 - A fatal error occurred" |
| 5851 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5852 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5853 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5854 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5855 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5856 | "$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] | 5857 | key_file=data_files/server5.key \ |
| 5858 | crt_file2=data_files/server5-sha1.crt \ |
| 5859 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5860 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5861 | 0 \ |
| 5862 | -c "signed using.*ECDSA with SHA256" \ |
| 5863 | -C "signed using.*ECDSA with SHA1" |
| 5864 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5865 | # tests for SNI |
| 5866 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5867 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5868 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5869 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5870 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5871 | 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] | 5872 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5873 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5874 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5875 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5876 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5877 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5878 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5879 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5880 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5881 | 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] | 5882 | 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] | 5883 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5884 | 0 \ |
| 5885 | -s "parse ServerName extension" \ |
| 5886 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5887 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5888 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5889 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5890 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5891 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5892 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5893 | 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] | 5894 | 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] | 5895 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5896 | 0 \ |
| 5897 | -s "parse ServerName extension" \ |
| 5898 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5899 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5900 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5901 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5902 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5903 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5904 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5905 | 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] | 5906 | 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] | 5907 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5908 | 1 \ |
| 5909 | -s "parse ServerName extension" \ |
| 5910 | -s "ssl_sni_wrapper() returned" \ |
| 5911 | -s "mbedtls_ssl_handshake returned" \ |
| 5912 | -c "mbedtls_ssl_handshake returned" \ |
| 5913 | -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] | 5914 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5915 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5916 | run_test "SNI: client auth no override: optional" \ |
| 5917 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5918 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5919 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5920 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5921 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5922 | -S "skip write certificate request" \ |
| 5923 | -C "skip parse certificate request" \ |
| 5924 | -c "got a certificate request" \ |
| 5925 | -C "skip write certificate" \ |
| 5926 | -C "skip write certificate verify" \ |
| 5927 | -S "skip parse certificate verify" |
| 5928 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5929 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5930 | run_test "SNI: client auth override: none -> optional" \ |
| 5931 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5932 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5933 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5934 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5935 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5936 | -S "skip write certificate request" \ |
| 5937 | -C "skip parse certificate request" \ |
| 5938 | -c "got a certificate request" \ |
| 5939 | -C "skip write certificate" \ |
| 5940 | -C "skip write certificate verify" \ |
| 5941 | -S "skip parse certificate verify" |
| 5942 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5943 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5944 | run_test "SNI: client auth override: optional -> none" \ |
| 5945 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5946 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5947 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5948 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5949 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5950 | -s "skip write certificate request" \ |
| 5951 | -C "skip parse certificate request" \ |
| 5952 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 5953 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5954 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5955 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5956 | run_test "SNI: CA no override" \ |
| 5957 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5958 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5959 | ca_file=data_files/test-ca.crt \ |
| 5960 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5961 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5962 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5963 | 1 \ |
| 5964 | -S "skip write certificate request" \ |
| 5965 | -C "skip parse certificate request" \ |
| 5966 | -c "got a certificate request" \ |
| 5967 | -C "skip write certificate" \ |
| 5968 | -C "skip write certificate verify" \ |
| 5969 | -S "skip parse certificate verify" \ |
| 5970 | -s "x509_verify_cert() returned" \ |
| 5971 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5972 | -S "The certificate has been revoked (is on a CRL)" |
| 5973 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5974 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5975 | run_test "SNI: CA override" \ |
| 5976 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5977 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5978 | ca_file=data_files/test-ca.crt \ |
| 5979 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5980 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5981 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5982 | 0 \ |
| 5983 | -S "skip write certificate request" \ |
| 5984 | -C "skip parse certificate request" \ |
| 5985 | -c "got a certificate request" \ |
| 5986 | -C "skip write certificate" \ |
| 5987 | -C "skip write certificate verify" \ |
| 5988 | -S "skip parse certificate verify" \ |
| 5989 | -S "x509_verify_cert() returned" \ |
| 5990 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5991 | -S "The certificate has been revoked (is on a CRL)" |
| 5992 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5993 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5994 | run_test "SNI: CA override with CRL" \ |
| 5995 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5996 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5997 | ca_file=data_files/test-ca.crt \ |
| 5998 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5999 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6000 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6001 | 1 \ |
| 6002 | -S "skip write certificate request" \ |
| 6003 | -C "skip parse certificate request" \ |
| 6004 | -c "got a certificate request" \ |
| 6005 | -C "skip write certificate" \ |
| 6006 | -C "skip write certificate verify" \ |
| 6007 | -S "skip parse certificate verify" \ |
| 6008 | -s "x509_verify_cert() returned" \ |
| 6009 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6010 | -s "The certificate has been revoked (is on a CRL)" |
| 6011 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6012 | # Tests for SNI and DTLS |
| 6013 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6014 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6016 | run_test "SNI: DTLS, no SNI callback" \ |
| 6017 | "$P_SRV debug_level=3 dtls=1 \ |
| 6018 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6019 | "$P_CLI server_name=localhost dtls=1" \ |
| 6020 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6021 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6022 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6023 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6024 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6026 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6027 | "$P_SRV debug_level=3 dtls=1 \ |
| 6028 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6029 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6030 | "$P_CLI server_name=localhost dtls=1" \ |
| 6031 | 0 \ |
| 6032 | -s "parse ServerName extension" \ |
| 6033 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6034 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6035 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6036 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6038 | run_test "SNI: DTLS, matching cert 2" \ |
| 6039 | "$P_SRV debug_level=3 dtls=1 \ |
| 6040 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6041 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6042 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6043 | 0 \ |
| 6044 | -s "parse ServerName extension" \ |
| 6045 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6046 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6047 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6049 | run_test "SNI: DTLS, no matching cert" \ |
| 6050 | "$P_SRV debug_level=3 dtls=1 \ |
| 6051 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6052 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6053 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6054 | 1 \ |
| 6055 | -s "parse ServerName extension" \ |
| 6056 | -s "ssl_sni_wrapper() returned" \ |
| 6057 | -s "mbedtls_ssl_handshake returned" \ |
| 6058 | -c "mbedtls_ssl_handshake returned" \ |
| 6059 | -c "SSL - A fatal alert message was received from our peer" |
| 6060 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6062 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6063 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6064 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6065 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6066 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6067 | 0 \ |
| 6068 | -S "skip write certificate request" \ |
| 6069 | -C "skip parse certificate request" \ |
| 6070 | -c "got a certificate request" \ |
| 6071 | -C "skip write certificate" \ |
| 6072 | -C "skip write certificate verify" \ |
| 6073 | -S "skip parse certificate verify" |
| 6074 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6076 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6077 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6078 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6079 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6080 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6081 | 0 \ |
| 6082 | -S "skip write certificate request" \ |
| 6083 | -C "skip parse certificate request" \ |
| 6084 | -c "got a certificate request" \ |
| 6085 | -C "skip write certificate" \ |
| 6086 | -C "skip write certificate verify" \ |
| 6087 | -S "skip parse certificate verify" |
| 6088 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6090 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6091 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6092 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6093 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6094 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6095 | 0 \ |
| 6096 | -s "skip write certificate request" \ |
| 6097 | -C "skip parse certificate request" \ |
| 6098 | -c "got no certificate request" \ |
| 6099 | -c "skip write certificate" \ |
| 6100 | -c "skip write certificate verify" \ |
| 6101 | -s "skip parse certificate verify" |
| 6102 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6103 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6104 | run_test "SNI: DTLS, CA no override" \ |
| 6105 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6106 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6107 | ca_file=data_files/test-ca.crt \ |
| 6108 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6109 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6110 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6111 | 1 \ |
| 6112 | -S "skip write certificate request" \ |
| 6113 | -C "skip parse certificate request" \ |
| 6114 | -c "got a certificate request" \ |
| 6115 | -C "skip write certificate" \ |
| 6116 | -C "skip write certificate verify" \ |
| 6117 | -S "skip parse certificate verify" \ |
| 6118 | -s "x509_verify_cert() returned" \ |
| 6119 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6120 | -S "The certificate has been revoked (is on a CRL)" |
| 6121 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6123 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6124 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6125 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6126 | ca_file=data_files/test-ca.crt \ |
| 6127 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6128 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6129 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6130 | 0 \ |
| 6131 | -S "skip write certificate request" \ |
| 6132 | -C "skip parse certificate request" \ |
| 6133 | -c "got a certificate request" \ |
| 6134 | -C "skip write certificate" \ |
| 6135 | -C "skip write certificate verify" \ |
| 6136 | -S "skip parse certificate verify" \ |
| 6137 | -S "x509_verify_cert() returned" \ |
| 6138 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6139 | -S "The certificate has been revoked (is on a CRL)" |
| 6140 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6142 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6143 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6144 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6145 | ca_file=data_files/test-ca.crt \ |
| 6146 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6147 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6148 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6149 | 1 \ |
| 6150 | -S "skip write certificate request" \ |
| 6151 | -C "skip parse certificate request" \ |
| 6152 | -c "got a certificate request" \ |
| 6153 | -C "skip write certificate" \ |
| 6154 | -C "skip write certificate verify" \ |
| 6155 | -S "skip parse certificate verify" \ |
| 6156 | -s "x509_verify_cert() returned" \ |
| 6157 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6158 | -s "The certificate has been revoked (is on a CRL)" |
| 6159 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6160 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6161 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6162 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6163 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6164 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6165 | "$P_CLI nbio=2 tickets=0" \ |
| 6166 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6167 | -S "mbedtls_ssl_handshake returned" \ |
| 6168 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6169 | -c "Read from server: .* bytes read" |
| 6170 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6171 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6172 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6173 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6174 | "$P_CLI nbio=2 tickets=0" \ |
| 6175 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6176 | -S "mbedtls_ssl_handshake returned" \ |
| 6177 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6178 | -c "Read from server: .* bytes read" |
| 6179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6181 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6182 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6183 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6184 | "$P_CLI nbio=2 tickets=1" \ |
| 6185 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6186 | -S "mbedtls_ssl_handshake returned" \ |
| 6187 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6188 | -c "Read from server: .* bytes read" |
| 6189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6191 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6192 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6193 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6194 | "$P_CLI nbio=2 tickets=1" \ |
| 6195 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6196 | -S "mbedtls_ssl_handshake returned" \ |
| 6197 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6198 | -c "Read from server: .* bytes read" |
| 6199 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6201 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6202 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6203 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6204 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6205 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6206 | -S "mbedtls_ssl_handshake returned" \ |
| 6207 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6208 | -c "Read from server: .* bytes read" |
| 6209 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6211 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6212 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6213 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6214 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6215 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6216 | -S "mbedtls_ssl_handshake returned" \ |
| 6217 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6218 | -c "Read from server: .* bytes read" |
| 6219 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6221 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6222 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6223 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6224 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6225 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6226 | -S "mbedtls_ssl_handshake returned" \ |
| 6227 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6228 | -c "Read from server: .* bytes read" |
| 6229 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6230 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6231 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6232 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6233 | run_test "Event-driven I/O: basic handshake" \ |
| 6234 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6235 | "$P_CLI event=1 tickets=0" \ |
| 6236 | 0 \ |
| 6237 | -S "mbedtls_ssl_handshake returned" \ |
| 6238 | -C "mbedtls_ssl_handshake returned" \ |
| 6239 | -c "Read from server: .* bytes read" |
| 6240 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6241 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6242 | run_test "Event-driven I/O: client auth" \ |
| 6243 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6244 | "$P_CLI event=1 tickets=0" \ |
| 6245 | 0 \ |
| 6246 | -S "mbedtls_ssl_handshake returned" \ |
| 6247 | -C "mbedtls_ssl_handshake returned" \ |
| 6248 | -c "Read from server: .* bytes read" |
| 6249 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6251 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6252 | run_test "Event-driven I/O: ticket" \ |
| 6253 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6254 | "$P_CLI event=1 tickets=1" \ |
| 6255 | 0 \ |
| 6256 | -S "mbedtls_ssl_handshake returned" \ |
| 6257 | -C "mbedtls_ssl_handshake returned" \ |
| 6258 | -c "Read from server: .* bytes read" |
| 6259 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6261 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6262 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6263 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6264 | "$P_CLI event=1 tickets=1" \ |
| 6265 | 0 \ |
| 6266 | -S "mbedtls_ssl_handshake returned" \ |
| 6267 | -C "mbedtls_ssl_handshake returned" \ |
| 6268 | -c "Read from server: .* bytes read" |
| 6269 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6271 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6272 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6273 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6274 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6275 | 0 \ |
| 6276 | -S "mbedtls_ssl_handshake returned" \ |
| 6277 | -C "mbedtls_ssl_handshake returned" \ |
| 6278 | -c "Read from server: .* bytes read" |
| 6279 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6281 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6282 | run_test "Event-driven I/O: ticket + resume" \ |
| 6283 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6284 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6285 | 0 \ |
| 6286 | -S "mbedtls_ssl_handshake returned" \ |
| 6287 | -C "mbedtls_ssl_handshake returned" \ |
| 6288 | -c "Read from server: .* bytes read" |
| 6289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6291 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6292 | run_test "Event-driven I/O: session-id resume" \ |
| 6293 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6294 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6295 | 0 \ |
| 6296 | -S "mbedtls_ssl_handshake returned" \ |
| 6297 | -C "mbedtls_ssl_handshake returned" \ |
| 6298 | -c "Read from server: .* bytes read" |
| 6299 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6301 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6302 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6303 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6304 | 0 \ |
| 6305 | -c "Read from server: .* bytes read" |
| 6306 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6308 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6309 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6310 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6311 | 0 \ |
| 6312 | -c "Read from server: .* bytes read" |
| 6313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6315 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6316 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6317 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6318 | 0 \ |
| 6319 | -c "Read from server: .* bytes read" |
| 6320 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6322 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6323 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6324 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6325 | 0 \ |
| 6326 | -c "Read from server: .* bytes read" |
| 6327 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6329 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6330 | "$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] | 6331 | "$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] | 6332 | 0 \ |
| 6333 | -c "Read from server: .* bytes read" |
| 6334 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6336 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6337 | "$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] | 6338 | "$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] | 6339 | 0 \ |
| 6340 | -c "Read from server: .* bytes read" |
| 6341 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6343 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6344 | "$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] | 6345 | "$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] | 6346 | 0 \ |
| 6347 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6348 | |
| 6349 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6350 | # During session resumption, the client will send its ApplicationData record |
| 6351 | # within the same datagram as the Finished messages. In this situation, the |
| 6352 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6353 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6355 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6356 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6357 | "$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] | 6358 | "$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] | 6359 | 0 \ |
| 6360 | -c "Read from server: .* bytes read" |
| 6361 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6362 | # Tests for version negotiation |
| 6363 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6365 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6366 | "$P_SRV" \ |
| 6367 | "$P_CLI" \ |
| 6368 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6369 | -S "mbedtls_ssl_handshake returned" \ |
| 6370 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6371 | -s "Protocol is TLSv1.2" \ |
| 6372 | -c "Protocol is TLSv1.2" |
| 6373 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6375 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6376 | "$P_SRV" \ |
| 6377 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6378 | 1 \ |
| 6379 | -s "Handshake protocol not within min/max boundaries" \ |
| 6380 | -c "Error in protocol version" \ |
| 6381 | -S "Protocol is TLSv1.0" \ |
| 6382 | -C "Handshake was completed" |
| 6383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6385 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6386 | "$P_SRV" \ |
| 6387 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6388 | 1 \ |
| 6389 | -s "Handshake protocol not within min/max boundaries" \ |
| 6390 | -c "Error in protocol version" \ |
| 6391 | -S "Protocol is TLSv1.1" \ |
| 6392 | -C "Handshake was completed" |
| 6393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6395 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6396 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6397 | "$P_CLI" \ |
| 6398 | 1 \ |
| 6399 | -s "Error in protocol version" \ |
| 6400 | -c "Handshake protocol not within min/max boundaries" \ |
| 6401 | -S "Version: TLS1.0" \ |
| 6402 | -C "Protocol is TLSv1.0" |
| 6403 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6405 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6406 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6407 | "$P_CLI" \ |
| 6408 | 1 \ |
| 6409 | -s "Error in protocol version" \ |
| 6410 | -c "Handshake protocol not within min/max boundaries" \ |
| 6411 | -S "Version: TLS1.1" \ |
| 6412 | -C "Protocol is TLSv1.1" |
| 6413 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6414 | # Tests for ALPN extension |
| 6415 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6416 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6417 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6418 | "$P_SRV debug_level=3" \ |
| 6419 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6420 | 0 \ |
| 6421 | -C "client hello, adding alpn extension" \ |
| 6422 | -S "found alpn extension" \ |
| 6423 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6424 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6425 | -C "found alpn extension " \ |
| 6426 | -C "Application Layer Protocol is" \ |
| 6427 | -S "Application Layer Protocol is" |
| 6428 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6429 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6430 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6431 | "$P_SRV debug_level=3" \ |
| 6432 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6433 | 0 \ |
| 6434 | -c "client hello, adding alpn extension" \ |
| 6435 | -s "found alpn extension" \ |
| 6436 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6437 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6438 | -C "found alpn extension " \ |
| 6439 | -c "Application Layer Protocol is (none)" \ |
| 6440 | -S "Application Layer Protocol is" |
| 6441 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6442 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6443 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6444 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6445 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6446 | 0 \ |
| 6447 | -C "client hello, adding alpn extension" \ |
| 6448 | -S "found alpn extension" \ |
| 6449 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6450 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6451 | -C "found alpn extension " \ |
| 6452 | -C "Application Layer Protocol is" \ |
| 6453 | -s "Application Layer Protocol is (none)" |
| 6454 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6455 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6456 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6457 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6458 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6459 | 0 \ |
| 6460 | -c "client hello, adding alpn extension" \ |
| 6461 | -s "found alpn extension" \ |
| 6462 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6463 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6464 | -c "found alpn extension" \ |
| 6465 | -c "Application Layer Protocol is abc" \ |
| 6466 | -s "Application Layer Protocol is abc" |
| 6467 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6468 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6469 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6470 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6471 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6472 | 0 \ |
| 6473 | -c "client hello, adding alpn extension" \ |
| 6474 | -s "found alpn extension" \ |
| 6475 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6476 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6477 | -c "found alpn extension" \ |
| 6478 | -c "Application Layer Protocol is abc" \ |
| 6479 | -s "Application Layer Protocol is abc" |
| 6480 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6481 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6482 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6483 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6484 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6485 | 0 \ |
| 6486 | -c "client hello, adding alpn extension" \ |
| 6487 | -s "found alpn extension" \ |
| 6488 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6489 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6490 | -c "found alpn extension" \ |
| 6491 | -c "Application Layer Protocol is 1234" \ |
| 6492 | -s "Application Layer Protocol is 1234" |
| 6493 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6494 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6495 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6496 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6497 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6498 | 1 \ |
| 6499 | -c "client hello, adding alpn extension" \ |
| 6500 | -s "found alpn extension" \ |
| 6501 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6502 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6503 | -C "found alpn extension" \ |
| 6504 | -C "Application Layer Protocol is 1234" \ |
| 6505 | -S "Application Layer Protocol is 1234" |
| 6506 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6507 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6508 | # Tests for keyUsage in leaf certificates, part 1: |
| 6509 | # server-side certificate/suite selection |
| 6510 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6512 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6513 | "$P_SRV key_file=data_files/server2.key \ |
| 6514 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6515 | "$P_CLI" \ |
| 6516 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6517 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6520 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6521 | "$P_SRV key_file=data_files/server2.key \ |
| 6522 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6523 | "$P_CLI" \ |
| 6524 | 0 \ |
| 6525 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6526 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6528 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6529 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6530 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6531 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6532 | 1 \ |
| 6533 | -C "Ciphersuite is " |
| 6534 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6536 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6537 | "$P_SRV key_file=data_files/server5.key \ |
| 6538 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6539 | "$P_CLI" \ |
| 6540 | 0 \ |
| 6541 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6542 | |
| 6543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6545 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6546 | "$P_SRV key_file=data_files/server5.key \ |
| 6547 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6548 | "$P_CLI" \ |
| 6549 | 0 \ |
| 6550 | -c "Ciphersuite is TLS-ECDH-" |
| 6551 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6553 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6554 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6555 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6556 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6557 | 1 \ |
| 6558 | -C "Ciphersuite is " |
| 6559 | |
| 6560 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6561 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6562 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6564 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6565 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6566 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6567 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6568 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6569 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6570 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6571 | -C "Processing of the Certificate handshake message failed" \ |
| 6572 | -c "Ciphersuite is TLS-" |
| 6573 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6575 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6576 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6577 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6578 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6579 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6580 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6581 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6582 | -C "Processing of the Certificate handshake message failed" \ |
| 6583 | -c "Ciphersuite is TLS-" |
| 6584 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6586 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6587 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6588 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6589 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6590 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6591 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6592 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6593 | -C "Processing of the Certificate handshake message failed" \ |
| 6594 | -c "Ciphersuite is TLS-" |
| 6595 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6597 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6598 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6599 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6600 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6601 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6602 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6603 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6604 | -c "Processing of the Certificate handshake message failed" \ |
| 6605 | -C "Ciphersuite is TLS-" |
| 6606 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6608 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6609 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6610 | -cert data_files/server2.ku-ke.crt" \ |
| 6611 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6612 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6613 | 0 \ |
| 6614 | -c "bad certificate (usage extensions)" \ |
| 6615 | -C "Processing of the Certificate handshake message failed" \ |
| 6616 | -c "Ciphersuite is TLS-" \ |
| 6617 | -c "! Usage does not match the keyUsage extension" |
| 6618 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6620 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6621 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6622 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6623 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6624 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6625 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6626 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6627 | -C "Processing of the Certificate handshake message failed" \ |
| 6628 | -c "Ciphersuite is TLS-" |
| 6629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6631 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6632 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6633 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6634 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6635 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6636 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6637 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6638 | -c "Processing of the Certificate handshake message failed" \ |
| 6639 | -C "Ciphersuite is TLS-" |
| 6640 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6642 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6643 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6644 | -cert data_files/server2.ku-ds.crt" \ |
| 6645 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6646 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6647 | 0 \ |
| 6648 | -c "bad certificate (usage extensions)" \ |
| 6649 | -C "Processing of the Certificate handshake message failed" \ |
| 6650 | -c "Ciphersuite is TLS-" \ |
| 6651 | -c "! Usage does not match the keyUsage extension" |
| 6652 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6653 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6654 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6655 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6656 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6657 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6658 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6659 | "$P_CLI debug_level=3" \ |
| 6660 | 0 \ |
| 6661 | -C "bad certificate (usage extensions)" \ |
| 6662 | -C "Processing of the Certificate handshake message failed" \ |
| 6663 | -c "Ciphersuite is" |
| 6664 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6665 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6666 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6667 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6668 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6669 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6670 | -cert data_files/server2.ku-ke.crt" \ |
| 6671 | "$P_CLI debug_level=1" \ |
| 6672 | 1 \ |
| 6673 | -c "bad certificate (usage extensions)" \ |
| 6674 | -c "Processing of the Certificate handshake message failed" \ |
| 6675 | -C "Ciphersuite is" |
| 6676 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6677 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6678 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6679 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6680 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6681 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6682 | -cert data_files/server2.ku-ka.crt" \ |
| 6683 | "$P_CLI debug_level=1" \ |
| 6684 | 1 \ |
| 6685 | -c "bad certificate (usage extensions)" \ |
| 6686 | -c "Processing of the Certificate handshake message failed" \ |
| 6687 | -C "Ciphersuite is" |
| 6688 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6689 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6690 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6691 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6692 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6693 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6694 | -cert data_files/server5.ku-ds.crt" \ |
| 6695 | "$P_CLI debug_level=3" \ |
| 6696 | 0 \ |
| 6697 | -C "bad certificate (usage extensions)" \ |
| 6698 | -C "Processing of the Certificate handshake message failed" \ |
| 6699 | -c "Ciphersuite is" |
| 6700 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6701 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6702 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6703 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6704 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6705 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6706 | -cert data_files/server5.ku-ke.crt" \ |
| 6707 | "$P_CLI debug_level=1" \ |
| 6708 | 1 \ |
| 6709 | -c "bad certificate (usage extensions)" \ |
| 6710 | -c "Processing of the Certificate handshake message failed" \ |
| 6711 | -C "Ciphersuite is" |
| 6712 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6713 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6714 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6715 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6716 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6717 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6718 | -cert data_files/server5.ku-ka.crt" \ |
| 6719 | "$P_CLI debug_level=1" \ |
| 6720 | 1 \ |
| 6721 | -c "bad certificate (usage extensions)" \ |
| 6722 | -c "Processing of the Certificate handshake message failed" \ |
| 6723 | -C "Ciphersuite is" |
| 6724 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6725 | # Tests for keyUsage in leaf certificates, part 3: |
| 6726 | # server-side checking of client cert |
| 6727 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6729 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6730 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6731 | "$O_CLI -key data_files/server2.key \ |
| 6732 | -cert data_files/server2.ku-ds.crt" \ |
| 6733 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6734 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6735 | -S "bad certificate (usage extensions)" \ |
| 6736 | -S "Processing of the Certificate handshake message failed" |
| 6737 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6739 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6740 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6741 | "$O_CLI -key data_files/server2.key \ |
| 6742 | -cert data_files/server2.ku-ke.crt" \ |
| 6743 | 0 \ |
| 6744 | -s "bad certificate (usage extensions)" \ |
| 6745 | -S "Processing of the Certificate handshake message failed" |
| 6746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6748 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6749 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6750 | "$O_CLI -key data_files/server2.key \ |
| 6751 | -cert data_files/server2.ku-ke.crt" \ |
| 6752 | 1 \ |
| 6753 | -s "bad certificate (usage extensions)" \ |
| 6754 | -s "Processing of the Certificate handshake message failed" |
| 6755 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6757 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6758 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6759 | "$O_CLI -key data_files/server5.key \ |
| 6760 | -cert data_files/server5.ku-ds.crt" \ |
| 6761 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6762 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6763 | -S "bad certificate (usage extensions)" \ |
| 6764 | -S "Processing of the Certificate handshake message failed" |
| 6765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6767 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6768 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6769 | "$O_CLI -key data_files/server5.key \ |
| 6770 | -cert data_files/server5.ku-ka.crt" \ |
| 6771 | 0 \ |
| 6772 | -s "bad certificate (usage extensions)" \ |
| 6773 | -S "Processing of the Certificate handshake message failed" |
| 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 | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6778 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6779 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6780 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6781 | -cert data_files/server2.ku-ds.crt" \ |
| 6782 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6783 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6784 | -S "bad certificate (usage extensions)" \ |
| 6785 | -S "Processing of the Certificate handshake message failed" |
| 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 | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6790 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6791 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6792 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6793 | -cert data_files/server2.ku-ke.crt" \ |
| 6794 | 0 \ |
| 6795 | -s "bad certificate (usage extensions)" \ |
| 6796 | -S "Processing of the Certificate handshake message failed" |
| 6797 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6798 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6799 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6800 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6801 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6802 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6803 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6804 | -cert data_files/server5.ku-ds.crt" \ |
| 6805 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6806 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6807 | -S "bad certificate (usage extensions)" \ |
| 6808 | -S "Processing of the Certificate handshake message failed" |
| 6809 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6810 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6811 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6812 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6813 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6814 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6815 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6816 | -cert data_files/server5.ku-ka.crt" \ |
| 6817 | 0 \ |
| 6818 | -s "bad certificate (usage extensions)" \ |
| 6819 | -S "Processing of the Certificate handshake message failed" |
| 6820 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6821 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6824 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6825 | "$P_SRV key_file=data_files/server5.key \ |
| 6826 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6827 | "$P_CLI" \ |
| 6828 | 0 |
| 6829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6831 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6832 | "$P_SRV key_file=data_files/server5.key \ |
| 6833 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6834 | "$P_CLI" \ |
| 6835 | 0 |
| 6836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6838 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6839 | "$P_SRV key_file=data_files/server5.key \ |
| 6840 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6841 | "$P_CLI" \ |
| 6842 | 0 |
| 6843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6845 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6846 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6847 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6848 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6849 | 1 |
| 6850 | |
| 6851 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6852 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6854 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6855 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6856 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6857 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6858 | 0 \ |
| 6859 | -C "bad certificate (usage extensions)" \ |
| 6860 | -C "Processing of the Certificate handshake message failed" \ |
| 6861 | -c "Ciphersuite is TLS-" |
| 6862 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6864 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6865 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6866 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6867 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6868 | 0 \ |
| 6869 | -C "bad certificate (usage extensions)" \ |
| 6870 | -C "Processing of the Certificate handshake message failed" \ |
| 6871 | -c "Ciphersuite is TLS-" |
| 6872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6874 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6875 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6876 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6877 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6878 | 0 \ |
| 6879 | -C "bad certificate (usage extensions)" \ |
| 6880 | -C "Processing of the Certificate handshake message failed" \ |
| 6881 | -c "Ciphersuite is TLS-" |
| 6882 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6884 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6885 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6886 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6887 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6888 | 1 \ |
| 6889 | -c "bad certificate (usage extensions)" \ |
| 6890 | -c "Processing of the Certificate handshake message failed" \ |
| 6891 | -C "Ciphersuite is TLS-" |
| 6892 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6893 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6894 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6895 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6896 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6897 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6898 | -cert data_files/server5.eku-srv.crt" \ |
| 6899 | "$P_CLI debug_level=1" \ |
| 6900 | 0 \ |
| 6901 | -C "bad certificate (usage extensions)" \ |
| 6902 | -C "Processing of the Certificate handshake message failed" \ |
| 6903 | -c "Ciphersuite is" |
| 6904 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6905 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6908 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6909 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6910 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6911 | "$P_CLI debug_level=1" \ |
| 6912 | 0 \ |
| 6913 | -C "bad certificate (usage extensions)" \ |
| 6914 | -C "Processing of the Certificate handshake message failed" \ |
| 6915 | -c "Ciphersuite is" |
| 6916 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6917 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6918 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6919 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6920 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6921 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6922 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6923 | "$P_CLI debug_level=1" \ |
| 6924 | 0 \ |
| 6925 | -C "bad certificate (usage extensions)" \ |
| 6926 | -C "Processing of the Certificate handshake message failed" \ |
| 6927 | -c "Ciphersuite is" |
| 6928 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6929 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6930 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6931 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6932 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6933 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6934 | -cert data_files/server5.eku-cs.crt" \ |
| 6935 | "$P_CLI debug_level=1" \ |
| 6936 | 1 \ |
| 6937 | -c "bad certificate (usage extensions)" \ |
| 6938 | -c "Processing of the Certificate handshake message failed" \ |
| 6939 | -C "Ciphersuite is" |
| 6940 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6941 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6942 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6944 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6945 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6946 | "$O_CLI -key data_files/server5.key \ |
| 6947 | -cert data_files/server5.eku-cli.crt" \ |
| 6948 | 0 \ |
| 6949 | -S "bad certificate (usage extensions)" \ |
| 6950 | -S "Processing of the Certificate handshake message failed" |
| 6951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6953 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6954 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6955 | "$O_CLI -key data_files/server5.key \ |
| 6956 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6957 | 0 \ |
| 6958 | -S "bad certificate (usage extensions)" \ |
| 6959 | -S "Processing of the Certificate handshake message failed" |
| 6960 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6962 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6963 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6964 | "$O_CLI -key data_files/server5.key \ |
| 6965 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6966 | 0 \ |
| 6967 | -S "bad certificate (usage extensions)" \ |
| 6968 | -S "Processing of the Certificate handshake message failed" |
| 6969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6971 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6972 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6973 | "$O_CLI -key data_files/server5.key \ |
| 6974 | -cert data_files/server5.eku-cs.crt" \ |
| 6975 | 0 \ |
| 6976 | -s "bad certificate (usage extensions)" \ |
| 6977 | -S "Processing of the Certificate handshake message failed" |
| 6978 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6980 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6981 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6982 | "$O_CLI -key data_files/server5.key \ |
| 6983 | -cert data_files/server5.eku-cs.crt" \ |
| 6984 | 1 \ |
| 6985 | -s "bad certificate (usage extensions)" \ |
| 6986 | -s "Processing of the Certificate handshake message failed" |
| 6987 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6988 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6989 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6990 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6991 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6992 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6993 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6994 | -cert data_files/server5.eku-cli.crt" \ |
| 6995 | 0 \ |
| 6996 | -S "bad certificate (usage extensions)" \ |
| 6997 | -S "Processing of the Certificate handshake message failed" |
| 6998 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6999 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7000 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7001 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7002 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7003 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7004 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7005 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7006 | 0 \ |
| 7007 | -S "bad certificate (usage extensions)" \ |
| 7008 | -S "Processing of the Certificate handshake message failed" |
| 7009 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7010 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7011 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7012 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7013 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7014 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7015 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7016 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7017 | 0 \ |
| 7018 | -S "bad certificate (usage extensions)" \ |
| 7019 | -S "Processing of the Certificate handshake message failed" |
| 7020 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7021 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7022 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7023 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7024 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7025 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7026 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7027 | -cert data_files/server5.eku-cs.crt" \ |
| 7028 | 0 \ |
| 7029 | -s "bad certificate (usage extensions)" \ |
| 7030 | -S "Processing of the Certificate handshake message failed" |
| 7031 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7032 | # Tests for DHM parameters loading |
| 7033 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7035 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7036 | "$P_SRV" \ |
| 7037 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7038 | debug_level=3" \ |
| 7039 | 0 \ |
| 7040 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7041 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7044 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7045 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7046 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7047 | debug_level=3" \ |
| 7048 | 0 \ |
| 7049 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7050 | -c "value of 'DHM: G ' (2 bits)" |
| 7051 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7052 | # Tests for DHM client-side size checking |
| 7053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7055 | run_test "DHM size: server default, client default, OK" \ |
| 7056 | "$P_SRV" \ |
| 7057 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7058 | debug_level=1" \ |
| 7059 | 0 \ |
| 7060 | -C "DHM prime too short:" |
| 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 | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7063 | run_test "DHM size: server default, client 2048, OK" \ |
| 7064 | "$P_SRV" \ |
| 7065 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7066 | debug_level=1 dhmlen=2048" \ |
| 7067 | 0 \ |
| 7068 | -C "DHM prime too short:" |
| 7069 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7071 | run_test "DHM size: server 1024, client default, OK" \ |
| 7072 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7073 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7074 | debug_level=1" \ |
| 7075 | 0 \ |
| 7076 | -C "DHM prime too short:" |
| 7077 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7079 | run_test "DHM size: server 999, client 999, OK" \ |
| 7080 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7081 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7082 | debug_level=1 dhmlen=999" \ |
| 7083 | 0 \ |
| 7084 | -C "DHM prime too short:" |
| 7085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7087 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7088 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7089 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7090 | debug_level=1 dhmlen=1000" \ |
| 7091 | 0 \ |
| 7092 | -C "DHM prime too short:" |
| 7093 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7095 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7096 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7097 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7098 | debug_level=1" \ |
| 7099 | 1 \ |
| 7100 | -c "DHM prime too short:" |
| 7101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7103 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7104 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7105 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7106 | debug_level=1 dhmlen=1001" \ |
| 7107 | 1 \ |
| 7108 | -c "DHM prime too short:" |
| 7109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7111 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7112 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7113 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7114 | debug_level=1 dhmlen=1000" \ |
| 7115 | 1 \ |
| 7116 | -c "DHM prime too short:" |
| 7117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7119 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7120 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7121 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7122 | debug_level=1 dhmlen=999" \ |
| 7123 | 1 \ |
| 7124 | -c "DHM prime too short:" |
| 7125 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7127 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7128 | "$P_SRV" \ |
| 7129 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7130 | debug_level=1 dhmlen=2049" \ |
| 7131 | 1 \ |
| 7132 | -c "DHM prime too short:" |
| 7133 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7134 | # Tests for PSK callback |
| 7135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7137 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7138 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7139 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7140 | psk_identity=foo psk=abc123" \ |
| 7141 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7142 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7143 | -S "SSL - Unknown identity received" \ |
| 7144 | -S "SSL - Verification of the message MAC failed" |
| 7145 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7148 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7149 | "$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] | 7150 | "$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] | 7151 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7152 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7153 | -C "session hash for extended master secret"\ |
| 7154 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7155 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7156 | -S "SSL - Unknown identity received" \ |
| 7157 | -S "SSL - Verification of the message MAC failed" |
| 7158 | |
| 7159 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7161 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7162 | "$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] | 7163 | "$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] | 7164 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7165 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7166 | -C "session hash for extended master secret"\ |
| 7167 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7168 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7169 | -S "SSL - Unknown identity received" \ |
| 7170 | -S "SSL - Verification of the message MAC failed" |
| 7171 | |
| 7172 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7174 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7175 | "$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] | 7176 | "$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] | 7177 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7178 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7179 | -c "session hash for extended master secret"\ |
| 7180 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7181 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7182 | -S "SSL - Unknown identity received" \ |
| 7183 | -S "SSL - Verification of the message MAC failed" |
| 7184 | |
| 7185 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7187 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7188 | "$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] | 7189 | "$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] | 7190 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7191 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7192 | -c "session hash for extended master secret"\ |
| 7193 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7194 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7195 | -S "SSL - Unknown identity received" \ |
| 7196 | -S "SSL - Verification of the message MAC failed" |
| 7197 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7198 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7200 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7201 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7202 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7203 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7204 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7205 | -C "session hash for extended master secret"\ |
| 7206 | -S "session hash for extended master secret"\ |
| 7207 | -S "SSL - The handshake negotiation failed" \ |
| 7208 | -S "SSL - Unknown identity received" \ |
| 7209 | -S "SSL - Verification of the message MAC failed" |
| 7210 | |
| 7211 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7213 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7214 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7215 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7216 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7217 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7218 | -C "session hash for extended master secret"\ |
| 7219 | -S "session hash for extended master secret"\ |
| 7220 | -S "SSL - The handshake negotiation failed" \ |
| 7221 | -S "SSL - Unknown identity received" \ |
| 7222 | -S "SSL - Verification of the message MAC failed" |
| 7223 | |
| 7224 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7226 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7227 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7228 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7229 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7230 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7231 | -c "session hash for extended master secret"\ |
| 7232 | -s "session hash for extended master secret"\ |
| 7233 | -S "SSL - The handshake negotiation failed" \ |
| 7234 | -S "SSL - Unknown identity received" \ |
| 7235 | -S "SSL - Verification of the message MAC failed" |
| 7236 | |
| 7237 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7239 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7240 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7241 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7242 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7243 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7244 | -c "session hash for extended master secret"\ |
| 7245 | -s "session hash for extended master secret"\ |
| 7246 | -S "SSL - The handshake negotiation failed" \ |
| 7247 | -S "SSL - Unknown identity received" \ |
| 7248 | -S "SSL - Verification of the message MAC failed" |
| 7249 | |
| 7250 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7252 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7253 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7254 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7255 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7256 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7257 | -C "session hash for extended master secret"\ |
| 7258 | -S "session hash for extended master secret"\ |
| 7259 | -S "SSL - The handshake negotiation failed" \ |
| 7260 | -S "SSL - Unknown identity received" \ |
| 7261 | -S "SSL - Verification of the message MAC failed" |
| 7262 | |
| 7263 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7265 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7266 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7267 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7268 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7269 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7270 | -C "session hash for extended master secret"\ |
| 7271 | -S "session hash for extended master secret"\ |
| 7272 | -S "SSL - The handshake negotiation failed" \ |
| 7273 | -S "SSL - Unknown identity received" \ |
| 7274 | -S "SSL - Verification of the message MAC failed" |
| 7275 | |
| 7276 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7278 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7279 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7280 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7281 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7282 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7283 | -c "session hash for extended master secret"\ |
| 7284 | -s "session hash for extended master secret"\ |
| 7285 | -S "SSL - The handshake negotiation failed" \ |
| 7286 | -S "SSL - Unknown identity received" \ |
| 7287 | -S "SSL - Verification of the message MAC failed" |
| 7288 | |
| 7289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7291 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7292 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7293 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7294 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7295 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7296 | -c "session hash for extended master secret"\ |
| 7297 | -s "session hash for extended master secret"\ |
| 7298 | -S "SSL - The handshake negotiation failed" \ |
| 7299 | -S "SSL - Unknown identity received" \ |
| 7300 | -S "SSL - Verification of the message MAC failed" |
| 7301 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7302 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7304 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 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-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7307 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7308 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +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 |
| 7316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7317 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7318 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7319 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7320 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7321 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7322 | -C "session hash for extended master secret"\ |
| 7323 | -S "session hash for extended master secret"\ |
| 7324 | -S "SSL - The handshake negotiation failed" \ |
| 7325 | -S "SSL - Unknown identity received" \ |
| 7326 | -S "SSL - Verification of the message MAC failed" |
| 7327 | |
| 7328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7330 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7331 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7332 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7333 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7334 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7335 | -c "session hash for extended master secret"\ |
| 7336 | -s "session hash for extended master secret"\ |
| 7337 | -S "SSL - The handshake negotiation failed" \ |
| 7338 | -S "SSL - Unknown identity received" \ |
| 7339 | -S "SSL - Verification of the message MAC failed" |
| 7340 | |
| 7341 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7343 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7344 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7345 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7346 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7347 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7348 | -c "session hash for extended master secret"\ |
| 7349 | -s "session hash for extended master secret"\ |
| 7350 | -S "SSL - The handshake negotiation failed" \ |
| 7351 | -S "SSL - Unknown identity received" \ |
| 7352 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7353 | |
| 7354 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7356 | 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] | 7357 | "$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" \ |
| 7358 | "$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] | 7359 | psk_identity=foo psk=abc123" \ |
| 7360 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7361 | -C "session hash for extended master secret"\ |
| 7362 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7363 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7364 | -S "SSL - Unknown identity received" \ |
| 7365 | -S "SSL - Verification of the message MAC failed" |
| 7366 | |
| 7367 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7369 | 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] | 7370 | "$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" \ |
| 7371 | "$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] | 7372 | psk_identity=foo psk=abc123" \ |
| 7373 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7374 | -C "session hash for extended master secret"\ |
| 7375 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7376 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7377 | -S "SSL - Unknown identity received" \ |
| 7378 | -S "SSL - Verification of the message MAC failed" |
| 7379 | |
| 7380 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7382 | 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] | 7383 | "$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] | 7384 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7385 | "$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] | 7386 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7387 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7388 | -c "session hash for extended master secret"\ |
| 7389 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7390 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7391 | -S "SSL - Unknown identity received" \ |
| 7392 | -S "SSL - Verification of the message MAC failed" |
| 7393 | |
| 7394 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7396 | 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] | 7397 | "$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] | 7398 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7399 | "$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] | 7400 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7401 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7402 | -c "session hash for extended master secret"\ |
| 7403 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7404 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7405 | -S "SSL - Unknown identity received" \ |
| 7406 | -S "SSL - Verification of the message MAC failed" |
| 7407 | |
| 7408 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7410 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7411 | "$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" \ |
| 7412 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7413 | psk_identity=foo psk=abc123" \ |
| 7414 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7415 | -C "session hash for extended master secret"\ |
| 7416 | -S "session hash for extended master secret"\ |
| 7417 | -S "SSL - The handshake negotiation failed" \ |
| 7418 | -S "SSL - Unknown identity received" \ |
| 7419 | -S "SSL - Verification of the message MAC failed" |
| 7420 | |
| 7421 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7423 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7424 | "$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" \ |
| 7425 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7426 | psk_identity=foo psk=abc123" \ |
| 7427 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7428 | -C "session hash for extended master secret"\ |
| 7429 | -S "session hash for extended master secret"\ |
| 7430 | -S "SSL - The handshake negotiation failed" \ |
| 7431 | -S "SSL - Unknown identity received" \ |
| 7432 | -S "SSL - Verification of the message MAC failed" |
| 7433 | |
| 7434 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7436 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7437 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7438 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7439 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7440 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7441 | 0 \ |
| 7442 | -c "session hash for extended master secret"\ |
| 7443 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7444 | -S "SSL - The handshake negotiation failed" \ |
| 7445 | -S "SSL - Unknown identity received" \ |
| 7446 | -S "SSL - Verification of the message MAC failed" |
| 7447 | |
| 7448 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7450 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7451 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7452 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7453 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7454 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7455 | 0 \ |
| 7456 | -c "session hash for extended master secret"\ |
| 7457 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7458 | -S "SSL - The handshake negotiation failed" \ |
| 7459 | -S "SSL - Unknown identity received" \ |
| 7460 | -S "SSL - Verification of the message MAC failed" |
| 7461 | |
| 7462 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7464 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7465 | "$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" \ |
| 7466 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7467 | psk_identity=foo psk=abc123" \ |
| 7468 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7469 | -C "session hash for extended master secret"\ |
| 7470 | -S "session hash for extended master secret"\ |
| 7471 | -S "SSL - The handshake negotiation failed" \ |
| 7472 | -S "SSL - Unknown identity received" \ |
| 7473 | -S "SSL - Verification of the message MAC failed" |
| 7474 | |
| 7475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7477 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7478 | "$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" \ |
| 7479 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7480 | psk_identity=foo psk=abc123" \ |
| 7481 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7482 | -C "session hash for extended master secret"\ |
| 7483 | -S "session hash for extended master secret"\ |
| 7484 | -S "SSL - The handshake negotiation failed" \ |
| 7485 | -S "SSL - Unknown identity received" \ |
| 7486 | -S "SSL - Verification of the message MAC failed" |
| 7487 | |
| 7488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7490 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7491 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7492 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7493 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7494 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7495 | 0 \ |
| 7496 | -c "session hash for extended master secret"\ |
| 7497 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7498 | -S "SSL - The handshake negotiation failed" \ |
| 7499 | -S "SSL - Unknown identity received" \ |
| 7500 | -S "SSL - Verification of the message MAC failed" |
| 7501 | |
| 7502 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7504 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7505 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7506 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7507 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7508 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7509 | 0 \ |
| 7510 | -c "session hash for extended master secret"\ |
| 7511 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7512 | -S "SSL - The handshake negotiation failed" \ |
| 7513 | -S "SSL - Unknown identity received" \ |
| 7514 | -S "SSL - Verification of the message MAC failed" |
| 7515 | |
| 7516 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7518 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7519 | "$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" \ |
| 7520 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7521 | psk_identity=foo psk=abc123" \ |
| 7522 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7523 | -C "session hash for extended master secret"\ |
| 7524 | -S "session hash for extended master secret"\ |
| 7525 | -S "SSL - The handshake negotiation failed" \ |
| 7526 | -S "SSL - Unknown identity received" \ |
| 7527 | -S "SSL - Verification of the message MAC failed" |
| 7528 | |
| 7529 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7531 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7532 | "$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" \ |
| 7533 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7534 | psk_identity=foo psk=abc123" \ |
| 7535 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7536 | -C "session hash for extended master secret"\ |
| 7537 | -S "session hash for extended master secret"\ |
| 7538 | -S "SSL - The handshake negotiation failed" \ |
| 7539 | -S "SSL - Unknown identity received" \ |
| 7540 | -S "SSL - Verification of the message MAC failed" |
| 7541 | |
| 7542 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7544 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7545 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7546 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7547 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7548 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7549 | 0 \ |
| 7550 | -c "session hash for extended master secret"\ |
| 7551 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7552 | -S "SSL - The handshake negotiation failed" \ |
| 7553 | -S "SSL - Unknown identity received" \ |
| 7554 | -S "SSL - Verification of the message MAC failed" |
| 7555 | |
| 7556 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7558 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7559 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7560 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7561 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7562 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7563 | 0 \ |
| 7564 | -c "session hash for extended master secret"\ |
| 7565 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7566 | -S "SSL - The handshake negotiation failed" \ |
| 7567 | -S "SSL - Unknown identity received" \ |
| 7568 | -S "SSL - Verification of the message MAC failed" |
| 7569 | |
| 7570 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7572 | 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] | 7573 | "$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" \ |
| 7574 | "$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] | 7575 | psk_identity=def psk=beef" \ |
| 7576 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7577 | -C "session hash for extended master secret"\ |
| 7578 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7579 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7580 | -S "SSL - Unknown identity received" \ |
| 7581 | -S "SSL - Verification of the message MAC failed" |
| 7582 | |
| 7583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7585 | 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] | 7586 | "$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" \ |
| 7587 | "$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] | 7588 | psk_identity=def psk=beef" \ |
| 7589 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7590 | -C "session hash for extended master secret"\ |
| 7591 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7592 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7593 | -S "SSL - Unknown identity received" \ |
| 7594 | -S "SSL - Verification of the message MAC failed" |
| 7595 | |
| 7596 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7598 | 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] | 7599 | "$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] | 7600 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7601 | "$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] | 7602 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7603 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7604 | -c "session hash for extended master secret"\ |
| 7605 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7606 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7607 | -S "SSL - Unknown identity received" \ |
| 7608 | -S "SSL - Verification of the message MAC failed" |
| 7609 | |
| 7610 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7612 | 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] | 7613 | "$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] | 7614 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7615 | "$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] | 7616 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7617 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7618 | -c "session hash for extended master secret"\ |
| 7619 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7620 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7621 | -S "SSL - Unknown identity received" \ |
| 7622 | -S "SSL - Verification of the message MAC failed" |
| 7623 | |
| 7624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7626 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7627 | "$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" \ |
| 7628 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7629 | psk_identity=def psk=beef" \ |
| 7630 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7631 | -C "session hash for extended master secret"\ |
| 7632 | -S "session hash for extended master secret"\ |
| 7633 | -S "SSL - The handshake negotiation failed" \ |
| 7634 | -S "SSL - Unknown identity received" \ |
| 7635 | -S "SSL - Verification of the message MAC failed" |
| 7636 | |
| 7637 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7639 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7640 | "$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" \ |
| 7641 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7642 | psk_identity=def psk=beef" \ |
| 7643 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7644 | -C "session hash for extended master secret"\ |
| 7645 | -S "session hash for extended master secret"\ |
| 7646 | -S "SSL - The handshake negotiation failed" \ |
| 7647 | -S "SSL - Unknown identity received" \ |
| 7648 | -S "SSL - Verification of the message MAC failed" |
| 7649 | |
| 7650 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7652 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7653 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7654 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7655 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7656 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7657 | 0 \ |
| 7658 | -c "session hash for extended master secret"\ |
| 7659 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7660 | -S "SSL - The handshake negotiation failed" \ |
| 7661 | -S "SSL - Unknown identity received" \ |
| 7662 | -S "SSL - Verification of the message MAC failed" |
| 7663 | |
| 7664 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7665 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7666 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7667 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7668 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7669 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7670 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7671 | 0 \ |
| 7672 | -c "session hash for extended master secret"\ |
| 7673 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7674 | -S "SSL - The handshake negotiation failed" \ |
| 7675 | -S "SSL - Unknown identity received" \ |
| 7676 | -S "SSL - Verification of the message MAC failed" |
| 7677 | |
| 7678 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7680 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7681 | "$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" \ |
| 7682 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7683 | psk_identity=def psk=beef" \ |
| 7684 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7685 | -C "session hash for extended master secret"\ |
| 7686 | -S "session hash for extended master secret"\ |
| 7687 | -S "SSL - The handshake negotiation failed" \ |
| 7688 | -S "SSL - Unknown identity received" \ |
| 7689 | -S "SSL - Verification of the message MAC failed" |
| 7690 | |
| 7691 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7693 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7694 | "$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" \ |
| 7695 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7696 | psk_identity=def psk=beef" \ |
| 7697 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7698 | -C "session hash for extended master secret"\ |
| 7699 | -S "session hash for extended master secret"\ |
| 7700 | -S "SSL - The handshake negotiation failed" \ |
| 7701 | -S "SSL - Unknown identity received" \ |
| 7702 | -S "SSL - Verification of the message MAC failed" |
| 7703 | |
| 7704 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7706 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7707 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7708 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7709 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7710 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7711 | 0 \ |
| 7712 | -c "session hash for extended master secret"\ |
| 7713 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7714 | -S "SSL - The handshake negotiation failed" \ |
| 7715 | -S "SSL - Unknown identity received" \ |
| 7716 | -S "SSL - Verification of the message MAC failed" |
| 7717 | |
| 7718 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7720 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7721 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7722 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7723 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7724 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7725 | 0 \ |
| 7726 | -c "session hash for extended master secret"\ |
| 7727 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7728 | -S "SSL - The handshake negotiation failed" \ |
| 7729 | -S "SSL - Unknown identity received" \ |
| 7730 | -S "SSL - Verification of the message MAC failed" |
| 7731 | |
| 7732 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7734 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7735 | "$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" \ |
| 7736 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7737 | psk_identity=def psk=beef" \ |
| 7738 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7739 | -C "session hash for extended master secret"\ |
| 7740 | -S "session hash for extended master secret"\ |
| 7741 | -S "SSL - The handshake negotiation failed" \ |
| 7742 | -S "SSL - Unknown identity received" \ |
| 7743 | -S "SSL - Verification of the message MAC failed" |
| 7744 | |
| 7745 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7747 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7748 | "$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" \ |
| 7749 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7750 | psk_identity=def psk=beef" \ |
| 7751 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7752 | -C "session hash for extended master secret"\ |
| 7753 | -S "session hash for extended master secret"\ |
| 7754 | -S "SSL - The handshake negotiation failed" \ |
| 7755 | -S "SSL - Unknown identity received" \ |
| 7756 | -S "SSL - Verification of the message MAC failed" |
| 7757 | |
| 7758 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7760 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-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-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7763 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-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 | 85d46fe | 2022-04-19 12:47:48 +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 |
| 7773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7774 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7775 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7776 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7777 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7778 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7779 | 0 \ |
| 7780 | -c "session hash for extended master secret"\ |
| 7781 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7782 | -S "SSL - The handshake negotiation failed" \ |
| 7783 | -S "SSL - Unknown identity received" \ |
| 7784 | -S "SSL - Verification of the message MAC failed" |
| 7785 | |
| 7786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7788 | 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] | 7789 | "$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" \ |
| 7790 | "$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] | 7791 | psk_identity=def psk=beef" \ |
| 7792 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7793 | -C "session hash for extended master secret"\ |
| 7794 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7795 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7796 | -S "SSL - Unknown identity received" \ |
| 7797 | -S "SSL - Verification of the message MAC failed" |
| 7798 | |
| 7799 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7801 | 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] | 7802 | "$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" \ |
| 7803 | "$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] | 7804 | psk_identity=def psk=beef" \ |
| 7805 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7806 | -C "session hash for extended master secret"\ |
| 7807 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7808 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7809 | -S "SSL - Unknown identity received" \ |
| 7810 | -S "SSL - Verification of the message MAC failed" |
| 7811 | |
| 7812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7814 | 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] | 7815 | "$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" \ |
| 7816 | "$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] | 7817 | psk_identity=def psk=beef" \ |
| 7818 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7819 | -C "session hash for extended master secret"\ |
| 7820 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7821 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7822 | -S "SSL - Unknown identity received" \ |
| 7823 | -S "SSL - Verification of the message MAC failed" |
| 7824 | |
| 7825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7826 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7827 | 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] | 7828 | "$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" \ |
| 7829 | "$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] | 7830 | psk_identity=def psk=beef" \ |
| 7831 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7832 | -C "session hash for extended master secret"\ |
| 7833 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7834 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7835 | -S "SSL - Unknown identity received" \ |
| 7836 | -S "SSL - Verification of the message MAC failed" |
| 7837 | |
| 7838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7840 | 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] | 7841 | "$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" \ |
| 7842 | "$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] | 7843 | psk_identity=def psk=beef" \ |
| 7844 | 1 \ |
| 7845 | -s "SSL - Verification of the message MAC failed" |
| 7846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7848 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7849 | "$P_SRV" \ |
| 7850 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7851 | psk_identity=foo psk=abc123" \ |
| 7852 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7853 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7854 | -S "SSL - Unknown identity received" \ |
| 7855 | -S "SSL - Verification of the message MAC failed" |
| 7856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7858 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7859 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7860 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7861 | psk_identity=foo psk=abc123" \ |
| 7862 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7863 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7864 | -s "SSL - Unknown identity received" \ |
| 7865 | -S "SSL - Verification of the message MAC failed" |
| 7866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7868 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7869 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7870 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7871 | psk_identity=abc psk=dead" \ |
| 7872 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7873 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7874 | -S "SSL - Unknown identity received" \ |
| 7875 | -S "SSL - Verification of the message MAC failed" |
| 7876 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7878 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7879 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7880 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7881 | psk_identity=def psk=beef" \ |
| 7882 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7883 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7884 | -S "SSL - Unknown identity received" \ |
| 7885 | -S "SSL - Verification of the message MAC failed" |
| 7886 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7888 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7889 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7890 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7891 | psk_identity=ghi psk=beef" \ |
| 7892 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7893 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7894 | -s "SSL - Unknown identity received" \ |
| 7895 | -S "SSL - Verification of the message MAC failed" |
| 7896 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7898 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7899 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7900 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7901 | psk_identity=abc psk=beef" \ |
| 7902 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7903 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7904 | -S "SSL - Unknown identity received" \ |
| 7905 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7906 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7907 | # Tests for EC J-PAKE |
| 7908 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7909 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7911 | run_test "ECJPAKE: client not configured" \ |
| 7912 | "$P_SRV debug_level=3" \ |
| 7913 | "$P_CLI debug_level=3" \ |
| 7914 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7915 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7916 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7917 | -S "found ecjpake kkpp extension" \ |
| 7918 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7919 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7920 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7921 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7922 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7923 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7924 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7926 | run_test "ECJPAKE: server not configured" \ |
| 7927 | "$P_SRV debug_level=3" \ |
| 7928 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7929 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7930 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7931 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7932 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7933 | -s "found ecjpake kkpp extension" \ |
| 7934 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7935 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7936 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7937 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7938 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7939 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7940 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7942 | run_test "ECJPAKE: working, TLS" \ |
| 7943 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7944 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7945 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7946 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7947 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7948 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7949 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7950 | -s "found ecjpake kkpp extension" \ |
| 7951 | -S "skip ecjpake kkpp extension" \ |
| 7952 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7953 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7954 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7955 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7956 | -S "SSL - Verification of the message MAC failed" |
| 7957 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7958 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7959 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7961 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7962 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7963 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7964 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7965 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7966 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7967 | -s "SSL - Verification of the message MAC failed" |
| 7968 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7969 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7971 | run_test "ECJPAKE: working, DTLS" \ |
| 7972 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7973 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7974 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7975 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7976 | -c "re-using cached ecjpake parameters" \ |
| 7977 | -S "SSL - Verification of the message MAC failed" |
| 7978 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7979 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7981 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7982 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7983 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7984 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7985 | 0 \ |
| 7986 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7987 | -S "SSL - Verification of the message MAC failed" |
| 7988 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7989 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7990 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7992 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 7993 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7994 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 7995 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7996 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7997 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7998 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7999 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8000 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8001 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8003 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8004 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8005 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8006 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8007 | 0 |
| 8008 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8009 | # Test for ClientHello without extensions |
| 8010 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8011 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8013 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 8014 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8015 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8016 | 0 \ |
| 8017 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8018 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8019 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8020 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8021 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8023 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8024 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8025 | "$P_CLI request_size=100" \ |
| 8026 | 0 \ |
| 8027 | -s "Read from client: 100 bytes read$" |
| 8028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8030 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8031 | "$P_SRV buffer_size=100" \ |
| 8032 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8033 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8034 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8035 | |
| 8036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8037 | requires_max_content_len 200 |
| 8038 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8039 | "$P_SRV buffer_size=100" \ |
| 8040 | "$P_CLI request_size=200" \ |
| 8041 | 0 \ |
| 8042 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8043 | |
| 8044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8045 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8046 | "$P_SRV buffer_size=100" \ |
| 8047 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8048 | 0 \ |
| 8049 | -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] | 8050 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8051 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8052 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8053 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8054 | "$P_SRV force_version=tls12" \ |
| 8055 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8056 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8057 | 0 \ |
| 8058 | -s "Read from client: 1 bytes read" |
| 8059 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8060 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8061 | "$P_SRV force_version=tls12" \ |
| 8062 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8063 | 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] | 8064 | 0 \ |
| 8065 | -s "Read from client: 1 bytes read" |
| 8066 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8067 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8068 | "$P_SRV force_version=tls12" \ |
| 8069 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8070 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8071 | 0 \ |
| 8072 | -s "Read from client: 1 bytes read" |
| 8073 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8074 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8075 | "$P_SRV force_version=tls12" \ |
| 8076 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8077 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8078 | 0 \ |
| 8079 | -s "Read from client: 1 bytes read" |
| 8080 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8081 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8082 | "$P_SRV force_version=tls12" \ |
| 8083 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8084 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8085 | 0 \ |
| 8086 | -s "Read from client: 1 bytes read" |
| 8087 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8088 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8089 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8090 | "$P_SRV force_version=tls13" \ |
| 8091 | "$P_CLI request_size=1 \ |
| 8092 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8093 | 0 \ |
| 8094 | -s "Read from client: 1 bytes read" |
| 8095 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8096 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8097 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8098 | "$P_SRV force_version=tls13" \ |
| 8099 | "$P_CLI request_size=1 \ |
| 8100 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8101 | 0 \ |
| 8102 | -s "Read from client: 1 bytes read" |
| 8103 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8104 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8105 | |
| 8106 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8107 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8108 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8109 | "$P_CLI dtls=1 request_size=1 \ |
| 8110 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8111 | 0 \ |
| 8112 | -s "Read from client: 1 bytes read" |
| 8113 | |
| 8114 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8115 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8116 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8117 | "$P_CLI dtls=1 request_size=1 \ |
| 8118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8119 | 0 \ |
| 8120 | -s "Read from client: 1 bytes read" |
| 8121 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8122 | # Tests for small server packets |
| 8123 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8124 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8125 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8126 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8127 | 0 \ |
| 8128 | -c "Read from server: 1 bytes read" |
| 8129 | |
| 8130 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8131 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8132 | "$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] | 8133 | 0 \ |
| 8134 | -c "Read from server: 1 bytes read" |
| 8135 | |
| 8136 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8137 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8138 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8139 | 0 \ |
| 8140 | -c "Read from server: 1 bytes read" |
| 8141 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8142 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8143 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8144 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8145 | 0 \ |
| 8146 | -c "Read from server: 1 bytes read" |
| 8147 | |
| 8148 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8149 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8150 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8151 | 0 \ |
| 8152 | -c "Read from server: 1 bytes read" |
| 8153 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8154 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8155 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8156 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8157 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8158 | 0 \ |
| 8159 | -c "Read from server: 1 bytes read" |
| 8160 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8161 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8162 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8163 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8164 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8165 | 0 \ |
| 8166 | -c "Read from server: 1 bytes read" |
| 8167 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8168 | # Tests for small server packets in DTLS |
| 8169 | |
| 8170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8171 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8172 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8173 | "$P_CLI dtls=1 \ |
| 8174 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8175 | 0 \ |
| 8176 | -c "Read from server: 1 bytes read" |
| 8177 | |
| 8178 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8179 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8180 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8181 | "$P_CLI dtls=1 \ |
| 8182 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8183 | 0 \ |
| 8184 | -c "Read from server: 1 bytes read" |
| 8185 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8186 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8187 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8188 | # How many fragments do we expect to write $1 bytes? |
| 8189 | fragments_for_write() { |
| 8190 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8191 | } |
| 8192 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8193 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8194 | "$P_SRV force_version=tls12" \ |
| 8195 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8197 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8198 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8199 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8200 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8201 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8202 | "$P_SRV force_version=tls12" \ |
| 8203 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8204 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8205 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8206 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8207 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8208 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8209 | "$P_SRV force_version=tls12" \ |
| 8210 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8211 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8212 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8213 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8214 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8215 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8216 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8217 | "$P_SRV force_version=tls12" \ |
| 8218 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8219 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8220 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8221 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8222 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8223 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8224 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8225 | "$P_SRV force_version=tls12" \ |
| 8226 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8227 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8228 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8229 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8230 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8231 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8232 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8233 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8234 | "$P_SRV force_version=tls13" \ |
| 8235 | "$P_CLI request_size=16384 \ |
| 8236 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8237 | 0 \ |
| 8238 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8239 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8240 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8241 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8242 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8243 | "$P_SRV force_version=tls13" \ |
| 8244 | "$P_CLI request_size=16384 \ |
| 8245 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8246 | 0 \ |
| 8247 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8248 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8249 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8250 | # 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] | 8251 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8252 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8253 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8254 | 0 \ |
| 8255 | -c "Read from server: 16384 bytes read" |
| 8256 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8257 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8258 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8259 | "$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] | 8260 | 0 \ |
| 8261 | -s "16384 bytes written in 1 fragments" \ |
| 8262 | -c "Read from server: 16384 bytes read" |
| 8263 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8264 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8265 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8266 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8267 | 0 \ |
| 8268 | -c "Read from server: 16384 bytes read" |
| 8269 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8270 | 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] | 8271 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8272 | "$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] | 8273 | 0 \ |
| 8274 | -s "16384 bytes written in 1 fragments" \ |
| 8275 | -c "Read from server: 16384 bytes read" |
| 8276 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8277 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8278 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8279 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8280 | 0 \ |
| 8281 | -c "Read from server: 16384 bytes read" |
| 8282 | |
| 8283 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8284 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8285 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8286 | 0 \ |
| 8287 | -c "Read from server: 16384 bytes read" |
| 8288 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8289 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8290 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8291 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8292 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8293 | 0 \ |
| 8294 | -c "Read from server: 16384 bytes read" |
| 8295 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8296 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8297 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8298 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8299 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8300 | 0 \ |
| 8301 | -c "Read from server: 16384 bytes read" |
| 8302 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8303 | # Tests for restartable ECC |
| 8304 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8305 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8306 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8307 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8308 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8309 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8310 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8311 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8312 | "$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] | 8313 | 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] | 8314 | debug_level=1" \ |
| 8315 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8316 | -C "x509_verify_cert.*4b00" \ |
| 8317 | -C "mbedtls_pk_verify.*4b00" \ |
| 8318 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8319 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8320 | |
| 8321 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8322 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8324 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8325 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8326 | "$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] | 8327 | 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] | 8328 | debug_level=1 ec_max_ops=0" \ |
| 8329 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8330 | -C "x509_verify_cert.*4b00" \ |
| 8331 | -C "mbedtls_pk_verify.*4b00" \ |
| 8332 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8333 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8334 | |
| 8335 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8336 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8338 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8339 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8340 | "$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] | 8341 | 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] | 8342 | debug_level=1 ec_max_ops=65535" \ |
| 8343 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8344 | -C "x509_verify_cert.*4b00" \ |
| 8345 | -C "mbedtls_pk_verify.*4b00" \ |
| 8346 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8347 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8348 | |
| 8349 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8350 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8352 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8353 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8354 | "$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] | 8355 | 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] | 8356 | debug_level=1 ec_max_ops=1000" \ |
| 8357 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8358 | -c "x509_verify_cert.*4b00" \ |
| 8359 | -c "mbedtls_pk_verify.*4b00" \ |
| 8360 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8361 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8362 | |
| 8363 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8366 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8367 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8368 | crt_file=data_files/server5-badsign.crt \ |
| 8369 | key_file=data_files/server5.key" \ |
| 8370 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8371 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8372 | debug_level=1 ec_max_ops=1000" \ |
| 8373 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8374 | -c "x509_verify_cert.*4b00" \ |
| 8375 | -C "mbedtls_pk_verify.*4b00" \ |
| 8376 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8377 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8378 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8379 | -c "! mbedtls_ssl_handshake returned" \ |
| 8380 | -c "X509 - Certificate verification failed" |
| 8381 | |
| 8382 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8383 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8385 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8386 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8387 | crt_file=data_files/server5-badsign.crt \ |
| 8388 | key_file=data_files/server5.key" \ |
| 8389 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8390 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8391 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8392 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8393 | -c "x509_verify_cert.*4b00" \ |
| 8394 | -c "mbedtls_pk_verify.*4b00" \ |
| 8395 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8396 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8397 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8398 | -C "! mbedtls_ssl_handshake returned" \ |
| 8399 | -C "X509 - Certificate verification failed" |
| 8400 | |
| 8401 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8402 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8404 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8405 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8406 | crt_file=data_files/server5-badsign.crt \ |
| 8407 | key_file=data_files/server5.key" \ |
| 8408 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8409 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8410 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8411 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8412 | -C "x509_verify_cert.*4b00" \ |
| 8413 | -c "mbedtls_pk_verify.*4b00" \ |
| 8414 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8415 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8416 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8417 | -C "! mbedtls_ssl_handshake returned" \ |
| 8418 | -C "X509 - Certificate verification failed" |
| 8419 | |
| 8420 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8421 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8423 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8424 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8425 | "$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] | 8426 | 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] | 8427 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8428 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8429 | -c "x509_verify_cert.*4b00" \ |
| 8430 | -c "mbedtls_pk_verify.*4b00" \ |
| 8431 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8432 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8433 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8434 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8435 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8437 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8438 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8439 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8440 | debug_level=1 ec_max_ops=1000" \ |
| 8441 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8442 | -c "x509_verify_cert.*4b00" \ |
| 8443 | -c "mbedtls_pk_verify.*4b00" \ |
| 8444 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8445 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8446 | |
| 8447 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8448 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8450 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8451 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8452 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 8453 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 8454 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8455 | -C "x509_verify_cert.*4b00" \ |
| 8456 | -C "mbedtls_pk_verify.*4b00" \ |
| 8457 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8458 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8459 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8460 | # Tests of asynchronous private key support in SSL |
| 8461 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8462 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8464 | run_test "SSL async private: sign, delay=0" \ |
| 8465 | "$P_SRV \ |
| 8466 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8467 | "$P_CLI" \ |
| 8468 | 0 \ |
| 8469 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8470 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8471 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8472 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8474 | run_test "SSL async private: sign, delay=1" \ |
| 8475 | "$P_SRV \ |
| 8476 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8477 | "$P_CLI" \ |
| 8478 | 0 \ |
| 8479 | -s "Async sign callback: using key slot " \ |
| 8480 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8481 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8482 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8483 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8485 | run_test "SSL async private: sign, delay=2" \ |
| 8486 | "$P_SRV \ |
| 8487 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8488 | "$P_CLI" \ |
| 8489 | 0 \ |
| 8490 | -s "Async sign callback: using key slot " \ |
| 8491 | -U "Async sign callback: using key slot " \ |
| 8492 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8493 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8494 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8495 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8496 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8497 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8499 | run_test "SSL async private: sign, SNI" \ |
| 8500 | "$P_SRV debug_level=3 \ |
| 8501 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8502 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8503 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8504 | "$P_CLI server_name=polarssl.example" \ |
| 8505 | 0 \ |
| 8506 | -s "Async sign callback: using key slot " \ |
| 8507 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8508 | -s "parse ServerName extension" \ |
| 8509 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8510 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8511 | |
| 8512 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8514 | run_test "SSL async private: decrypt, delay=0" \ |
| 8515 | "$P_SRV \ |
| 8516 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8517 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8518 | 0 \ |
| 8519 | -s "Async decrypt callback: using key slot " \ |
| 8520 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8521 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8522 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8524 | run_test "SSL async private: decrypt, delay=1" \ |
| 8525 | "$P_SRV \ |
| 8526 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8527 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8528 | 0 \ |
| 8529 | -s "Async decrypt callback: using key slot " \ |
| 8530 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8531 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8532 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8533 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8535 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8536 | "$P_SRV psk=abc123 \ |
| 8537 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8538 | "$P_CLI psk=abc123 \ |
| 8539 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8540 | 0 \ |
| 8541 | -s "Async decrypt callback: using key slot " \ |
| 8542 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8543 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8544 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8546 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8547 | "$P_SRV psk=abc123 \ |
| 8548 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8549 | "$P_CLI psk=abc123 \ |
| 8550 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8551 | 0 \ |
| 8552 | -s "Async decrypt callback: using key slot " \ |
| 8553 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8554 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8555 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8556 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8558 | run_test "SSL async private: sign callback not present" \ |
| 8559 | "$P_SRV \ |
| 8560 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8561 | "$P_CLI; [ \$? -eq 1 ] && |
| 8562 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8563 | 0 \ |
| 8564 | -S "Async sign callback" \ |
| 8565 | -s "! mbedtls_ssl_handshake returned" \ |
| 8566 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8567 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8568 | -s "Successful connection" |
| 8569 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8572 | run_test "SSL async private: decrypt callback not present" \ |
| 8573 | "$P_SRV debug_level=1 \ |
| 8574 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8575 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8576 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8577 | 0 \ |
| 8578 | -S "Async decrypt callback" \ |
| 8579 | -s "! mbedtls_ssl_handshake returned" \ |
| 8580 | -s "got no RSA private key" \ |
| 8581 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8582 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8583 | |
| 8584 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8587 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8588 | "$P_SRV \ |
| 8589 | async_operations=s async_private_delay1=1 \ |
| 8590 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8591 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8592 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8593 | 0 \ |
| 8594 | -s "Async sign callback: using key slot 0," \ |
| 8595 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8596 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8597 | |
| 8598 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8599 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8601 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8602 | "$P_SRV \ |
| 8603 | async_operations=s async_private_delay2=1 \ |
| 8604 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8605 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8606 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8607 | 0 \ |
| 8608 | -s "Async sign callback: using key slot 0," \ |
| 8609 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8610 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8611 | |
| 8612 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8613 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8615 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8616 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8617 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8618 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8619 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8620 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8621 | 0 \ |
| 8622 | -s "Async sign callback: using key slot 1," \ |
| 8623 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8624 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8625 | |
| 8626 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8627 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8629 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8630 | "$P_SRV \ |
| 8631 | async_operations=s async_private_delay1=1 \ |
| 8632 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8633 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8634 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8635 | 0 \ |
| 8636 | -s "Async sign callback: no key matches this certificate." |
| 8637 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8638 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8640 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8641 | "$P_SRV \ |
| 8642 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8643 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8644 | "$P_CLI" \ |
| 8645 | 1 \ |
| 8646 | -s "Async sign callback: injected error" \ |
| 8647 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8648 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8649 | -s "! mbedtls_ssl_handshake returned" |
| 8650 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8651 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8653 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8654 | "$P_SRV \ |
| 8655 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8656 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8657 | "$P_CLI" \ |
| 8658 | 1 \ |
| 8659 | -s "Async sign callback: using key slot " \ |
| 8660 | -S "Async resume" \ |
| 8661 | -s "Async cancel" |
| 8662 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8663 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8665 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8666 | "$P_SRV \ |
| 8667 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8668 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8669 | "$P_CLI" \ |
| 8670 | 1 \ |
| 8671 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8672 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8673 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8674 | -s "! mbedtls_ssl_handshake returned" |
| 8675 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8676 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8678 | run_test "SSL async private: decrypt, error in start" \ |
| 8679 | "$P_SRV \ |
| 8680 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8681 | async_private_error=1" \ |
| 8682 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8683 | 1 \ |
| 8684 | -s "Async decrypt callback: injected error" \ |
| 8685 | -S "Async resume" \ |
| 8686 | -S "Async cancel" \ |
| 8687 | -s "! mbedtls_ssl_handshake returned" |
| 8688 | |
| 8689 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8691 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8692 | "$P_SRV \ |
| 8693 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8694 | async_private_error=2" \ |
| 8695 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8696 | 1 \ |
| 8697 | -s "Async decrypt callback: using key slot " \ |
| 8698 | -S "Async resume" \ |
| 8699 | -s "Async cancel" |
| 8700 | |
| 8701 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8703 | run_test "SSL async private: decrypt, error in resume" \ |
| 8704 | "$P_SRV \ |
| 8705 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8706 | async_private_error=3" \ |
| 8707 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8708 | 1 \ |
| 8709 | -s "Async decrypt callback: using key slot " \ |
| 8710 | -s "Async resume callback: decrypt done but injected error" \ |
| 8711 | -S "Async cancel" \ |
| 8712 | -s "! mbedtls_ssl_handshake returned" |
| 8713 | |
| 8714 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8716 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8717 | "$P_SRV \ |
| 8718 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8719 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8720 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8721 | 0 \ |
| 8722 | -s "Async cancel" \ |
| 8723 | -s "! mbedtls_ssl_handshake returned" \ |
| 8724 | -s "Async resume" \ |
| 8725 | -s "Successful connection" |
| 8726 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8727 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8729 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8730 | "$P_SRV \ |
| 8731 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8732 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8733 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8734 | 0 \ |
| 8735 | -s "! mbedtls_ssl_handshake returned" \ |
| 8736 | -s "Async resume" \ |
| 8737 | -s "Successful connection" |
| 8738 | |
| 8739 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8740 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8742 | 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] | 8743 | "$P_SRV \ |
| 8744 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8745 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8746 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8747 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8748 | [ \$? -eq 1 ] && |
| 8749 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8750 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8751 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8752 | -S "Async resume" \ |
| 8753 | -s "Async cancel" \ |
| 8754 | -s "! mbedtls_ssl_handshake returned" \ |
| 8755 | -s "Async sign callback: no key matches this certificate." \ |
| 8756 | -s "Successful connection" |
| 8757 | |
| 8758 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8759 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8761 | 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] | 8762 | "$P_SRV \ |
| 8763 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8764 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8765 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8766 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8767 | [ \$? -eq 1 ] && |
| 8768 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8769 | 0 \ |
| 8770 | -s "Async resume" \ |
| 8771 | -s "! mbedtls_ssl_handshake returned" \ |
| 8772 | -s "Async sign callback: no key matches this certificate." \ |
| 8773 | -s "Successful connection" |
| 8774 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8775 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8778 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8779 | "$P_SRV \ |
| 8780 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8781 | exchanges=2 renegotiation=1" \ |
| 8782 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8783 | 0 \ |
| 8784 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8785 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8786 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8787 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8790 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8791 | "$P_SRV \ |
| 8792 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8793 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8794 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8795 | 0 \ |
| 8796 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8797 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8798 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8799 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8802 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8803 | "$P_SRV \ |
| 8804 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8805 | exchanges=2 renegotiation=1" \ |
| 8806 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8807 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8808 | 0 \ |
| 8809 | -s "Async decrypt callback: using key slot " \ |
| 8810 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8811 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8812 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8815 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8816 | "$P_SRV \ |
| 8817 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8818 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8819 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8820 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8821 | 0 \ |
| 8822 | -s "Async decrypt callback: using key slot " \ |
| 8823 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8824 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8825 | # Tests for ECC extensions (rfc 4492) |
| 8826 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8827 | requires_config_enabled MBEDTLS_AES_C |
| 8828 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8829 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8832 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8833 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8834 | "$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] | 8835 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8836 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8837 | -C "client hello, adding supported_point_formats extension" \ |
| 8838 | -S "found supported elliptic curves extension" \ |
| 8839 | -S "found supported point formats extension" |
| 8840 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8841 | requires_config_enabled MBEDTLS_AES_C |
| 8842 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8843 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8844 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8846 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8847 | "$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] | 8848 | "$P_CLI debug_level=3" \ |
| 8849 | 0 \ |
| 8850 | -C "found supported_point_formats extension" \ |
| 8851 | -S "server hello, supported_point_formats extension" |
| 8852 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8853 | requires_config_enabled MBEDTLS_AES_C |
| 8854 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8855 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8856 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8858 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8859 | "$P_SRV debug_level=3" \ |
| 8860 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8861 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8862 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8863 | -c "client hello, adding supported_point_formats extension" \ |
| 8864 | -s "found supported elliptic curves extension" \ |
| 8865 | -s "found supported point formats extension" |
| 8866 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8867 | requires_config_enabled MBEDTLS_AES_C |
| 8868 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8869 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8870 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8872 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8873 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8874 | "$P_CLI debug_level=3" \ |
| 8875 | 0 \ |
| 8876 | -c "found supported_point_formats extension" \ |
| 8877 | -s "server hello, supported_point_formats extension" |
| 8878 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8879 | # Tests for DTLS HelloVerifyRequest |
| 8880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8882 | run_test "DTLS cookie: enabled" \ |
| 8883 | "$P_SRV dtls=1 debug_level=2" \ |
| 8884 | "$P_CLI dtls=1 debug_level=2" \ |
| 8885 | 0 \ |
| 8886 | -s "cookie verification failed" \ |
| 8887 | -s "cookie verification passed" \ |
| 8888 | -S "cookie verification skipped" \ |
| 8889 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8890 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8891 | -S "SSL - The requested feature is not available" |
| 8892 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8894 | run_test "DTLS cookie: disabled" \ |
| 8895 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8896 | "$P_CLI dtls=1 debug_level=2" \ |
| 8897 | 0 \ |
| 8898 | -S "cookie verification failed" \ |
| 8899 | -S "cookie verification passed" \ |
| 8900 | -s "cookie verification skipped" \ |
| 8901 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8902 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8903 | -S "SSL - The requested feature is not available" |
| 8904 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8906 | run_test "DTLS cookie: default (failing)" \ |
| 8907 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8908 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8909 | 1 \ |
| 8910 | -s "cookie verification failed" \ |
| 8911 | -S "cookie verification passed" \ |
| 8912 | -S "cookie verification skipped" \ |
| 8913 | -C "received hello verify request" \ |
| 8914 | -S "hello verification requested" \ |
| 8915 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8916 | |
| 8917 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8919 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8920 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8921 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8922 | 0 \ |
| 8923 | -s "cookie verification failed" \ |
| 8924 | -s "cookie verification passed" \ |
| 8925 | -S "cookie verification skipped" \ |
| 8926 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8927 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8928 | -S "SSL - The requested feature is not available" |
| 8929 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8931 | run_test "DTLS cookie: enabled, nbio" \ |
| 8932 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8933 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8934 | 0 \ |
| 8935 | -s "cookie verification failed" \ |
| 8936 | -s "cookie verification passed" \ |
| 8937 | -S "cookie verification skipped" \ |
| 8938 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8939 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8940 | -S "SSL - The requested feature is not available" |
| 8941 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8942 | # Tests for client reconnecting from the same port with DTLS |
| 8943 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8944 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8946 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8947 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8948 | "$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] | 8949 | 0 \ |
| 8950 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8951 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8952 | -S "Client initiated reconnection from same port" |
| 8953 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8954 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8956 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8957 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8958 | "$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] | 8959 | 0 \ |
| 8960 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8961 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8962 | -s "Client initiated reconnection from same port" |
| 8963 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8964 | 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] | 8965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8966 | 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] | 8967 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8968 | "$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] | 8969 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8970 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8971 | -s "Client initiated reconnection from same port" |
| 8972 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8973 | 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] | 8974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8975 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8976 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8977 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8978 | 0 \ |
| 8979 | -S "The operation timed out" \ |
| 8980 | -s "Client initiated reconnection from same port" |
| 8981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8983 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8984 | "$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] | 8985 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8986 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8987 | -s "The operation timed out" \ |
| 8988 | -S "Client initiated reconnection from same port" |
| 8989 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8991 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8992 | -p "$P_PXY inject_clihlo=1" \ |
| 8993 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8994 | "$P_CLI dtls=1 exchanges=2" \ |
| 8995 | 0 \ |
| 8996 | -s "possible client reconnect from the same port" \ |
| 8997 | -S "Client initiated reconnection from same port" |
| 8998 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8999 | # Tests for various cases of client authentication with DTLS |
| 9000 | # (focused on handshake flows and message parsing) |
| 9001 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9003 | run_test "DTLS client auth: required" \ |
| 9004 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9005 | "$P_CLI dtls=1" \ |
| 9006 | 0 \ |
| 9007 | -s "Verifying peer X.509 certificate... ok" |
| 9008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9010 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9011 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9012 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9013 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9014 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9017 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9018 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9019 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9020 | 0 \ |
| 9021 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9022 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9023 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9025 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9026 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9027 | "$P_CLI dtls=1 psk=abc124" \ |
| 9028 | 1 \ |
| 9029 | -s "SSL - Verification of the message MAC failed" \ |
| 9030 | -c "SSL - A fatal alert message was received from our peer" |
| 9031 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9032 | # Tests for receiving fragmented handshake messages with DTLS |
| 9033 | |
| 9034 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9036 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9037 | "$G_SRV -u --mtu 2048 -a" \ |
| 9038 | "$P_CLI dtls=1 debug_level=2" \ |
| 9039 | 0 \ |
| 9040 | -C "found fragmented DTLS handshake message" \ |
| 9041 | -C "error" |
| 9042 | |
| 9043 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9044 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9045 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9046 | "$G_SRV -u --mtu 512" \ |
| 9047 | "$P_CLI dtls=1 debug_level=2" \ |
| 9048 | 0 \ |
| 9049 | -c "found fragmented DTLS handshake message" \ |
| 9050 | -C "error" |
| 9051 | |
| 9052 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9054 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9055 | "$G_SRV -u --mtu 128" \ |
| 9056 | "$P_CLI dtls=1 debug_level=2" \ |
| 9057 | 0 \ |
| 9058 | -c "found fragmented DTLS handshake message" \ |
| 9059 | -C "error" |
| 9060 | |
| 9061 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9063 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9064 | "$G_SRV -u --mtu 128" \ |
| 9065 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9066 | 0 \ |
| 9067 | -c "found fragmented DTLS handshake message" \ |
| 9068 | -C "error" |
| 9069 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9070 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9073 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9074 | "$G_SRV -u --mtu 256" \ |
| 9075 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9076 | 0 \ |
| 9077 | -c "found fragmented DTLS handshake message" \ |
| 9078 | -c "client hello, adding renegotiation extension" \ |
| 9079 | -c "found renegotiation extension" \ |
| 9080 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9081 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9082 | -C "error" \ |
| 9083 | -s "Extra-header:" |
| 9084 | |
| 9085 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9086 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9088 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9089 | "$G_SRV -u --mtu 256" \ |
| 9090 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9091 | 0 \ |
| 9092 | -c "found fragmented DTLS handshake message" \ |
| 9093 | -c "client hello, adding renegotiation extension" \ |
| 9094 | -c "found renegotiation extension" \ |
| 9095 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9096 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9097 | -C "error" \ |
| 9098 | -s "Extra-header:" |
| 9099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9101 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9102 | "$O_SRV -dtls -mtu 2048" \ |
| 9103 | "$P_CLI dtls=1 debug_level=2" \ |
| 9104 | 0 \ |
| 9105 | -C "found fragmented DTLS handshake message" \ |
| 9106 | -C "error" |
| 9107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9109 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9110 | "$O_SRV -dtls -mtu 768" \ |
| 9111 | "$P_CLI dtls=1 debug_level=2" \ |
| 9112 | 0 \ |
| 9113 | -c "found fragmented DTLS handshake message" \ |
| 9114 | -C "error" |
| 9115 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9117 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9118 | "$O_SRV -dtls -mtu 256" \ |
| 9119 | "$P_CLI dtls=1 debug_level=2" \ |
| 9120 | 0 \ |
| 9121 | -c "found fragmented DTLS handshake message" \ |
| 9122 | -C "error" |
| 9123 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9125 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9126 | "$O_SRV -dtls -mtu 256" \ |
| 9127 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9128 | 0 \ |
| 9129 | -c "found fragmented DTLS handshake message" \ |
| 9130 | -C "error" |
| 9131 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9132 | # Tests for sending fragmented handshake messages with DTLS |
| 9133 | # |
| 9134 | # Use client auth when we need the client to send large messages, |
| 9135 | # and use large cert chains on both sides too (the long chains we have all use |
| 9136 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9137 | # Sizes reached (UDP payload): |
| 9138 | # - 2037B for server certificate |
| 9139 | # - 1542B for client certificate |
| 9140 | # - 1013B for newsessionticket |
| 9141 | # - all others below 512B |
| 9142 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9143 | |
| 9144 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9145 | requires_config_enabled MBEDTLS_RSA_C |
| 9146 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9147 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9148 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9150 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9151 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9152 | crt_file=data_files/server7_int-ca.crt \ |
| 9153 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9154 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9155 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9156 | "$P_CLI dtls=1 debug_level=2 \ |
| 9157 | crt_file=data_files/server8_int-ca2.crt \ |
| 9158 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9159 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9160 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9161 | 0 \ |
| 9162 | -S "found fragmented DTLS handshake message" \ |
| 9163 | -C "found fragmented DTLS handshake message" \ |
| 9164 | -C "error" |
| 9165 | |
| 9166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9167 | requires_config_enabled MBEDTLS_RSA_C |
| 9168 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9169 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9170 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9172 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9173 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9174 | crt_file=data_files/server7_int-ca.crt \ |
| 9175 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9176 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9177 | max_frag_len=1024" \ |
| 9178 | "$P_CLI dtls=1 debug_level=2 \ |
| 9179 | crt_file=data_files/server8_int-ca2.crt \ |
| 9180 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9181 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9182 | max_frag_len=2048" \ |
| 9183 | 0 \ |
| 9184 | -S "found fragmented DTLS handshake message" \ |
| 9185 | -c "found fragmented DTLS handshake message" \ |
| 9186 | -C "error" |
| 9187 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9188 | # With the MFL extension, the server has no way of forcing |
| 9189 | # the client to not exceed a certain MTU; hence, the following |
| 9190 | # test can't be replicated with an MTU proxy such as the one |
| 9191 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9192 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9193 | requires_config_enabled MBEDTLS_RSA_C |
| 9194 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9195 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9196 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9198 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9199 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9200 | crt_file=data_files/server7_int-ca.crt \ |
| 9201 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9202 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9203 | max_frag_len=512" \ |
| 9204 | "$P_CLI dtls=1 debug_level=2 \ |
| 9205 | crt_file=data_files/server8_int-ca2.crt \ |
| 9206 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9207 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9208 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9209 | 0 \ |
| 9210 | -S "found fragmented DTLS handshake message" \ |
| 9211 | -c "found fragmented DTLS handshake message" \ |
| 9212 | -C "error" |
| 9213 | |
| 9214 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9215 | requires_config_enabled MBEDTLS_RSA_C |
| 9216 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9218 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9220 | 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] | 9221 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9222 | crt_file=data_files/server7_int-ca.crt \ |
| 9223 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9224 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9225 | max_frag_len=2048" \ |
| 9226 | "$P_CLI dtls=1 debug_level=2 \ |
| 9227 | crt_file=data_files/server8_int-ca2.crt \ |
| 9228 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9229 | hs_timeout=2500-60000 \ |
| 9230 | max_frag_len=1024" \ |
| 9231 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9232 | -S "found fragmented DTLS handshake message" \ |
| 9233 | -c "found fragmented DTLS handshake message" \ |
| 9234 | -C "error" |
| 9235 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9236 | # While not required by the standard defining the MFL extension |
| 9237 | # (according to which it only applies to records, not to datagrams), |
| 9238 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9239 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9240 | # to the peer. |
| 9241 | # The next test checks that no datagrams significantly larger than the |
| 9242 | # negotiated MFL are sent. |
| 9243 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9244 | requires_config_enabled MBEDTLS_RSA_C |
| 9245 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9246 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9247 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9249 | 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] | 9250 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9251 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9252 | crt_file=data_files/server7_int-ca.crt \ |
| 9253 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9254 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9255 | max_frag_len=2048" \ |
| 9256 | "$P_CLI dtls=1 debug_level=2 \ |
| 9257 | crt_file=data_files/server8_int-ca2.crt \ |
| 9258 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9259 | hs_timeout=2500-60000 \ |
| 9260 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9261 | 0 \ |
| 9262 | -S "found fragmented DTLS handshake message" \ |
| 9263 | -c "found fragmented DTLS handshake message" \ |
| 9264 | -C "error" |
| 9265 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9266 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9267 | requires_config_enabled MBEDTLS_RSA_C |
| 9268 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9269 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9270 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9272 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9273 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9274 | crt_file=data_files/server7_int-ca.crt \ |
| 9275 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9276 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9277 | max_frag_len=2048" \ |
| 9278 | "$P_CLI dtls=1 debug_level=2 \ |
| 9279 | crt_file=data_files/server8_int-ca2.crt \ |
| 9280 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9281 | hs_timeout=2500-60000 \ |
| 9282 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9283 | 0 \ |
| 9284 | -s "found fragmented DTLS handshake message" \ |
| 9285 | -c "found fragmented DTLS handshake message" \ |
| 9286 | -C "error" |
| 9287 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9288 | # While not required by the standard defining the MFL extension |
| 9289 | # (according to which it only applies to records, not to datagrams), |
| 9290 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9291 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9292 | # to the peer. |
| 9293 | # The next test checks that no datagrams significantly larger than the |
| 9294 | # negotiated MFL are sent. |
| 9295 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9296 | requires_config_enabled MBEDTLS_RSA_C |
| 9297 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9298 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9299 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9301 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9302 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9303 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9304 | crt_file=data_files/server7_int-ca.crt \ |
| 9305 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9306 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9307 | max_frag_len=2048" \ |
| 9308 | "$P_CLI dtls=1 debug_level=2 \ |
| 9309 | crt_file=data_files/server8_int-ca2.crt \ |
| 9310 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9311 | hs_timeout=2500-60000 \ |
| 9312 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9313 | 0 \ |
| 9314 | -s "found fragmented DTLS handshake message" \ |
| 9315 | -c "found fragmented DTLS handshake message" \ |
| 9316 | -C "error" |
| 9317 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9318 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9319 | requires_config_enabled MBEDTLS_RSA_C |
| 9320 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9321 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9323 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9324 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9325 | crt_file=data_files/server7_int-ca.crt \ |
| 9326 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9327 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9328 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9329 | "$P_CLI dtls=1 debug_level=2 \ |
| 9330 | crt_file=data_files/server8_int-ca2.crt \ |
| 9331 | key_file=data_files/server8.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 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9334 | 0 \ |
| 9335 | -S "found fragmented DTLS handshake message" \ |
| 9336 | -C "found fragmented DTLS handshake message" \ |
| 9337 | -C "error" |
| 9338 | |
| 9339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9340 | requires_config_enabled MBEDTLS_RSA_C |
| 9341 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9342 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9344 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9345 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9346 | crt_file=data_files/server7_int-ca.crt \ |
| 9347 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9348 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9349 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9350 | "$P_CLI dtls=1 debug_level=2 \ |
| 9351 | crt_file=data_files/server8_int-ca2.crt \ |
| 9352 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9353 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9354 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9355 | 0 \ |
| 9356 | -s "found fragmented DTLS handshake message" \ |
| 9357 | -C "found fragmented DTLS handshake message" \ |
| 9358 | -C "error" |
| 9359 | |
| 9360 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9361 | requires_config_enabled MBEDTLS_RSA_C |
| 9362 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9363 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9365 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9366 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9367 | crt_file=data_files/server7_int-ca.crt \ |
| 9368 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9369 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9370 | mtu=512" \ |
| 9371 | "$P_CLI dtls=1 debug_level=2 \ |
| 9372 | crt_file=data_files/server8_int-ca2.crt \ |
| 9373 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9374 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9375 | mtu=2048" \ |
| 9376 | 0 \ |
| 9377 | -S "found fragmented DTLS handshake message" \ |
| 9378 | -c "found fragmented DTLS handshake message" \ |
| 9379 | -C "error" |
| 9380 | |
| 9381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9382 | requires_config_enabled MBEDTLS_RSA_C |
| 9383 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9384 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9386 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9387 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9388 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9389 | crt_file=data_files/server7_int-ca.crt \ |
| 9390 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9391 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9392 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9393 | "$P_CLI dtls=1 debug_level=2 \ |
| 9394 | crt_file=data_files/server8_int-ca2.crt \ |
| 9395 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9396 | hs_timeout=2500-60000 \ |
| 9397 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9398 | 0 \ |
| 9399 | -s "found fragmented DTLS handshake message" \ |
| 9400 | -c "found fragmented DTLS handshake message" \ |
| 9401 | -C "error" |
| 9402 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9403 | # 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] | 9404 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9405 | requires_config_enabled MBEDTLS_RSA_C |
| 9406 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9407 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9408 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9409 | requires_config_enabled MBEDTLS_AES_C |
| 9410 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9411 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9413 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9414 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9415 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9416 | crt_file=data_files/server7_int-ca.crt \ |
| 9417 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9418 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9419 | mtu=512" \ |
| 9420 | "$P_CLI dtls=1 debug_level=2 \ |
| 9421 | crt_file=data_files/server8_int-ca2.crt \ |
| 9422 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9423 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9424 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9425 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9426 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9427 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9428 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9429 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9430 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9431 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9432 | # 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] | 9433 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9434 | # retransmissions, but in some cases (like both the server and client using |
| 9435 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9436 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9437 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9438 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9439 | requires_config_enabled MBEDTLS_RSA_C |
| 9440 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9441 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9442 | requires_config_enabled MBEDTLS_AES_C |
| 9443 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9444 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9446 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9447 | -p "$P_PXY mtu=508" \ |
| 9448 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9449 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9450 | key_file=data_files/server7.key \ |
| 9451 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9452 | "$P_CLI dtls=1 debug_level=2 \ |
| 9453 | crt_file=data_files/server8_int-ca2.crt \ |
| 9454 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9455 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9456 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9457 | 0 \ |
| 9458 | -s "found fragmented DTLS handshake message" \ |
| 9459 | -c "found fragmented DTLS handshake message" \ |
| 9460 | -C "error" |
| 9461 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9462 | # 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] | 9463 | only_with_valgrind |
| 9464 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9465 | requires_config_enabled MBEDTLS_RSA_C |
| 9466 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9467 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9468 | requires_config_enabled MBEDTLS_AES_C |
| 9469 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9470 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9472 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9473 | -p "$P_PXY mtu=508" \ |
| 9474 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9475 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9476 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9477 | hs_timeout=250-10000" \ |
| 9478 | "$P_CLI dtls=1 debug_level=2 \ |
| 9479 | crt_file=data_files/server8_int-ca2.crt \ |
| 9480 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9481 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9482 | hs_timeout=250-10000" \ |
| 9483 | 0 \ |
| 9484 | -s "found fragmented DTLS handshake message" \ |
| 9485 | -c "found fragmented DTLS handshake message" \ |
| 9486 | -C "error" |
| 9487 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9488 | # 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] | 9489 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9490 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9491 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9492 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9493 | requires_config_enabled MBEDTLS_RSA_C |
| 9494 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9495 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9497 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9498 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9499 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9500 | crt_file=data_files/server7_int-ca.crt \ |
| 9501 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9502 | hs_timeout=10000-60000 \ |
| 9503 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9504 | "$P_CLI dtls=1 debug_level=2 \ |
| 9505 | crt_file=data_files/server8_int-ca2.crt \ |
| 9506 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9507 | hs_timeout=10000-60000 \ |
| 9508 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9509 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9510 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9511 | -s "found fragmented DTLS handshake message" \ |
| 9512 | -c "found fragmented DTLS handshake message" \ |
| 9513 | -C "error" |
| 9514 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9515 | # 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] | 9516 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9517 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9518 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9519 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9520 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9521 | requires_config_enabled MBEDTLS_RSA_C |
| 9522 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9523 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9524 | requires_config_enabled MBEDTLS_AES_C |
| 9525 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9526 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9528 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9529 | -p "$P_PXY mtu=512" \ |
| 9530 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9531 | crt_file=data_files/server7_int-ca.crt \ |
| 9532 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9533 | hs_timeout=10000-60000 \ |
| 9534 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9535 | "$P_CLI dtls=1 debug_level=2 \ |
| 9536 | crt_file=data_files/server8_int-ca2.crt \ |
| 9537 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9538 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9539 | hs_timeout=10000-60000 \ |
| 9540 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9541 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9542 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9543 | -s "found fragmented DTLS handshake message" \ |
| 9544 | -c "found fragmented DTLS handshake message" \ |
| 9545 | -C "error" |
| 9546 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9547 | not_with_valgrind # spurious autoreduction due to timeout |
| 9548 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9549 | requires_config_enabled MBEDTLS_RSA_C |
| 9550 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9551 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9553 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9554 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9555 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9556 | crt_file=data_files/server7_int-ca.crt \ |
| 9557 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9558 | hs_timeout=10000-60000 \ |
| 9559 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9560 | "$P_CLI dtls=1 debug_level=2 \ |
| 9561 | crt_file=data_files/server8_int-ca2.crt \ |
| 9562 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9563 | hs_timeout=10000-60000 \ |
| 9564 | mtu=1024 nbio=2" \ |
| 9565 | 0 \ |
| 9566 | -S "autoreduction" \ |
| 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 | not_with_valgrind # spurious autoreduction due to timeout |
| 9573 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9574 | requires_config_enabled MBEDTLS_RSA_C |
| 9575 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9576 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9577 | requires_config_enabled MBEDTLS_AES_C |
| 9578 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9579 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9581 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9582 | -p "$P_PXY mtu=512" \ |
| 9583 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9584 | crt_file=data_files/server7_int-ca.crt \ |
| 9585 | key_file=data_files/server7.key \ |
| 9586 | hs_timeout=10000-60000 \ |
| 9587 | mtu=512 nbio=2" \ |
| 9588 | "$P_CLI dtls=1 debug_level=2 \ |
| 9589 | crt_file=data_files/server8_int-ca2.crt \ |
| 9590 | key_file=data_files/server8.key \ |
| 9591 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9592 | hs_timeout=10000-60000 \ |
| 9593 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9594 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9595 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9596 | -s "found fragmented DTLS handshake message" \ |
| 9597 | -c "found fragmented DTLS handshake message" \ |
| 9598 | -C "error" |
| 9599 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9600 | # 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] | 9601 | # This ensures things still work after session_reset(). |
| 9602 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9603 | # Since we don't support reading fragmented ClientHello yet, |
| 9604 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9605 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9606 | # An autoreduction on the client-side might happen if the server is |
| 9607 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9608 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9609 | # resumed listening, which would result in a spurious autoreduction. |
| 9610 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9611 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9612 | requires_config_enabled MBEDTLS_RSA_C |
| 9613 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9614 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9615 | requires_config_enabled MBEDTLS_AES_C |
| 9616 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9617 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9619 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9620 | -p "$P_PXY mtu=1450" \ |
| 9621 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9622 | crt_file=data_files/server7_int-ca.crt \ |
| 9623 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9624 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9625 | mtu=1450" \ |
| 9626 | "$P_CLI dtls=1 debug_level=2 \ |
| 9627 | crt_file=data_files/server8_int-ca2.crt \ |
| 9628 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9629 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9630 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9631 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9632 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9633 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9634 | -s "found fragmented DTLS handshake message" \ |
| 9635 | -c "found fragmented DTLS handshake message" \ |
| 9636 | -C "error" |
| 9637 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9638 | # An autoreduction on the client-side might happen if the server is |
| 9639 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9640 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9642 | requires_config_enabled MBEDTLS_RSA_C |
| 9643 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9644 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9645 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9646 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9647 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9648 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9650 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9651 | -p "$P_PXY mtu=512" \ |
| 9652 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9653 | crt_file=data_files/server7_int-ca.crt \ |
| 9654 | key_file=data_files/server7.key \ |
| 9655 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9656 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9657 | mtu=512" \ |
| 9658 | "$P_CLI dtls=1 debug_level=2 \ |
| 9659 | crt_file=data_files/server8_int-ca2.crt \ |
| 9660 | key_file=data_files/server8.key \ |
| 9661 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9662 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9663 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9664 | mtu=512" \ |
| 9665 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9666 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9667 | -s "found fragmented DTLS handshake message" \ |
| 9668 | -c "found fragmented DTLS handshake message" \ |
| 9669 | -C "error" |
| 9670 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9671 | # An autoreduction on the client-side might happen if the server is |
| 9672 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9673 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9674 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9675 | requires_config_enabled MBEDTLS_RSA_C |
| 9676 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9677 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9678 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 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 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9684 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9685 | -p "$P_PXY mtu=512" \ |
| 9686 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9687 | crt_file=data_files/server7_int-ca.crt \ |
| 9688 | key_file=data_files/server7.key \ |
| 9689 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9690 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9691 | mtu=512" \ |
| 9692 | "$P_CLI dtls=1 debug_level=2 \ |
| 9693 | crt_file=data_files/server8_int-ca2.crt \ |
| 9694 | key_file=data_files/server8.key \ |
| 9695 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9696 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9697 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9698 | mtu=512" \ |
| 9699 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9700 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9701 | -s "found fragmented DTLS handshake message" \ |
| 9702 | -c "found fragmented DTLS handshake message" \ |
| 9703 | -C "error" |
| 9704 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9705 | # An autoreduction on the client-side might happen if the server is |
| 9706 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9707 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9708 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9709 | requires_config_enabled MBEDTLS_RSA_C |
| 9710 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9711 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9712 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9714 | requires_config_enabled MBEDTLS_AES_C |
| 9715 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9716 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9718 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9719 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9720 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9721 | crt_file=data_files/server7_int-ca.crt \ |
| 9722 | key_file=data_files/server7.key \ |
| 9723 | exchanges=2 renegotiation=1 \ |
| 9724 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9725 | hs_timeout=10000-60000 \ |
| 9726 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9727 | "$P_CLI dtls=1 debug_level=2 \ |
| 9728 | crt_file=data_files/server8_int-ca2.crt \ |
| 9729 | key_file=data_files/server8.key \ |
| 9730 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9731 | hs_timeout=10000-60000 \ |
| 9732 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9733 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9734 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9735 | -s "found fragmented DTLS handshake message" \ |
| 9736 | -c "found fragmented DTLS handshake message" \ |
| 9737 | -C "error" |
| 9738 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9739 | # An autoreduction on the client-side might happen if the server is |
| 9740 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9741 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9742 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9743 | requires_config_enabled MBEDTLS_RSA_C |
| 9744 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9745 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9746 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9747 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9748 | requires_config_enabled MBEDTLS_AES_C |
| 9749 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9750 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9751 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9753 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9754 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9755 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9756 | crt_file=data_files/server7_int-ca.crt \ |
| 9757 | key_file=data_files/server7.key \ |
| 9758 | exchanges=2 renegotiation=1 \ |
| 9759 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9760 | hs_timeout=10000-60000 \ |
| 9761 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9762 | "$P_CLI dtls=1 debug_level=2 \ |
| 9763 | crt_file=data_files/server8_int-ca2.crt \ |
| 9764 | key_file=data_files/server8.key \ |
| 9765 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9766 | hs_timeout=10000-60000 \ |
| 9767 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9768 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9769 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9770 | -s "found fragmented DTLS handshake message" \ |
| 9771 | -c "found fragmented DTLS handshake message" \ |
| 9772 | -C "error" |
| 9773 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9774 | # An autoreduction on the client-side might happen if the server is |
| 9775 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9776 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9777 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9778 | requires_config_enabled MBEDTLS_RSA_C |
| 9779 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9780 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9781 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9783 | requires_config_enabled MBEDTLS_AES_C |
| 9784 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9785 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9787 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9788 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9789 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9790 | crt_file=data_files/server7_int-ca.crt \ |
| 9791 | key_file=data_files/server7.key \ |
| 9792 | exchanges=2 renegotiation=1 \ |
| 9793 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9794 | hs_timeout=10000-60000 \ |
| 9795 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9796 | "$P_CLI dtls=1 debug_level=2 \ |
| 9797 | crt_file=data_files/server8_int-ca2.crt \ |
| 9798 | key_file=data_files/server8.key \ |
| 9799 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9800 | hs_timeout=10000-60000 \ |
| 9801 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9802 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9803 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9804 | -s "found fragmented DTLS handshake message" \ |
| 9805 | -c "found fragmented DTLS handshake message" \ |
| 9806 | -C "error" |
| 9807 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9808 | # 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] | 9809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9810 | requires_config_enabled MBEDTLS_RSA_C |
| 9811 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9812 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9813 | requires_config_enabled MBEDTLS_AES_C |
| 9814 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9815 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9816 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9818 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9819 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9820 | "$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] | 9821 | crt_file=data_files/server7_int-ca.crt \ |
| 9822 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9823 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9824 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9825 | crt_file=data_files/server8_int-ca2.crt \ |
| 9826 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9827 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9828 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9829 | 0 \ |
| 9830 | -s "found fragmented DTLS handshake message" \ |
| 9831 | -c "found fragmented DTLS handshake message" \ |
| 9832 | -C "error" |
| 9833 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9834 | # 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] | 9835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9836 | requires_config_enabled MBEDTLS_RSA_C |
| 9837 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9838 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9839 | requires_config_enabled MBEDTLS_AES_C |
| 9840 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9841 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9842 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9844 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9845 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9846 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9847 | crt_file=data_files/server7_int-ca.crt \ |
| 9848 | key_file=data_files/server7.key \ |
| 9849 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9850 | "$P_CLI dtls=1 debug_level=2 \ |
| 9851 | crt_file=data_files/server8_int-ca2.crt \ |
| 9852 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9853 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9854 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9855 | 0 \ |
| 9856 | -s "found fragmented DTLS handshake message" \ |
| 9857 | -c "found fragmented DTLS handshake message" \ |
| 9858 | -C "error" |
| 9859 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9860 | # interop tests for DTLS fragmentating with reliable connection |
| 9861 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9862 | # here and below we just want to test that the we fragment in a way that |
| 9863 | # pleases other implementations, so we don't need the peer to fragment |
| 9864 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9865 | requires_config_enabled MBEDTLS_RSA_C |
| 9866 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9867 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9868 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9869 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9870 | "$G_SRV -u" \ |
| 9871 | "$P_CLI dtls=1 debug_level=2 \ |
| 9872 | crt_file=data_files/server8_int-ca2.crt \ |
| 9873 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9874 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9875 | 0 \ |
| 9876 | -c "fragmenting handshake message" \ |
| 9877 | -C "error" |
| 9878 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9879 | # We use --insecure for the GnuTLS client because it expects |
| 9880 | # the hostname / IP it connects to to be the name used in the |
| 9881 | # certificate obtained from the server. Here, however, it |
| 9882 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9883 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9884 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9885 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9886 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9887 | requires_config_enabled MBEDTLS_RSA_C |
| 9888 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9889 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9890 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9891 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9892 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9893 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9894 | crt_file=data_files/server7_int-ca.crt \ |
| 9895 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9896 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9897 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9898 | 0 \ |
| 9899 | -s "fragmenting handshake message" |
| 9900 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9901 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9902 | requires_config_enabled MBEDTLS_RSA_C |
| 9903 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9904 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9905 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9906 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9907 | "$P_CLI dtls=1 debug_level=2 \ |
| 9908 | crt_file=data_files/server8_int-ca2.crt \ |
| 9909 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9910 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9911 | 0 \ |
| 9912 | -c "fragmenting handshake message" \ |
| 9913 | -C "error" |
| 9914 | |
| 9915 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9916 | requires_config_enabled MBEDTLS_RSA_C |
| 9917 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9918 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9919 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9920 | "$P_SRV dtls=1 debug_level=2 \ |
| 9921 | crt_file=data_files/server7_int-ca.crt \ |
| 9922 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9923 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9924 | "$O_CLI -dtls1_2" \ |
| 9925 | 0 \ |
| 9926 | -s "fragmenting handshake message" |
| 9927 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9928 | # interop tests for DTLS fragmentating with unreliable connection |
| 9929 | # |
| 9930 | # again we just want to test that the we fragment in a way that |
| 9931 | # pleases other implementations, so we don't need the peer to fragment |
| 9932 | requires_gnutls_next |
| 9933 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9934 | requires_config_enabled MBEDTLS_RSA_C |
| 9935 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9936 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9937 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9938 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9939 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9940 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9941 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9942 | crt_file=data_files/server8_int-ca2.crt \ |
| 9943 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9944 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9945 | 0 \ |
| 9946 | -c "fragmenting handshake message" \ |
| 9947 | -C "error" |
| 9948 | |
| 9949 | requires_gnutls_next |
| 9950 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9951 | requires_config_enabled MBEDTLS_RSA_C |
| 9952 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9953 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9954 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9955 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9956 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9957 | "$P_SRV dtls=1 debug_level=2 \ |
| 9958 | crt_file=data_files/server7_int-ca.crt \ |
| 9959 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9960 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9961 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9962 | 0 \ |
| 9963 | -s "fragmenting handshake message" |
| 9964 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 9965 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 9966 | ## 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] | 9967 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9969 | requires_config_enabled MBEDTLS_RSA_C |
| 9970 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9971 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9972 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9973 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9974 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 9975 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9976 | "$P_CLI dtls=1 debug_level=2 \ |
| 9977 | crt_file=data_files/server8_int-ca2.crt \ |
| 9978 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9979 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9980 | 0 \ |
| 9981 | -c "fragmenting handshake message" \ |
| 9982 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9983 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 9984 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 9985 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 9986 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9988 | requires_config_enabled MBEDTLS_RSA_C |
| 9989 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9990 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9991 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9992 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9993 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9994 | "$P_SRV dtls=1 debug_level=2 \ |
| 9995 | crt_file=data_files/server7_int-ca.crt \ |
| 9996 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9997 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9998 | "$O_CLI -dtls1_2" \ |
| 9999 | 0 \ |
| 10000 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10001 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10002 | # Tests for DTLS-SRTP (RFC 5764) |
| 10003 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10005 | run_test "DTLS-SRTP all profiles supported" \ |
| 10006 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10007 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10008 | 0 \ |
| 10009 | -s "found use_srtp extension" \ |
| 10010 | -s "found srtp profile" \ |
| 10011 | -s "selected srtp profile" \ |
| 10012 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10013 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10014 | -c "client hello, adding use_srtp extension" \ |
| 10015 | -c "found use_srtp extension" \ |
| 10016 | -c "found srtp profile" \ |
| 10017 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10018 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10019 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10020 | -C "error" |
| 10021 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10022 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10023 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10025 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10026 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10027 | "$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] | 10028 | 0 \ |
| 10029 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10030 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10031 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10032 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10033 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10034 | -c "client hello, adding use_srtp extension" \ |
| 10035 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10036 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10037 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10038 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10039 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10040 | -C "error" |
| 10041 | |
| 10042 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10044 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10045 | "$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] | 10046 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10047 | 0 \ |
| 10048 | -s "found use_srtp extension" \ |
| 10049 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10050 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10051 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10052 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10053 | -c "client hello, adding use_srtp extension" \ |
| 10054 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10055 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10056 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10057 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10058 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10059 | -C "error" |
| 10060 | |
| 10061 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10063 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10064 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10065 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10066 | 0 \ |
| 10067 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10068 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10069 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10070 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10071 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10072 | -c "client hello, adding use_srtp extension" \ |
| 10073 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10074 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10075 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10076 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10077 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10078 | -C "error" |
| 10079 | |
| 10080 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10082 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10083 | "$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] | 10084 | "$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] | 10085 | 0 \ |
| 10086 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10087 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10088 | -S "selected srtp profile" \ |
| 10089 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10090 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10091 | -c "client hello, adding use_srtp extension" \ |
| 10092 | -C "found use_srtp extension" \ |
| 10093 | -C "found srtp profile" \ |
| 10094 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10095 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10096 | -C "error" |
| 10097 | |
| 10098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10100 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10101 | "$P_SRV dtls=1 debug_level=3" \ |
| 10102 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10103 | 0 \ |
| 10104 | -s "found use_srtp extension" \ |
| 10105 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10106 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10107 | -c "client hello, adding use_srtp extension" \ |
| 10108 | -C "found use_srtp extension" \ |
| 10109 | -C "found srtp profile" \ |
| 10110 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10111 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10112 | -C "error" |
| 10113 | |
| 10114 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10116 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10117 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10118 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10119 | 0 \ |
| 10120 | -s "found use_srtp extension" \ |
| 10121 | -s "found srtp profile" \ |
| 10122 | -s "selected srtp profile" \ |
| 10123 | -s "server hello, adding use_srtp extension" \ |
| 10124 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10125 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10126 | -c "client hello, adding use_srtp extension" \ |
| 10127 | -c "found use_srtp extension" \ |
| 10128 | -c "found srtp profile" \ |
| 10129 | -c "selected srtp profile" \ |
| 10130 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10131 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10132 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10133 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10134 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10135 | -C "error" |
| 10136 | |
| 10137 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10139 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10140 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10141 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10142 | 0 \ |
| 10143 | -s "found use_srtp extension" \ |
| 10144 | -s "found srtp profile" \ |
| 10145 | -s "selected srtp profile" \ |
| 10146 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10147 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10148 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10149 | -S "dumping 'using mki' (8 bytes)" \ |
| 10150 | -c "client hello, adding use_srtp extension" \ |
| 10151 | -c "found use_srtp extension" \ |
| 10152 | -c "found srtp profile" \ |
| 10153 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10154 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10155 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10156 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10157 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10158 | -C "dumping 'received mki' (8 bytes)" \ |
| 10159 | -C "error" |
| 10160 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 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 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10163 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10164 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10165 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10166 | 0 \ |
| 10167 | -s "found use_srtp extension" \ |
| 10168 | -s "found srtp profile" \ |
| 10169 | -s "selected srtp profile" \ |
| 10170 | -s "server hello, adding use_srtp extension" \ |
| 10171 | -s "DTLS-SRTP key material is"\ |
| 10172 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10173 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10174 | |
| 10175 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10177 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10178 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10179 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10180 | 0 \ |
| 10181 | -s "found use_srtp extension" \ |
| 10182 | -s "found srtp profile" \ |
| 10183 | -s "selected srtp profile" \ |
| 10184 | -s "server hello, adding use_srtp extension" \ |
| 10185 | -s "DTLS-SRTP key material is"\ |
| 10186 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10187 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10188 | |
| 10189 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10191 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10192 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10193 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10194 | 0 \ |
| 10195 | -s "found use_srtp extension" \ |
| 10196 | -s "found srtp profile" \ |
| 10197 | -s "selected srtp profile" \ |
| 10198 | -s "server hello, adding use_srtp extension" \ |
| 10199 | -s "DTLS-SRTP key material is"\ |
| 10200 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10201 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10202 | |
| 10203 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10205 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10206 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10207 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10208 | 0 \ |
| 10209 | -s "found use_srtp extension" \ |
| 10210 | -s "found srtp profile" \ |
| 10211 | -s "selected srtp profile" \ |
| 10212 | -s "server hello, adding use_srtp extension" \ |
| 10213 | -s "DTLS-SRTP key material is"\ |
| 10214 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10215 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 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 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10219 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10220 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10221 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10222 | 0 \ |
| 10223 | -s "found use_srtp extension" \ |
| 10224 | -s "found srtp profile" \ |
| 10225 | -s "selected srtp profile" \ |
| 10226 | -s "server hello, adding use_srtp extension" \ |
| 10227 | -s "DTLS-SRTP key material is"\ |
| 10228 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10229 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10230 | |
| 10231 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10233 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10234 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10235 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10236 | 0 \ |
| 10237 | -s "found use_srtp extension" \ |
| 10238 | -s "found srtp profile" \ |
| 10239 | -S "selected srtp profile" \ |
| 10240 | -S "server hello, adding use_srtp extension" \ |
| 10241 | -S "DTLS-SRTP key material is"\ |
| 10242 | -C "SRTP Extension negotiated, profile" |
| 10243 | |
| 10244 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10246 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10247 | "$P_SRV dtls=1 debug_level=3" \ |
| 10248 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10249 | 0 \ |
| 10250 | -s "found use_srtp extension" \ |
| 10251 | -S "server hello, adding use_srtp extension" \ |
| 10252 | -S "DTLS-SRTP key material is"\ |
| 10253 | -C "SRTP Extension negotiated, profile" |
| 10254 | |
| 10255 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10257 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10258 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10259 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10260 | 0 \ |
| 10261 | -c "client hello, adding use_srtp extension" \ |
| 10262 | -c "found use_srtp extension" \ |
| 10263 | -c "found srtp profile" \ |
| 10264 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10265 | -c "DTLS-SRTP key material is"\ |
| 10266 | -C "error" |
| 10267 | |
| 10268 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10270 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10271 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10272 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10273 | 0 \ |
| 10274 | -c "client hello, adding use_srtp extension" \ |
| 10275 | -c "found use_srtp extension" \ |
| 10276 | -c "found srtp profile" \ |
| 10277 | -c "selected srtp profile" \ |
| 10278 | -c "DTLS-SRTP key material is"\ |
| 10279 | -C "error" |
| 10280 | |
| 10281 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10283 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10284 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10285 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10286 | 0 \ |
| 10287 | -c "client hello, adding use_srtp extension" \ |
| 10288 | -c "found use_srtp extension" \ |
| 10289 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10290 | -c "selected srtp profile" \ |
| 10291 | -c "DTLS-SRTP key material is"\ |
| 10292 | -C "error" |
| 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 one profile. Client supports all profiles. openssl server." \ |
| 10297 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10298 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10299 | 0 \ |
| 10300 | -c "client hello, adding use_srtp extension" \ |
| 10301 | -c "found use_srtp extension" \ |
| 10302 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10303 | -c "selected srtp profile" \ |
| 10304 | -c "DTLS-SRTP key material is"\ |
| 10305 | -C "error" |
| 10306 | |
| 10307 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10309 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10310 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10311 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10312 | 0 \ |
| 10313 | -c "client hello, adding use_srtp extension" \ |
| 10314 | -c "found use_srtp extension" \ |
| 10315 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10316 | -c "selected srtp profile" \ |
| 10317 | -c "DTLS-SRTP key material is"\ |
| 10318 | -C "error" |
| 10319 | |
| 10320 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10322 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10323 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10324 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10325 | 0 \ |
| 10326 | -c "client hello, adding use_srtp extension" \ |
| 10327 | -C "found use_srtp extension" \ |
| 10328 | -C "found srtp profile" \ |
| 10329 | -C "selected srtp profile" \ |
| 10330 | -C "DTLS-SRTP key material is"\ |
| 10331 | -C "error" |
| 10332 | |
| 10333 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10335 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10336 | "$O_SRV -dtls" \ |
| 10337 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10338 | 0 \ |
| 10339 | -c "client hello, adding use_srtp extension" \ |
| 10340 | -C "found use_srtp extension" \ |
| 10341 | -C "found srtp profile" \ |
| 10342 | -C "selected srtp profile" \ |
| 10343 | -C "DTLS-SRTP key material is"\ |
| 10344 | -C "error" |
| 10345 | |
| 10346 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10348 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10349 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10350 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10351 | 0 \ |
| 10352 | -c "client hello, adding use_srtp extension" \ |
| 10353 | -c "found use_srtp extension" \ |
| 10354 | -c "found srtp profile" \ |
| 10355 | -c "selected srtp profile" \ |
| 10356 | -c "DTLS-SRTP key material is"\ |
| 10357 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10358 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10359 | -C "dumping 'received mki' (8 bytes)" \ |
| 10360 | -C "error" |
| 10361 | |
| 10362 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10363 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10365 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10366 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10367 | "$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] | 10368 | 0 \ |
| 10369 | -s "found use_srtp extension" \ |
| 10370 | -s "found srtp profile" \ |
| 10371 | -s "selected srtp profile" \ |
| 10372 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10373 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10374 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10375 | |
| 10376 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10377 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10379 | 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] | 10380 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10381 | "$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] | 10382 | 0 \ |
| 10383 | -s "found use_srtp extension" \ |
| 10384 | -s "found srtp profile" \ |
| 10385 | -s "selected srtp profile" \ |
| 10386 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10387 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10388 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10389 | |
| 10390 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10391 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10393 | 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] | 10394 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10395 | "$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] | 10396 | 0 \ |
| 10397 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10398 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10399 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10400 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10401 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10402 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10403 | |
| 10404 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10405 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10407 | 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] | 10408 | "$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] | 10409 | "$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] | 10410 | 0 \ |
| 10411 | -s "found use_srtp extension" \ |
| 10412 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10413 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10414 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10415 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10416 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10417 | |
| 10418 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10419 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10421 | 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] | 10422 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10423 | "$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] | 10424 | 0 \ |
| 10425 | -s "found use_srtp extension" \ |
| 10426 | -s "found srtp profile" \ |
| 10427 | -s "selected srtp profile" \ |
| 10428 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10429 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10430 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10431 | |
| 10432 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10433 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10435 | 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] | 10436 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10437 | "$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] | 10438 | 0 \ |
| 10439 | -s "found use_srtp extension" \ |
| 10440 | -s "found srtp profile" \ |
| 10441 | -S "selected srtp profile" \ |
| 10442 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10443 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10444 | -C "SRTP profile:" |
| 10445 | |
| 10446 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10447 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10449 | 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] | 10450 | "$P_SRV dtls=1 debug_level=3" \ |
| 10451 | "$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] | 10452 | 0 \ |
| 10453 | -s "found use_srtp extension" \ |
| 10454 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10455 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10456 | -C "SRTP profile:" |
| 10457 | |
| 10458 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10459 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10461 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10462 | "$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" \ |
| 10463 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10464 | 0 \ |
| 10465 | -c "client hello, adding use_srtp extension" \ |
| 10466 | -c "found use_srtp extension" \ |
| 10467 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10468 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10469 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10470 | -C "error" |
| 10471 | |
| 10472 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10473 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10475 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10476 | "$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" \ |
| 10477 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10478 | 0 \ |
| 10479 | -c "client hello, adding use_srtp extension" \ |
| 10480 | -c "found use_srtp extension" \ |
| 10481 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10482 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10483 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10484 | -C "error" |
| 10485 | |
| 10486 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10487 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10489 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10490 | "$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" \ |
| 10491 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10492 | 0 \ |
| 10493 | -c "client hello, adding use_srtp extension" \ |
| 10494 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10495 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10496 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10497 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10498 | -C "error" |
| 10499 | |
| 10500 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10501 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10503 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10504 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10505 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10506 | 0 \ |
| 10507 | -c "client hello, adding use_srtp extension" \ |
| 10508 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10509 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10510 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10511 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10512 | -C "error" |
| 10513 | |
| 10514 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10515 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10517 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10518 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10519 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10520 | 0 \ |
| 10521 | -c "client hello, adding use_srtp extension" \ |
| 10522 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10523 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10524 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10525 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10526 | -C "error" |
| 10527 | |
| 10528 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10529 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10531 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10532 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10533 | "$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] | 10534 | 0 \ |
| 10535 | -c "client hello, adding use_srtp extension" \ |
| 10536 | -C "found use_srtp extension" \ |
| 10537 | -C "found srtp profile" \ |
| 10538 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10539 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10540 | -C "error" |
| 10541 | |
| 10542 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10543 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10545 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10546 | "$G_SRV -u" \ |
| 10547 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10548 | 0 \ |
| 10549 | -c "client hello, adding use_srtp extension" \ |
| 10550 | -C "found use_srtp extension" \ |
| 10551 | -C "found srtp profile" \ |
| 10552 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10553 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10554 | -C "error" |
| 10555 | |
| 10556 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10557 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10559 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10560 | "$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" \ |
| 10561 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10562 | 0 \ |
| 10563 | -c "client hello, adding use_srtp extension" \ |
| 10564 | -c "found use_srtp extension" \ |
| 10565 | -c "found srtp profile" \ |
| 10566 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10567 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10568 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10569 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10570 | -c "dumping 'received mki' (8 bytes)" \ |
| 10571 | -C "error" |
| 10572 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10573 | # Tests for specific things with "unreliable" UDP connection |
| 10574 | |
| 10575 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10577 | run_test "DTLS proxy: reference" \ |
| 10578 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10579 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10580 | "$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] | 10581 | 0 \ |
| 10582 | -C "replayed record" \ |
| 10583 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10584 | -C "Buffer record from epoch" \ |
| 10585 | -S "Buffer record from epoch" \ |
| 10586 | -C "ssl_buffer_message" \ |
| 10587 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10588 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10589 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10590 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10591 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10592 | -c "HTTP/1.0 200 OK" |
| 10593 | |
| 10594 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10596 | run_test "DTLS proxy: duplicate every packet" \ |
| 10597 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10598 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10599 | "$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] | 10600 | 0 \ |
| 10601 | -c "replayed record" \ |
| 10602 | -s "replayed record" \ |
| 10603 | -c "record from another epoch" \ |
| 10604 | -s "record from another epoch" \ |
| 10605 | -S "resend" \ |
| 10606 | -s "Extra-header:" \ |
| 10607 | -c "HTTP/1.0 200 OK" |
| 10608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10610 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10611 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10612 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10613 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10614 | 0 \ |
| 10615 | -c "replayed record" \ |
| 10616 | -S "replayed record" \ |
| 10617 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10618 | -s "record from another epoch" \ |
| 10619 | -c "resend" \ |
| 10620 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10621 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10622 | -c "HTTP/1.0 200 OK" |
| 10623 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10625 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10626 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10627 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10628 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10629 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10630 | -c "next record in same datagram" \ |
| 10631 | -s "next record in same datagram" |
| 10632 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10634 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10635 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10636 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10637 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10638 | 0 \ |
| 10639 | -c "next record in same datagram" \ |
| 10640 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10643 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10644 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10645 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10646 | "$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] | 10647 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10648 | -c "discarding invalid record (mac)" \ |
| 10649 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10650 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10651 | -c "HTTP/1.0 200 OK" \ |
| 10652 | -S "too many records with bad MAC" \ |
| 10653 | -S "Verification of the message MAC failed" |
| 10654 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10656 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10657 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10658 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10659 | "$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] | 10660 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10661 | -C "discarding invalid record (mac)" \ |
| 10662 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10663 | -S "Extra-header:" \ |
| 10664 | -C "HTTP/1.0 200 OK" \ |
| 10665 | -s "too many records with bad MAC" \ |
| 10666 | -s "Verification of the message MAC failed" |
| 10667 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10669 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10670 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10671 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10672 | "$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] | 10673 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10674 | -c "discarding invalid record (mac)" \ |
| 10675 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10676 | -s "Extra-header:" \ |
| 10677 | -c "HTTP/1.0 200 OK" \ |
| 10678 | -S "too many records with bad MAC" \ |
| 10679 | -S "Verification of the message MAC failed" |
| 10680 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10682 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10683 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10684 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10685 | "$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] | 10686 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10687 | -c "discarding invalid record (mac)" \ |
| 10688 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10689 | -s "Extra-header:" \ |
| 10690 | -c "HTTP/1.0 200 OK" \ |
| 10691 | -s "too many records with bad MAC" \ |
| 10692 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10693 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10695 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10696 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10697 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10698 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10699 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10700 | -c "record from another epoch" \ |
| 10701 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10702 | -s "Extra-header:" \ |
| 10703 | -c "HTTP/1.0 200 OK" |
| 10704 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10705 | # Tests for reordering support with DTLS |
| 10706 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10707 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10709 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10710 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10711 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10712 | hs_timeout=2500-60000" \ |
| 10713 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10714 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10715 | 0 \ |
| 10716 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10717 | -c "Next handshake message has been buffered - load"\ |
| 10718 | -S "Buffering HS message" \ |
| 10719 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10720 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10721 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10722 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10723 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10724 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10725 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10727 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10728 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10729 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10730 | hs_timeout=2500-60000" \ |
| 10731 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10732 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10733 | 0 \ |
| 10734 | -c "Buffering HS message" \ |
| 10735 | -c "found fragmented DTLS handshake message"\ |
| 10736 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10737 | -c "Next handshake message has been buffered - load"\ |
| 10738 | -S "Buffering HS message" \ |
| 10739 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10740 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10741 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10742 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10743 | -S "Remember CCS message" |
| 10744 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10745 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10746 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10747 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10748 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10749 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10750 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10752 | 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] | 10753 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10754 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10755 | hs_timeout=2500-60000" \ |
| 10756 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10757 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10758 | 0 \ |
| 10759 | -c "Buffering HS message" \ |
| 10760 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10761 | -C "attempt to make space by freeing buffered messages" \ |
| 10762 | -S "Buffering HS message" \ |
| 10763 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10764 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10765 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10766 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10767 | -S "Remember CCS message" |
| 10768 | |
| 10769 | # The size constraints ensure that the delayed certificate message can't |
| 10770 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10771 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10772 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10773 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10774 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10776 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10777 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10778 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10779 | hs_timeout=2500-60000" \ |
| 10780 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10781 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10782 | 0 \ |
| 10783 | -c "Buffering HS message" \ |
| 10784 | -c "attempt to make space by freeing buffered future messages" \ |
| 10785 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10786 | -S "Buffering HS message" \ |
| 10787 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10788 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10789 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10790 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10791 | -S "Remember CCS message" |
| 10792 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10793 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10795 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10796 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10797 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10798 | hs_timeout=2500-60000" \ |
| 10799 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10800 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10801 | 0 \ |
| 10802 | -C "Buffering HS message" \ |
| 10803 | -C "Next handshake message has been buffered - load"\ |
| 10804 | -s "Buffering HS message" \ |
| 10805 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10806 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10807 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10808 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10809 | -S "Remember CCS message" |
| 10810 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10811 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10813 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10814 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10815 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10816 | hs_timeout=2500-60000" \ |
| 10817 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10818 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10819 | 0 \ |
| 10820 | -C "Buffering HS message" \ |
| 10821 | -C "Next handshake message has been buffered - load"\ |
| 10822 | -S "Buffering HS message" \ |
| 10823 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10824 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10825 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10826 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10827 | -S "Remember CCS message" |
| 10828 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10829 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10831 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10832 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10833 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10834 | hs_timeout=2500-60000" \ |
| 10835 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10836 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10837 | 0 \ |
| 10838 | -C "Buffering HS message" \ |
| 10839 | -C "Next handshake message has been buffered - load"\ |
| 10840 | -S "Buffering HS message" \ |
| 10841 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10842 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10843 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10844 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10845 | -s "Remember CCS message" |
| 10846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10848 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10849 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10850 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10851 | hs_timeout=2500-60000" \ |
| 10852 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10853 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10854 | 0 \ |
| 10855 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10856 | -s "Found buffered record from current epoch - load" \ |
| 10857 | -c "Buffer record from epoch 1" \ |
| 10858 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10859 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10860 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10861 | # from the server are delayed, so that the encrypted Finished message |
| 10862 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10863 | # in afterwards, the encrypted Finished message must be freed in order |
| 10864 | # to make space for the NewSessionTicket to be reassembled. |
| 10865 | # This works only in very particular circumstances: |
| 10866 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10867 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10868 | # the encrypted Finished message. |
| 10869 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10870 | # needs to be fragmented. |
| 10871 | # - All messages sent by the server must be small enough to be either sent |
| 10872 | # without fragmentation or be reassembled within the bounds of |
| 10873 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10874 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10875 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10876 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10878 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10879 | -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] | 10880 | "$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] | 10881 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10882 | 0 \ |
| 10883 | -s "Buffer record from epoch 1" \ |
| 10884 | -s "Found buffered record from current epoch - load" \ |
| 10885 | -c "Buffer record from epoch 1" \ |
| 10886 | -C "Found buffered record from current epoch - load" \ |
| 10887 | -c "Enough space available after freeing future epoch record" |
| 10888 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10889 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10890 | |
| 10891 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10893 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10894 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10895 | "$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] | 10896 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10897 | "$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] | 10898 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10899 | 0 \ |
| 10900 | -s "Extra-header:" \ |
| 10901 | -c "HTTP/1.0 200 OK" |
| 10902 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10903 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10905 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10906 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10907 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10908 | "$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] | 10909 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10910 | 0 \ |
| 10911 | -s "Extra-header:" \ |
| 10912 | -c "HTTP/1.0 200 OK" |
| 10913 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10914 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10916 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10917 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10918 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10919 | "$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] | 10920 | 0 \ |
| 10921 | -s "Extra-header:" \ |
| 10922 | -c "HTTP/1.0 200 OK" |
| 10923 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10924 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10926 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10927 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10928 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10929 | "$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] | 10930 | 0 \ |
| 10931 | -s "Extra-header:" \ |
| 10932 | -c "HTTP/1.0 200 OK" |
| 10933 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10934 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10936 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10937 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10938 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10939 | "$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] | 10940 | 0 \ |
| 10941 | -s "Extra-header:" \ |
| 10942 | -c "HTTP/1.0 200 OK" |
| 10943 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10944 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10946 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10947 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10948 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10949 | "$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] | 10950 | 0 \ |
| 10951 | -s "Extra-header:" \ |
| 10952 | -c "HTTP/1.0 200 OK" |
| 10953 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10954 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10956 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10957 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10958 | "$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] | 10959 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10960 | "$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] | 10961 | 0 \ |
| 10962 | -s "Extra-header:" \ |
| 10963 | -c "HTTP/1.0 200 OK" |
| 10964 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10965 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10967 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10968 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10969 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10970 | "$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] | 10971 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10972 | "$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] | 10973 | 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] | 10974 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10975 | 0 \ |
| 10976 | -s "a session has been resumed" \ |
| 10977 | -c "a session has been resumed" \ |
| 10978 | -s "Extra-header:" \ |
| 10979 | -c "HTTP/1.0 200 OK" |
| 10980 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10981 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10983 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10984 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10985 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10986 | "$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] | 10987 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10988 | "$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] | 10989 | 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] | 10990 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10991 | 0 \ |
| 10992 | -s "a session has been resumed" \ |
| 10993 | -c "a session has been resumed" \ |
| 10994 | -s "Extra-header:" \ |
| 10995 | -c "HTTP/1.0 200 OK" |
| 10996 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10997 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10998 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11000 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11001 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11002 | "$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] | 11003 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11004 | "$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] | 11005 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11006 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11007 | 0 \ |
| 11008 | -c "=> renegotiate" \ |
| 11009 | -s "=> renegotiate" \ |
| 11010 | -s "Extra-header:" \ |
| 11011 | -c "HTTP/1.0 200 OK" |
| 11012 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11013 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11016 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11017 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11018 | "$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] | 11019 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11020 | "$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] | 11021 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11022 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11023 | 0 \ |
| 11024 | -c "=> renegotiate" \ |
| 11025 | -s "=> renegotiate" \ |
| 11026 | -s "Extra-header:" \ |
| 11027 | -c "HTTP/1.0 200 OK" |
| 11028 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11029 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11032 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 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 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11035 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11036 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11037 | "$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] | 11038 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11039 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11040 | 0 \ |
| 11041 | -c "=> renegotiate" \ |
| 11042 | -s "=> renegotiate" \ |
| 11043 | -s "Extra-header:" \ |
| 11044 | -c "HTTP/1.0 200 OK" |
| 11045 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11046 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11049 | 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] | 11050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11051 | "$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] | 11052 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11053 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11054 | "$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] | 11055 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11056 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11057 | 0 \ |
| 11058 | -c "=> renegotiate" \ |
| 11059 | -s "=> renegotiate" \ |
| 11060 | -s "Extra-header:" \ |
| 11061 | -c "HTTP/1.0 200 OK" |
| 11062 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11063 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11064 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11065 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11066 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11067 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11068 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11070 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11071 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11072 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11073 | "$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] | 11074 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11075 | -c "HTTP/1.0 200 OK" |
| 11076 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11077 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11078 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11079 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11081 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11082 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11083 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11084 | "$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] | 11085 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11086 | -c "HTTP/1.0 200 OK" |
| 11087 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11088 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11089 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11090 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11092 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11093 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11094 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11095 | "$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] | 11096 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11097 | -c "HTTP/1.0 200 OK" |
| 11098 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11099 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11100 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11101 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11103 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11104 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11105 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11106 | "$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] | 11107 | 0 \ |
| 11108 | -s "Extra-header:" \ |
| 11109 | -c "Extra-header:" |
| 11110 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11111 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11112 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11113 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11115 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11116 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11117 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11118 | "$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] | 11119 | 0 \ |
| 11120 | -s "Extra-header:" \ |
| 11121 | -c "Extra-header:" |
| 11122 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11123 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11124 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11125 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11127 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11128 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11129 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11130 | "$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] | 11131 | 0 \ |
| 11132 | -s "Extra-header:" \ |
| 11133 | -c "Extra-header:" |
| 11134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11136 | run_test "export keys functionality" \ |
| 11137 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11138 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11139 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11140 | -c "EAP-TLS key material is:"\ |
| 11141 | -s "EAP-TLS key material is:"\ |
| 11142 | -c "EAP-TLS IV is:" \ |
| 11143 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11144 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11145 | # openssl feature tests: check if tls1.3 exists. |
| 11146 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11147 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11148 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11149 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11150 | 0 \ |
| 11151 | -c "TLS 1.3" \ |
| 11152 | -s "TLS 1.3" |
| 11153 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11154 | # 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] | 11155 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11156 | requires_gnutls_next_no_ticket |
| 11157 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11158 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11159 | "$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] | 11160 | "$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] | 11161 | 0 \ |
| 11162 | -s "Version: TLS1.3" \ |
| 11163 | -c "Version: TLS1.3" |
| 11164 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11165 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11166 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11167 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11168 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11169 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11170 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11171 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11172 | "$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] | 11173 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11174 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11175 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11176 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11177 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11178 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11179 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11180 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11181 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11182 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11183 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11184 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11185 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11186 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11187 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11188 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11189 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11190 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11191 | -c "=> parse certificate verify" \ |
| 11192 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11193 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11194 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11195 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11196 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11197 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11198 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11199 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11201 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11202 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11203 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11204 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11205 | "$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] | 11206 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11207 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11208 | -s "SERVER HELLO was queued" \ |
| 11209 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11210 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11211 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11212 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11213 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11214 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11215 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11216 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11217 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11218 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11219 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11220 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11221 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11222 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11223 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11224 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11225 | -c "=> parse certificate verify" \ |
| 11226 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11227 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11228 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11229 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11230 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11231 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11232 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11233 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11234 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11235 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11236 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11237 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11238 | run_test "TLS 1.3: alpn - openssl" \ |
| 11239 | "$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] | 11240 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11241 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11242 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11243 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11244 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11245 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11246 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11247 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11248 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11249 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11250 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11251 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11252 | -c "<= ssl_tls13_process_server_hello" \ |
| 11253 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11254 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11255 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11256 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11257 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11258 | -c "=> parse certificate verify" \ |
| 11259 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11260 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11261 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11262 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11263 | -c "HTTP/1.0 200 ok" \ |
| 11264 | -c "Application Layer Protocol is h2" |
| 11265 | |
| 11266 | requires_gnutls_tls1_3 |
| 11267 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11268 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11269 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11270 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11271 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11272 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11273 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11274 | "$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] | 11275 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11276 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11277 | -s "SERVER HELLO was queued" \ |
| 11278 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11279 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11280 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11281 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11282 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11283 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11284 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11285 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11286 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11287 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11288 | -c "<= ssl_tls13_process_server_hello" \ |
| 11289 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11290 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11291 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11292 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11293 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11294 | -c "=> parse certificate verify" \ |
| 11295 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11296 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11297 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11298 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11299 | -c "HTTP/1.0 200 OK" \ |
| 11300 | -c "Application Layer Protocol is h2" |
| 11301 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11302 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11303 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11304 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11305 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11306 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11307 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11308 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11309 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11310 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11311 | -s "found alpn extension" \ |
| 11312 | -s "server side, adding alpn extension" \ |
| 11313 | -s "Protocol is TLSv1.3" \ |
| 11314 | -s "HTTP/1.0 200 OK" \ |
| 11315 | -s "Application Layer Protocol is h2" |
| 11316 | |
| 11317 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11318 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11319 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11320 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11321 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11322 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11323 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11324 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11325 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11326 | -s "found alpn extension" \ |
| 11327 | -s "server side, adding alpn extension" \ |
| 11328 | -s "Protocol is TLSv1.3" \ |
| 11329 | -s "HTTP/1.0 200 OK" \ |
| 11330 | -s "Application Layer Protocol is h2" |
| 11331 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11333 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11334 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11335 | skip_handshake_stage_check |
| 11336 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11337 | 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] | 11338 | "$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] | 11339 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11340 | 1 \ |
| 11341 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11342 | -S "Version: TLS1.0" \ |
| 11343 | -C "Protocol is TLSv1.0" |
| 11344 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11346 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11347 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11348 | skip_handshake_stage_check |
| 11349 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11350 | 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] | 11351 | "$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] | 11352 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11353 | 1 \ |
| 11354 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11355 | -S "Version: TLS1.1" \ |
| 11356 | -C "Protocol is TLSv1.1" |
| 11357 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11359 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11360 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11361 | skip_handshake_stage_check |
| 11362 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11363 | 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] | 11364 | "$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] | 11365 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11366 | 1 \ |
| 11367 | -s "Client's version: 3.3" \ |
| 11368 | -c "is a fatal alert message (msg 40)" \ |
| 11369 | -S "Version: TLS1.2" \ |
| 11370 | -C "Protocol is TLSv1.2" |
| 11371 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11373 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11374 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11375 | skip_handshake_stage_check |
| 11376 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11377 | 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] | 11378 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11379 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11380 | 1 \ |
| 11381 | -s "fatal protocol_version" \ |
| 11382 | -c "is a fatal alert message (msg 70)" \ |
| 11383 | -S "Version: TLS1.0" \ |
| 11384 | -C "Protocol : TLSv1.0" |
| 11385 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11387 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11388 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11389 | skip_handshake_stage_check |
| 11390 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11391 | 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] | 11392 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11393 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11394 | 1 \ |
| 11395 | -s "fatal protocol_version" \ |
| 11396 | -c "is a fatal alert message (msg 70)" \ |
| 11397 | -S "Version: TLS1.1" \ |
| 11398 | -C "Protocol : TLSv1.1" |
| 11399 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11401 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11402 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11403 | skip_handshake_stage_check |
| 11404 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11405 | 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] | 11406 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11407 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11408 | 1 \ |
| 11409 | -s "fatal protocol_version" \ |
| 11410 | -c "is a fatal alert message (msg 70)" \ |
| 11411 | -S "Version: TLS1.2" \ |
| 11412 | -C "Protocol : TLSv1.2" |
| 11413 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11414 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11415 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11416 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11417 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11418 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11419 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11420 | "$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] | 11421 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11422 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11423 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11424 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11425 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11426 | -c "HTTP/1.0 200 ok" \ |
| 11427 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11428 | |
| 11429 | requires_gnutls_tls1_3 |
| 11430 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11431 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11433 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11434 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11435 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11436 | "$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] | 11437 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11438 | 0 \ |
| 11439 | -c "got a certificate request" \ |
| 11440 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11441 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11442 | -c "HTTP/1.0 200 OK" \ |
| 11443 | -c "Protocol is TLSv1.3" |
| 11444 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11445 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11446 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11447 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11448 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11449 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11450 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11451 | "$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] | 11452 | "$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] | 11453 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11454 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11455 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11456 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11457 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11458 | |
| 11459 | requires_gnutls_tls1_3 |
| 11460 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11462 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11463 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11464 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11465 | "$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] | 11466 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11467 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11468 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11469 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11470 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11471 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11472 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11473 | |
| 11474 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11475 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11476 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11477 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11478 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11479 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11480 | "$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] | 11481 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11482 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11483 | 0 \ |
| 11484 | -c "got a certificate request" \ |
| 11485 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11486 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11487 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11488 | |
| 11489 | requires_gnutls_tls1_3 |
| 11490 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11491 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11492 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11493 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11494 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11495 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11496 | "$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] | 11497 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11498 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11499 | 0 \ |
| 11500 | -c "got a certificate request" \ |
| 11501 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11502 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11503 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11504 | |
| 11505 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11506 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11507 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11508 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11509 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11510 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11511 | "$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] | 11512 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11513 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11514 | 0 \ |
| 11515 | -c "got a certificate request" \ |
| 11516 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11517 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11518 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11519 | |
| 11520 | requires_gnutls_tls1_3 |
| 11521 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11522 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11523 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11524 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11525 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11526 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11527 | "$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] | 11528 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11529 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11530 | 0 \ |
| 11531 | -c "got a certificate request" \ |
| 11532 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11533 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11534 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11535 | |
| 11536 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11537 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11538 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11539 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11540 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11541 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11542 | "$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] | 11543 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11544 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11545 | 0 \ |
| 11546 | -c "got a certificate request" \ |
| 11547 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11548 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11549 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11550 | |
| 11551 | requires_gnutls_tls1_3 |
| 11552 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11553 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11554 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11555 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11556 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11557 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11558 | "$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] | 11559 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11560 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11561 | 0 \ |
| 11562 | -c "got a certificate request" \ |
| 11563 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11564 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11565 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11566 | |
| 11567 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11568 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11569 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11570 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11571 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11572 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11573 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11574 | "$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] | 11575 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11576 | 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] | 11577 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11578 | -c "got a certificate request" \ |
| 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" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11581 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11582 | |
| 11583 | requires_gnutls_tls1_3 |
| 11584 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11585 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11586 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11587 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11588 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11589 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11590 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11591 | "$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] | 11592 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11593 | 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] | 11594 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11595 | -c "got a certificate request" \ |
| 11596 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11597 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11598 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11599 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11600 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11601 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11602 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11603 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11604 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11605 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11606 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11607 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11608 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11609 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11610 | 0 \ |
| 11611 | -c "got a certificate request" \ |
| 11612 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11613 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11614 | -c "Protocol is TLSv1.3" |
| 11615 | |
| 11616 | requires_gnutls_tls1_3 |
| 11617 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11618 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11619 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11620 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11621 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11622 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11623 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11624 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11625 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11626 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11627 | 0 \ |
| 11628 | -c "got a certificate request" \ |
| 11629 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11630 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11631 | -c "Protocol is TLSv1.3" |
| 11632 | |
| 11633 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11634 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11635 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11636 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11637 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11638 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11639 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11640 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11641 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11642 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11643 | 0 \ |
| 11644 | -c "got a certificate request" \ |
| 11645 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11646 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11647 | -c "Protocol is TLSv1.3" |
| 11648 | |
| 11649 | requires_gnutls_tls1_3 |
| 11650 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11651 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11652 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11653 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11654 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11655 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11656 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11657 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11658 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11659 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11660 | 0 \ |
| 11661 | -c "got a certificate request" \ |
| 11662 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11663 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11664 | -c "Protocol is TLSv1.3" |
| 11665 | |
| 11666 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11667 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11668 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11669 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11670 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11671 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11672 | 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] | 11673 | "$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] | 11674 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11675 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11676 | 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] | 11677 | 1 \ |
| 11678 | -c "got a certificate request" \ |
| 11679 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11680 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11681 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11682 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11683 | |
| 11684 | requires_gnutls_tls1_3 |
| 11685 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11686 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11687 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11688 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11689 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11690 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11691 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11692 | "$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] | 11693 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11694 | 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] | 11695 | 1 \ |
| 11696 | -c "got a certificate request" \ |
| 11697 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11698 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11699 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11700 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11701 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11702 | # Test using an opaque private key for client authentication |
| 11703 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11704 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11705 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11706 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11707 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11708 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11709 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11710 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11711 | 0 \ |
| 11712 | -c "got a certificate request" \ |
| 11713 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11714 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11715 | -c "Protocol is TLSv1.3" |
| 11716 | |
| 11717 | requires_gnutls_tls1_3 |
| 11718 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11719 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11720 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11721 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11722 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11723 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11724 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11725 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11726 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11727 | 0 \ |
| 11728 | -c "got a certificate request" \ |
| 11729 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11730 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11731 | -c "Protocol is TLSv1.3" |
| 11732 | |
| 11733 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11734 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11735 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11736 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11737 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11738 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11739 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11740 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11741 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11742 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11743 | 0 \ |
| 11744 | -c "got a certificate request" \ |
| 11745 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11746 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11747 | -c "Protocol is TLSv1.3" |
| 11748 | |
| 11749 | requires_gnutls_tls1_3 |
| 11750 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11751 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11752 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11753 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11754 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11755 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11756 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11757 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11758 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11759 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11760 | 0 \ |
| 11761 | -c "got a certificate request" \ |
| 11762 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11763 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11764 | -c "Protocol is TLSv1.3" |
| 11765 | |
| 11766 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11767 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11768 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11769 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11770 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11771 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11772 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11773 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11774 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11775 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11776 | 0 \ |
| 11777 | -c "got a certificate request" \ |
| 11778 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11779 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11780 | -c "Protocol is TLSv1.3" |
| 11781 | |
| 11782 | requires_gnutls_tls1_3 |
| 11783 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11784 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11785 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11787 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11788 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11789 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11790 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11791 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11792 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11793 | 0 \ |
| 11794 | -c "got a certificate request" \ |
| 11795 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11796 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11797 | -c "Protocol is TLSv1.3" |
| 11798 | |
| 11799 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11800 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11801 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11802 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11803 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11804 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11805 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11806 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11807 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11808 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11809 | 0 \ |
| 11810 | -c "got a certificate request" \ |
| 11811 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11812 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11813 | -c "Protocol is TLSv1.3" |
| 11814 | |
| 11815 | requires_gnutls_tls1_3 |
| 11816 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11817 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11818 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11819 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11820 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11821 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11822 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11823 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11824 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11825 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11826 | 0 \ |
| 11827 | -c "got a certificate request" \ |
| 11828 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11829 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11830 | -c "Protocol is TLSv1.3" |
| 11831 | |
| 11832 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11833 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11834 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11835 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11836 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11837 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11838 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11839 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11840 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11841 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11842 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11843 | 0 \ |
| 11844 | -c "got a certificate request" \ |
| 11845 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11846 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11847 | -c "Protocol is TLSv1.3" |
| 11848 | |
| 11849 | requires_gnutls_tls1_3 |
| 11850 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11851 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11852 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11853 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11854 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11855 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11856 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11857 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11858 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11859 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11860 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11861 | 0 \ |
| 11862 | -c "got a certificate request" \ |
| 11863 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11864 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11865 | -c "Protocol is TLSv1.3" |
| 11866 | |
| 11867 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11868 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11869 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11870 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11871 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11872 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11873 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11874 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11875 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11876 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11877 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11878 | 0 \ |
| 11879 | -c "got a certificate request" \ |
| 11880 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11881 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11882 | -c "Protocol is TLSv1.3" |
| 11883 | |
| 11884 | requires_gnutls_tls1_3 |
| 11885 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11886 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11887 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11888 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11889 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11890 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11891 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11892 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11893 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11894 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11895 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11896 | 0 \ |
| 11897 | -c "got a certificate request" \ |
| 11898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11900 | -c "Protocol is TLSv1.3" |
| 11901 | |
| 11902 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11903 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11904 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11905 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11909 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11910 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11911 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11912 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11913 | 0 \ |
| 11914 | -c "got a certificate request" \ |
| 11915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11916 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11917 | -c "Protocol is TLSv1.3" |
| 11918 | |
| 11919 | requires_gnutls_tls1_3 |
| 11920 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11921 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11922 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11923 | requires_config_enabled MBEDTLS_RSA_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, rsa_pss_rsae_sha512 - gnutls" \ |
| 11928 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11929 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11930 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 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_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11938 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11939 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11940 | requires_config_enabled MBEDTLS_RSA_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, client alg not in server list - openssl" \ |
| 11945 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11946 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11947 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11948 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11949 | 1 \ |
| 11950 | -c "got a certificate request" \ |
| 11951 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11952 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11953 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11954 | -C "unkown pk type" |
| 11955 | |
| 11956 | requires_gnutls_tls1_3 |
| 11957 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11958 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11959 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11960 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11961 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11962 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11963 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11964 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11965 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11966 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11967 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11968 | 1 \ |
| 11969 | -c "got a certificate request" \ |
| 11970 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11971 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11972 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11973 | -C "unkown pk type" |
| 11974 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11975 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11976 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11977 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11978 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11979 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11980 | 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] | 11981 | "$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] | 11982 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11983 | 0 \ |
| 11984 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11985 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11986 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11987 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11988 | -c "HTTP/1.0 200 ok" |
| 11989 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11990 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11991 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11992 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11993 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11994 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11995 | 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] | 11996 | "$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] | 11997 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11998 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11999 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12000 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12001 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12002 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12003 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12004 | |
| 12005 | requires_gnutls_tls1_3 |
| 12006 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12007 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12008 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12009 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12010 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12011 | 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] | 12012 | "$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] | 12013 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12014 | 0 \ |
| 12015 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12016 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12017 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12018 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12019 | -c "HTTP/1.0 200 OK" |
| 12020 | |
| 12021 | requires_gnutls_tls1_3 |
| 12022 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12023 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12024 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12025 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12026 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12027 | 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] | 12028 | "$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] | 12029 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12030 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12031 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12032 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12033 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12034 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12035 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12036 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12037 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12038 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12039 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12040 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12041 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12042 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12043 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12044 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12045 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12046 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12047 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12048 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12049 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12050 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12051 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12052 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12053 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12054 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12055 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12056 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12057 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12058 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12059 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 12060 | "$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] | 12061 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12062 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12063 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12064 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12065 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12066 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12067 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12068 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12069 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12070 | -s "=> parse client hello" \ |
| 12071 | -s "<= parse client hello" |
| 12072 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12073 | requires_gnutls_tls1_3 |
| 12074 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12075 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12076 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12077 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12078 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12079 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 12080 | "$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] | 12081 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12082 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12083 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12084 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12085 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12086 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12087 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12088 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12089 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12090 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12091 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12092 | requires_gnutls_tls1_3 |
| 12093 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12094 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12095 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12096 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12097 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12098 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12099 | "$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] | 12100 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12101 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12102 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12103 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12104 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12105 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12106 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12107 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12108 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12109 | -s "=> parse client hello" \ |
| 12110 | -s "<= parse client hello" |
| 12111 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12112 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12113 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12114 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12115 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12116 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12117 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12118 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12119 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12120 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12121 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12122 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12123 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12124 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12125 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12126 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12127 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12128 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12129 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12130 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12131 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12132 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12133 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12134 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12135 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12136 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12137 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12138 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12139 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12140 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12141 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12142 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12143 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12144 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12145 | -s "=> parse client hello" \ |
| 12146 | -s "<= parse client hello" |
| 12147 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12148 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12149 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12150 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12151 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12152 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12153 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12154 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12155 | 1 \ |
| 12156 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12157 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12158 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12159 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12160 | -s "=> write certificate request" \ |
| 12161 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12162 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12163 | -s "=> parse client hello" \ |
| 12164 | -s "<= parse client hello" |
| 12165 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12166 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12167 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12168 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12169 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12170 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12171 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12172 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12173 | 0 \ |
| 12174 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12175 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12176 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12177 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12178 | -s "=> write certificate request" \ |
| 12179 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12180 | -s "=> parse client hello" \ |
| 12181 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12182 | |
| 12183 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12184 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12185 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12186 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12187 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12188 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12189 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12190 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12191 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12192 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12193 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12194 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12195 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12196 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12197 | -s "=> write hello retry request" \ |
| 12198 | -s "<= write hello retry request" |
| 12199 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12201 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12202 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12203 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12204 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12205 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12206 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12207 | 1 \ |
| 12208 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12209 | -s "No certificate available." |
| 12210 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12211 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12212 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12213 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12214 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12215 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12216 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12217 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12218 | 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] | 12219 | "$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" \ |
| 12220 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12221 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12222 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12223 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12224 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12225 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12226 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12227 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12228 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12229 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12230 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12231 | 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] | 12232 | "$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" \ |
| 12233 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12234 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12235 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12236 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12237 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12238 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12239 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12240 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12241 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12242 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12243 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
| 12244 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12245 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12246 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12247 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12248 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12249 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12250 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12251 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12252 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12253 | TEST_SUITE_NAME=${i##*/} |
| 12254 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12255 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12256 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12257 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12258 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12259 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12260 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12261 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12262 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12263 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12264 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12265 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12266 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12267 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12268 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12269 | -s "Protocol is TLSv1.3" \ |
| 12270 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12271 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12272 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12273 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12274 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12275 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12276 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12277 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12278 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12279 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12280 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12281 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12282 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12283 | -s "Protocol is TLSv1.3" \ |
| 12284 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12285 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12286 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12287 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12288 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12289 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12290 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12291 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12292 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12293 | 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] | 12294 | "$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] | 12295 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12296 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12297 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12298 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12299 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12300 | |
| 12301 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12302 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12303 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12304 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12305 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12306 | 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] | 12307 | "$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] | 12308 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12309 | 1 \ |
| 12310 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12311 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12312 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12313 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12314 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12315 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12316 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12317 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12318 | "$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] | 12319 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12320 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12321 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12322 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12323 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12324 | requires_gnutls_tls1_3 |
| 12325 | requires_gnutls_next_no_ticket |
| 12326 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12327 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12328 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12329 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12330 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12331 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12332 | "$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] | 12333 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12334 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12335 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12336 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12337 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12338 | |
| 12339 | requires_gnutls_tls1_3 |
| 12340 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12341 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12342 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12343 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12344 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12345 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12346 | "$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] | 12347 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12348 | 1 \ |
| 12349 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12350 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12351 | requires_gnutls_tls1_3 |
| 12352 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12353 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12354 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12355 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12356 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12357 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12358 | "$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] | 12359 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12360 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12361 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12362 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12363 | |
| 12364 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12365 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12366 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12367 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12368 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12369 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12370 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12371 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12372 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12373 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12374 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12375 | -C "14 03 03 00 01" |
| 12376 | |
| 12377 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12378 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12379 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12380 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12381 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12382 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12383 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12384 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12385 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12386 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12387 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12388 | |
| 12389 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12390 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12391 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12392 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12393 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12394 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12395 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12396 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12397 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12398 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12399 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12400 | -c "14 03 03 00 01" |
| 12401 | |
| 12402 | requires_gnutls_tls1_3 |
| 12403 | requires_gnutls_next_no_ticket |
| 12404 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12405 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12406 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12407 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12408 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12409 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12410 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12411 | "$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] | 12412 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12413 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12414 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12415 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12416 | |
| 12417 | requires_gnutls_tls1_3 |
| 12418 | requires_gnutls_next_no_ticket |
| 12419 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12420 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12421 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12422 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12423 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12424 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12425 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12426 | "$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] | 12427 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12428 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12429 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12430 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12431 | -c "discarding change cipher spec in TLS1.3" |
| 12432 | |
| 12433 | requires_gnutls_tls1_3 |
| 12434 | requires_gnutls_next_no_ticket |
| 12435 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12436 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12437 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12438 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12439 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12440 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12441 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12442 | "$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] | 12443 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12444 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12445 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12446 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12447 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12448 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12449 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12451 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12453 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12454 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12455 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12456 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12457 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12458 | -c "Protocol is TLSv1.3" \ |
| 12459 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12460 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12461 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12462 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12463 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12464 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12465 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12466 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12467 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12468 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12469 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12470 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12471 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12472 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12473 | -c "Protocol is TLSv1.3" \ |
| 12474 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12475 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12476 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12477 | |
| 12478 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12479 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12480 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12481 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12482 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12483 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12484 | "$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] | 12485 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12486 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12487 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12488 | -c "received HelloRetryRequest message" \ |
| 12489 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12490 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12491 | |
| 12492 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12493 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12494 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12495 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12496 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12497 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12498 | "$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] | 12499 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12500 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12501 | -c "received HelloRetryRequest message" \ |
| 12502 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12503 | |
| 12504 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12505 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12506 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12507 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12508 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12509 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12510 | "$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] | 12511 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12512 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12513 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12514 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12515 | |
| 12516 | requires_gnutls_tls1_3 |
| 12517 | requires_gnutls_next_no_ticket |
| 12518 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12519 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12520 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12521 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12522 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12523 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12524 | "$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] | 12525 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12526 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12527 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12528 | -c "received HelloRetryRequest message" \ |
| 12529 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12530 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12531 | |
| 12532 | requires_gnutls_tls1_3 |
| 12533 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12534 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12535 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12536 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12537 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12538 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12539 | "$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] | 12540 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12541 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12542 | -c "received HelloRetryRequest message" \ |
| 12543 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12544 | |
| 12545 | requires_gnutls_tls1_3 |
| 12546 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12548 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12549 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12550 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12551 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12552 | "$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] | 12553 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12554 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12555 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12556 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12557 | |
| 12558 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12559 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12560 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12561 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12562 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12563 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12564 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12565 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12566 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12567 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12568 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12569 | -C "14 03 03 00 01" |
| 12570 | |
| 12571 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12572 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12573 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12574 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12575 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12576 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12577 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12578 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12579 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12580 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12581 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12582 | |
| 12583 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12584 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12585 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12586 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12587 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12588 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12589 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12590 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12591 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12592 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12593 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12594 | -c "14 03 03 00 01" |
| 12595 | |
| 12596 | requires_gnutls_tls1_3 |
| 12597 | requires_gnutls_next_no_ticket |
| 12598 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12599 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12600 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12601 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12602 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12603 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12604 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12605 | "$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] | 12606 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12607 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12608 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12609 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12610 | |
| 12611 | requires_gnutls_tls1_3 |
| 12612 | requires_gnutls_next_no_ticket |
| 12613 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12614 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12615 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12616 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12617 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12618 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12619 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12620 | "$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] | 12621 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12622 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12623 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12624 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12625 | -c "discarding change cipher spec in TLS1.3" |
| 12626 | |
| 12627 | requires_gnutls_tls1_3 |
| 12628 | requires_gnutls_next_no_ticket |
| 12629 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12630 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12631 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12632 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12633 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12634 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12635 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12636 | "$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] | 12637 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12638 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12639 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12640 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12641 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12642 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12643 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12644 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12645 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12646 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12647 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12648 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12649 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12650 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12651 | "$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] | 12652 | 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] | 12653 | 0 \ |
| 12654 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12655 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12656 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12657 | |
| 12658 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12659 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12660 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12661 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12662 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12663 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12664 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12665 | -d 4 |
| 12666 | --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 " \ |
| 12667 | "$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] | 12668 | 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] | 12669 | 0 \ |
| 12670 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12671 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12672 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12673 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12674 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12675 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12676 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12677 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12678 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12679 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12680 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12681 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12682 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12683 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12684 | "$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] | 12685 | 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] | 12686 | 0 \ |
| 12687 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12688 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12689 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12690 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12691 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12692 | |
| 12693 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12694 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12695 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12696 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12697 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12698 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12699 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12700 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12701 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12702 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12703 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12704 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12705 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12706 | 0 \ |
| 12707 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12708 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12709 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12710 | |
| 12711 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12712 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12713 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12714 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12715 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12716 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12717 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12718 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12719 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12720 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12721 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12722 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12723 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12724 | 0 \ |
| 12725 | -c "Negotiated version: 3.4" \ |
| 12726 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12727 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12728 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12729 | |
| 12730 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12732 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12733 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12734 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12735 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12736 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12737 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12738 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12739 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12740 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12741 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12742 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12743 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12744 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12745 | |
| 12746 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12747 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12748 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12749 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12750 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12751 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12752 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12753 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12754 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12755 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12756 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12757 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12758 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12759 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12760 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12761 | |
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_SRV_C |
| 12764 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12765 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12766 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12767 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12768 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12769 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12770 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12771 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12772 | "$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] | 12773 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12774 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12775 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 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_SRV_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 server no suitable certificate, G->m" \ |
| 12783 | "$P_SRV debug_level=4 force_version=tls13 |
| 12784 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12785 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12786 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12787 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12788 | 1 \ |
| 12789 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12790 | |
| 12791 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12792 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12793 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12794 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12795 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12796 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12797 | "$P_SRV debug_level=4 force_version=tls13 |
| 12798 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12799 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12800 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12801 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12802 | 1 \ |
| 12803 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12804 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12805 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12806 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12807 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12808 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12809 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12810 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12811 | "$P_SRV debug_level=4 force_version=tls13 |
| 12812 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12813 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12814 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12815 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12816 | 1 \ |
| 12817 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12818 | |
| 12819 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12820 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12821 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12822 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12823 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12824 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12825 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12826 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12827 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12828 | "$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] | 12829 | 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] | 12830 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12831 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12832 | |
| 12833 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12836 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12837 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12838 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12839 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12840 | -d 4 |
| 12841 | --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 " \ |
| 12842 | "$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] | 12843 | 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] | 12844 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12845 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12846 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12847 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12848 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12849 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12850 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12851 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12852 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12853 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12854 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12855 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12856 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12857 | "$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] | 12858 | 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] | 12859 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12860 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12861 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12862 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12863 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12864 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12865 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12866 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12867 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12868 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12869 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12870 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12871 | 0 \ |
| 12872 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12873 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12874 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12875 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12876 | -c "HTTP/1.0 200 ok" |
| 12877 | |
| 12878 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12879 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12880 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12881 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12882 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12883 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12884 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12885 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:+PSK --disable-client-cert" \ |
| 12886 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12887 | 0 \ |
| 12888 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12889 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12890 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12891 | -c "Reconnecting with saved session" \ |
| 12892 | -c "HTTP/1.0 200 OK" \ |
| 12893 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12894 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12895 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12896 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12897 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12898 | requires_config_enabled MBEDTLS_DEBUG_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 \ |
| 12901 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12902 | # https://github.com/openssl/openssl/issues/10714 |
| 12903 | # Until now, OpenSSL client does not support reconnect. |
| 12904 | skip_next_test |
| 12905 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12906 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12907 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 12908 | 0 \ |
| 12909 | -s "=> write NewSessionTicket msg" \ |
| 12910 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12911 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 12912 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12913 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12914 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12915 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12916 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12917 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12918 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12919 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12920 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12921 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12922 | "$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] | 12923 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12924 | -c "Connecting again- trying to resume previous session" \ |
| 12925 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12926 | -s "=> write NewSessionTicket msg" \ |
| 12927 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12928 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12929 | -s "key exchange mode: ephemeral" \ |
| 12930 | -s "key exchange mode: psk_ephemeral" \ |
| 12931 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12932 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12934 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12935 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12936 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12937 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12938 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12939 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12940 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12941 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12942 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12943 | 0 \ |
| 12944 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12945 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12946 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12947 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12948 | -c "HTTP/1.0 200 OK" \ |
| 12949 | -s "=> write NewSessionTicket msg" \ |
| 12950 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12951 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
| 12952 | -s "key exchange mode: ephemeral" \ |
| 12953 | -s "key exchange mode: psk_ephemeral" \ |
| 12954 | -s "found pre_shared_key extension" |
| 12955 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 12956 | requires_openssl_tls1_3 |
| 12957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12958 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12959 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12960 | 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] | 12961 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12962 | -msg -tls1_2 |
| 12963 | -Verify 10 " \ |
| 12964 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12965 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12966 | min_version=tls12 max_version=tls13 " \ |
| 12967 | 0 \ |
| 12968 | -c "Protocol is TLSv1.2" \ |
| 12969 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12970 | |
| 12971 | |
| 12972 | requires_gnutls_tls1_3 |
| 12973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12974 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12975 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12976 | 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] | 12977 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12978 | -d 4 |
| 12979 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 12980 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12981 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12982 | min_version=tls12 max_version=tls13 " \ |
| 12983 | 0 \ |
| 12984 | -c "Protocol is TLSv1.2" \ |
| 12985 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12986 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 12987 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12988 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12989 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12990 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12991 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12992 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12993 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 12994 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 12995 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 12996 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12997 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 12998 | 0 \ |
| 12999 | -c "Protocol is TLSv1.3" \ |
| 13000 | -c "got new session ticket." \ |
| 13001 | -c "Saving session for reuse... ok" \ |
| 13002 | -c "Reconnecting with saved session" \ |
| 13003 | -c "HTTP/1.0 200 OK" \ |
| 13004 | -s "=> write NewSessionTicket msg" \ |
| 13005 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 13006 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
| 13007 | -s "key exchange mode: ephemeral" \ |
| 13008 | -s "key exchange mode: psk_ephemeral" \ |
| 13009 | -s "found pre_shared_key extension" |
| 13010 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13011 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13012 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13013 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13014 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13015 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13016 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13017 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13018 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13019 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13020 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13021 | "$P_CLI debug_level=4 server_name=localhost rec_server_name=remote reco_mode=1 reconnect=1" \ |
| 13022 | 1 \ |
| 13023 | -c "Protocol is TLSv1.3" \ |
| 13024 | -c "got new session ticket." \ |
| 13025 | -c "Saving session for reuse... ok" \ |
| 13026 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13027 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13028 | -s "=> write NewSessionTicket msg" \ |
| 13029 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 13030 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 13031 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13032 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13034 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13035 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13036 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13037 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13038 | run_tests_memory_after_hanshake |
| 13039 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13040 | # Final report |
| 13041 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13042 | echo "------------------------------------------------------------------------" |
| 13043 | |
| 13044 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13045 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13046 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13047 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13048 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13049 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13050 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13051 | |
| 13052 | exit $FAILS |