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 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 254 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 255 | # This function uses the query_config command line option to query the |
| 256 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 257 | # program. The command will always return a success value if the |
| 258 | # configuration is defined and the value will be printed to stdout. |
| 259 | # |
| 260 | # Note that if the configuration is not defined or is defined to nothing, |
| 261 | # the output of this function will be an empty string. |
| 262 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 266 | VAL="$( get_config_value_or_default "$1" )" |
| 267 | if [ -z "$VAL" ]; then |
| 268 | # Should never happen |
| 269 | echo "Mbed TLS configuration $1 is not defined" |
| 270 | exit 1 |
| 271 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 272 | SKIP_NEXT="YES" |
| 273 | fi |
| 274 | } |
| 275 | |
| 276 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 277 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 278 | if [ -z "$VAL" ]; then |
| 279 | # Should never happen |
| 280 | echo "Mbed TLS configuration $1 is not defined" |
| 281 | exit 1 |
| 282 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 283 | SKIP_NEXT="YES" |
| 284 | fi |
| 285 | } |
| 286 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 287 | requires_config_value_equals() { |
| 288 | VAL=$( get_config_value_or_default "$1" ) |
| 289 | if [ -z "$VAL" ]; then |
| 290 | # Should never happen |
| 291 | echo "Mbed TLS configuration $1 is not defined" |
| 292 | exit 1 |
| 293 | elif [ "$VAL" -ne "$2" ]; then |
| 294 | SKIP_NEXT="YES" |
| 295 | fi |
| 296 | } |
| 297 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 298 | # Require Mbed TLS to support the given protocol version. |
| 299 | # |
| 300 | # Inputs: |
| 301 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 302 | requires_protocol_version() { |
| 303 | # Support for DTLS is detected separately in detect_dtls(). |
| 304 | case "$1" in |
| 305 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 306 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 307 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 308 | esac |
| 309 | } |
| 310 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 311 | # Space-separated list of ciphersuites supported by this build of |
| 312 | # Mbed TLS. |
| 313 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 314 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 315 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 316 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 317 | case $P_CIPHERSUITES in |
| 318 | *" $1 "*) :;; |
| 319 | *) SKIP_NEXT="YES";; |
| 320 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 321 | } |
| 322 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 323 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 324 | # If CMD (call to a TLS client or server program) requires certain features, |
| 325 | # arrange to only run the following test case if those features are enabled. |
| 326 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 327 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 328 | *\ force_version=*) |
| 329 | tmp="${1##*\ force_version=}" |
| 330 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 331 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 332 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 333 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 334 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 335 | *\ force_ciphersuite=*) |
| 336 | tmp="${1##*\ force_ciphersuite=}" |
| 337 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 338 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 339 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 340 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 341 | case " $1 " in |
| 342 | *[-_\ =]tickets=[^0]*) |
| 343 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 344 | esac |
| 345 | case " $1 " in |
| 346 | *[-_\ =]alpn=*) |
| 347 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 348 | esac |
| 349 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 350 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 351 | } |
| 352 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 353 | requires_certificate_authentication () { |
| 354 | if [ "$PSK_ONLY" = "YES" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 359 | adapt_cmd_for_psk () { |
| 360 | case "$2" in |
| 361 | *openssl*) s='-psk abc123 -nocert';; |
| 362 | *gnutls-*) s='--pskkey=abc123';; |
| 363 | *) s='psk=abc123';; |
| 364 | esac |
| 365 | eval $1='"$2 $s"' |
| 366 | unset s |
| 367 | } |
| 368 | |
| 369 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 370 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 371 | # |
| 372 | # If not running in a PSK-only build, do nothing. |
| 373 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 374 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 375 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 376 | # a pre-shared key, do nothing. |
| 377 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 378 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 379 | # |
| 380 | # Inputs: |
| 381 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 382 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 383 | # * "$@": options passed to run_test. |
| 384 | # |
| 385 | # Outputs: |
| 386 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 387 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 388 | maybe_adapt_for_psk() { |
| 389 | if [ "$PSK_ONLY" != "YES" ]; then |
| 390 | return |
| 391 | fi |
| 392 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 393 | return |
| 394 | fi |
| 395 | case "$CLI_CMD $SRV_CMD" in |
| 396 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 397 | return;; |
| 398 | *force_ciphersuite*) |
| 399 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 400 | # PSK cipher suite could be substituted, but we're not ready for |
| 401 | # that yet. |
| 402 | SKIP_NEXT="YES" |
| 403 | return;; |
| 404 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 405 | # The test case involves certificates. PSK won't do. |
| 406 | SKIP_NEXT="YES" |
| 407 | return;; |
| 408 | esac |
| 409 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 410 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 411 | } |
| 412 | |
| 413 | case " $CONFIGS_ENABLED " in |
| 414 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 415 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 416 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 417 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 418 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 419 | *) PSK_ONLY="NO";; |
| 420 | esac |
| 421 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 422 | HAS_ALG_SHA_1="NO" |
| 423 | HAS_ALG_SHA_224="NO" |
| 424 | HAS_ALG_SHA_256="NO" |
| 425 | HAS_ALG_SHA_384="NO" |
| 426 | HAS_ALG_SHA_512="NO" |
| 427 | |
| 428 | check_for_hash_alg() |
| 429 | { |
| 430 | CURR_ALG="INVALID"; |
| 431 | USE_PSA="NO" |
| 432 | case $CONFIGS_ENABLED in |
| 433 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 434 | USE_PSA="YES"; |
| 435 | ;; |
| 436 | *) :;; |
| 437 | esac |
| 438 | if [ $USE_PSA = "YES" ]; then |
| 439 | CURR_ALG=PSA_WANT_ALG_${1} |
| 440 | else |
| 441 | CURR_ALG=MBEDTLS_${1}_C |
| 442 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 443 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 444 | fi |
| 445 | |
| 446 | case $CONFIGS_ENABLED in |
| 447 | *" $CURR_ALG"[\ =]*) |
| 448 | return 0 |
| 449 | ;; |
| 450 | *) :;; |
| 451 | esac |
| 452 | return 1 |
| 453 | } |
| 454 | |
| 455 | populate_enabled_hash_algs() |
| 456 | { |
| 457 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 458 | if check_for_hash_alg "$hash_alg"; then |
| 459 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 460 | eval ${hash_alg_variable}=YES |
| 461 | fi |
| 462 | done |
| 463 | } |
| 464 | |
| 465 | # skip next test if the given hash alg is not supported |
| 466 | requires_hash_alg() { |
| 467 | HASH_DEFINE="Invalid" |
| 468 | HAS_HASH_ALG="NO" |
| 469 | case $1 in |
| 470 | SHA_1):;; |
| 471 | SHA_224):;; |
| 472 | SHA_256):;; |
| 473 | SHA_384):;; |
| 474 | SHA_512):;; |
| 475 | *) |
| 476 | echo "Unsupported hash alg - $1" |
| 477 | exit 1 |
| 478 | ;; |
| 479 | esac |
| 480 | |
| 481 | HASH_DEFINE=HAS_ALG_${1} |
| 482 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 483 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 484 | then |
| 485 | SKIP_NEXT="YES" |
| 486 | fi |
| 487 | } |
| 488 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 489 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 490 | requires_openssl_with_fallback_scsv() { |
| 491 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 492 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 493 | then |
| 494 | OPENSSL_HAS_FBSCSV="YES" |
| 495 | else |
| 496 | OPENSSL_HAS_FBSCSV="NO" |
| 497 | fi |
| 498 | fi |
| 499 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 500 | SKIP_NEXT="YES" |
| 501 | fi |
| 502 | } |
| 503 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 504 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 505 | requires_max_content_len() { |
| 506 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 507 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 508 | } |
| 509 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 510 | # skip next test if GnuTLS isn't available |
| 511 | requires_gnutls() { |
| 512 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 513 | 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] | 514 | GNUTLS_AVAILABLE="YES" |
| 515 | else |
| 516 | GNUTLS_AVAILABLE="NO" |
| 517 | fi |
| 518 | fi |
| 519 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 520 | SKIP_NEXT="YES" |
| 521 | fi |
| 522 | } |
| 523 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 524 | # skip next test if GnuTLS-next isn't available |
| 525 | requires_gnutls_next() { |
| 526 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 527 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 528 | GNUTLS_NEXT_AVAILABLE="YES" |
| 529 | else |
| 530 | GNUTLS_NEXT_AVAILABLE="NO" |
| 531 | fi |
| 532 | fi |
| 533 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 534 | SKIP_NEXT="YES" |
| 535 | fi |
| 536 | } |
| 537 | |
| 538 | # skip next test if OpenSSL-legacy isn't available |
| 539 | requires_openssl_legacy() { |
| 540 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 541 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 542 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 543 | else |
| 544 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 545 | fi |
| 546 | fi |
| 547 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 548 | SKIP_NEXT="YES" |
| 549 | fi |
| 550 | } |
| 551 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 552 | requires_openssl_next() { |
| 553 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 554 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 555 | OPENSSL_NEXT_AVAILABLE="YES" |
| 556 | else |
| 557 | OPENSSL_NEXT_AVAILABLE="NO" |
| 558 | fi |
| 559 | fi |
| 560 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 561 | SKIP_NEXT="YES" |
| 562 | fi |
| 563 | } |
| 564 | |
| 565 | # skip next test if tls1_3 is not available |
| 566 | requires_openssl_tls1_3() { |
| 567 | requires_openssl_next |
| 568 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 569 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 570 | fi |
| 571 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 572 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 573 | then |
| 574 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 575 | else |
| 576 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 577 | fi |
| 578 | fi |
| 579 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 580 | SKIP_NEXT="YES" |
| 581 | fi |
| 582 | } |
| 583 | |
| 584 | # skip next test if tls1_3 is not available |
| 585 | requires_gnutls_tls1_3() { |
| 586 | requires_gnutls_next |
| 587 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 588 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 589 | fi |
| 590 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 591 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 592 | then |
| 593 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 594 | else |
| 595 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 596 | fi |
| 597 | fi |
| 598 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 599 | SKIP_NEXT="YES" |
| 600 | fi |
| 601 | } |
| 602 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 603 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 604 | requires_gnutls_next_no_ticket() { |
| 605 | requires_gnutls_next |
| 606 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 607 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 608 | fi |
| 609 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 610 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 611 | then |
| 612 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 613 | else |
| 614 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 615 | fi |
| 616 | fi |
| 617 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 618 | SKIP_NEXT="YES" |
| 619 | fi |
| 620 | } |
| 621 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 622 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 623 | requires_gnutls_next_disable_tls13_compat() { |
| 624 | requires_gnutls_next |
| 625 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 626 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 627 | fi |
| 628 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 629 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 630 | then |
| 631 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 632 | else |
| 633 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 634 | fi |
| 635 | fi |
| 636 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 637 | SKIP_NEXT="YES" |
| 638 | fi |
| 639 | } |
| 640 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 641 | # skip next test if IPv6 isn't available on this host |
| 642 | requires_ipv6() { |
| 643 | if [ -z "${HAS_IPV6:-}" ]; then |
| 644 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 645 | SRV_PID=$! |
| 646 | sleep 1 |
| 647 | kill $SRV_PID >/dev/null 2>&1 |
| 648 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 649 | HAS_IPV6="NO" |
| 650 | else |
| 651 | HAS_IPV6="YES" |
| 652 | fi |
| 653 | rm -r $SRV_OUT |
| 654 | fi |
| 655 | |
| 656 | if [ "$HAS_IPV6" = "NO" ]; then |
| 657 | SKIP_NEXT="YES" |
| 658 | fi |
| 659 | } |
| 660 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 661 | # skip next test if it's i686 or uname is not available |
| 662 | requires_not_i686() { |
| 663 | if [ -z "${IS_I686:-}" ]; then |
| 664 | IS_I686="YES" |
| 665 | if which "uname" >/dev/null 2>&1; then |
| 666 | if [ -z "$(uname -a | grep i686)" ]; then |
| 667 | IS_I686="NO" |
| 668 | fi |
| 669 | fi |
| 670 | fi |
| 671 | if [ "$IS_I686" = "YES" ]; then |
| 672 | SKIP_NEXT="YES" |
| 673 | fi |
| 674 | } |
| 675 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 676 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 677 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 678 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 679 | 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] | 680 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 681 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 682 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 683 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 684 | fi |
| 685 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 686 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 687 | fi |
| 688 | |
| 689 | # skip the next test if the SSL output buffer is less than 16KB |
| 690 | requires_full_size_output_buffer() { |
| 691 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 692 | SKIP_NEXT="YES" |
| 693 | fi |
| 694 | } |
| 695 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 696 | # skip the next test if valgrind is in use |
| 697 | not_with_valgrind() { |
| 698 | if [ "$MEMCHECK" -gt 0 ]; then |
| 699 | SKIP_NEXT="YES" |
| 700 | fi |
| 701 | } |
| 702 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 703 | # skip the next test if valgrind is NOT in use |
| 704 | only_with_valgrind() { |
| 705 | if [ "$MEMCHECK" -eq 0 ]; then |
| 706 | SKIP_NEXT="YES" |
| 707 | fi |
| 708 | } |
| 709 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 710 | # 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] | 711 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 712 | CLI_DELAY_FACTOR=$1 |
| 713 | } |
| 714 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 715 | # wait for the given seconds after the client finished in the next test |
| 716 | server_needs_more_time() { |
| 717 | SRV_DELAY_SECONDS=$1 |
| 718 | } |
| 719 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 720 | # print_name <name> |
| 721 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 722 | TESTS=$(( $TESTS + 1 )) |
| 723 | LINE="" |
| 724 | |
| 725 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 726 | LINE="$TESTS " |
| 727 | fi |
| 728 | |
| 729 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 730 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 731 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 732 | for i in `seq 1 $LEN`; do printf '.'; done |
| 733 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 734 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 735 | } |
| 736 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 737 | # record_outcome <outcome> [<failure-reason>] |
| 738 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 739 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 740 | record_outcome() { |
| 741 | echo "$1" |
| 742 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 743 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 744 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 745 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 746 | "$1" "${2-}" \ |
| 747 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 748 | fi |
| 749 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 750 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 751 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 752 | # True if the presence of the given pattern in a log definitely indicates |
| 753 | # that the test has failed. False if the presence is inconclusive. |
| 754 | # |
| 755 | # Inputs: |
| 756 | # * $1: pattern found in the logs |
| 757 | # * $TIMES_LEFT: >0 if retrying is an option |
| 758 | # |
| 759 | # Outputs: |
| 760 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 761 | # unchanged otherwise. |
| 762 | # * Return value: 1 if the pattern is inconclusive, |
| 763 | # 0 if the failure is definitive. |
| 764 | log_pattern_presence_is_conclusive() { |
| 765 | # If we've run out of attempts, then don't retry no matter what. |
| 766 | if [ $TIMES_LEFT -eq 0 ]; then |
| 767 | return 0 |
| 768 | fi |
| 769 | case $1 in |
| 770 | "resend") |
| 771 | # An undesired resend may have been caused by the OS dropping or |
| 772 | # delaying a packet at an inopportune time. |
| 773 | outcome="RETRY(resend)" |
| 774 | return 1;; |
| 775 | esac |
| 776 | } |
| 777 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 778 | # fail <message> |
| 779 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 780 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 781 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 782 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 783 | mv $SRV_OUT o-srv-${TESTS}.log |
| 784 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 785 | if [ -n "$PXY_CMD" ]; then |
| 786 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 787 | fi |
| 788 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 789 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 790 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 791 | echo " ! server output:" |
| 792 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 793 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 794 | echo " ! client output:" |
| 795 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 796 | if [ -n "$PXY_CMD" ]; then |
| 797 | echo " ! ========================================================" |
| 798 | echo " ! proxy output:" |
| 799 | cat o-pxy-${TESTS}.log |
| 800 | fi |
| 801 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 802 | fi |
| 803 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 804 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 805 | } |
| 806 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 807 | # is_polar <cmd_line> |
| 808 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 809 | case "$1" in |
| 810 | *ssl_client2*) true;; |
| 811 | *ssl_server2*) true;; |
| 812 | *) false;; |
| 813 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 814 | } |
| 815 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 816 | # openssl s_server doesn't have -www with DTLS |
| 817 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 818 | case "$SRV_CMD" in |
| 819 | *s_server*-dtls*) |
| 820 | NEEDS_INPUT=1 |
| 821 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 822 | *) NEEDS_INPUT=0;; |
| 823 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 824 | } |
| 825 | |
| 826 | # provide input to commands that need it |
| 827 | provide_input() { |
| 828 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 829 | return |
| 830 | fi |
| 831 | |
| 832 | while true; do |
| 833 | echo "HTTP/1.0 200 OK" |
| 834 | sleep 1 |
| 835 | done |
| 836 | } |
| 837 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 838 | # has_mem_err <log_file_name> |
| 839 | has_mem_err() { |
| 840 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 841 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 842 | then |
| 843 | return 1 # false: does not have errors |
| 844 | else |
| 845 | return 0 # true: has errors |
| 846 | fi |
| 847 | } |
| 848 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 849 | # 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] | 850 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 851 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 852 | newline=' |
| 853 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 854 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 855 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 856 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 857 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 858 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 859 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 860 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 861 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 862 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 863 | # When we use a proxy, it will be listening on the same port we |
| 864 | # 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] | 865 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 866 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 867 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 868 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 869 | echo "$3 START TIMEOUT" |
| 870 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 871 | break |
| 872 | fi |
| 873 | # Linux and *BSD support decimal arguments to sleep. On other |
| 874 | # OSes this may be a tight loop. |
| 875 | sleep 0.1 2>/dev/null || true |
| 876 | done |
| 877 | } |
| 878 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 879 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 880 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 881 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 882 | } |
| 883 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 884 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 885 | # Wait for server process $2 to be listening on port $1. |
| 886 | wait_server_start() { |
| 887 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 888 | } |
| 889 | |
| 890 | # Wait for proxy process $2 to be listening on port $1. |
| 891 | wait_proxy_start() { |
| 892 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 893 | } |
| 894 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 895 | # 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] | 896 | # 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] | 897 | # acceptable bounds |
| 898 | check_server_hello_time() { |
| 899 | # 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] | 900 | 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] | 901 | # Get the Unix timestamp for now |
| 902 | CUR_TIME=$(date +'%s') |
| 903 | THRESHOLD_IN_SECS=300 |
| 904 | |
| 905 | # Check if the ServerHello time was printed |
| 906 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 907 | return 1 |
| 908 | fi |
| 909 | |
| 910 | # Check the time in ServerHello is within acceptable bounds |
| 911 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 912 | # The time in ServerHello is at least 5 minutes before now |
| 913 | return 1 |
| 914 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 915 | # 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] | 916 | return 1 |
| 917 | else |
| 918 | return 0 |
| 919 | fi |
| 920 | } |
| 921 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 922 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 923 | handshake_memory_get() { |
| 924 | OUTPUT_VARIABLE="$1" |
| 925 | OUTPUT_FILE="$2" |
| 926 | |
| 927 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 928 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 929 | |
| 930 | # Check if memory usage was read |
| 931 | if [ -z "$MEM_USAGE" ]; then |
| 932 | echo "Error: Can not read the value of handshake memory usage" |
| 933 | return 1 |
| 934 | else |
| 935 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 936 | return 0 |
| 937 | fi |
| 938 | } |
| 939 | |
| 940 | # Get handshake memory usage from server or client output and check if this value |
| 941 | # is not higher than the maximum given by the first argument |
| 942 | handshake_memory_check() { |
| 943 | MAX_MEMORY="$1" |
| 944 | OUTPUT_FILE="$2" |
| 945 | |
| 946 | # Get memory usage |
| 947 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 948 | return 1 |
| 949 | fi |
| 950 | |
| 951 | # Check if memory usage is below max value |
| 952 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 953 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 954 | "but should be below $MAX_MEMORY bytes" |
| 955 | return 1 |
| 956 | else |
| 957 | return 0 |
| 958 | fi |
| 959 | } |
| 960 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 961 | # wait for client to terminate and set CLI_EXIT |
| 962 | # must be called right after starting the client |
| 963 | wait_client_done() { |
| 964 | CLI_PID=$! |
| 965 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 966 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 967 | CLI_DELAY_FACTOR=1 |
| 968 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 969 | ( 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] | 970 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 971 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 972 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 973 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 974 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 975 | CLI_EXIT=$? |
| 976 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 977 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 978 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 979 | |
| 980 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 981 | |
| 982 | sleep $SRV_DELAY_SECONDS |
| 983 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 984 | } |
| 985 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 986 | # check if the given command uses dtls and sets global variable DTLS |
| 987 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 988 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 989 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 990 | *) DTLS=0;; |
| 991 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 992 | } |
| 993 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 994 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 995 | is_gnutls() { |
| 996 | case "$1" in |
| 997 | *gnutls-cli*) |
| 998 | CMD_IS_GNUTLS=1 |
| 999 | ;; |
| 1000 | *gnutls-serv*) |
| 1001 | CMD_IS_GNUTLS=1 |
| 1002 | ;; |
| 1003 | *) |
| 1004 | CMD_IS_GNUTLS=0 |
| 1005 | ;; |
| 1006 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1007 | } |
| 1008 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1009 | # Determine what calc_verify trace is to be expected, if any. |
| 1010 | # |
| 1011 | # calc_verify is only called for two things: to calculate the |
| 1012 | # extended master secret, and to process client authentication. |
| 1013 | # |
| 1014 | # Warning: the current implementation assumes that extended_ms is not |
| 1015 | # disabled on the client or on the server. |
| 1016 | # |
| 1017 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1018 | # * $1: the value of the server auth_mode parameter. |
| 1019 | # 'required' if client authentication is expected, |
| 1020 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1021 | # * $CONFIGS_ENABLED |
| 1022 | # |
| 1023 | # Outputs: |
| 1024 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1025 | set_maybe_calc_verify() { |
| 1026 | maybe_calc_verify= |
| 1027 | case $CONFIGS_ENABLED in |
| 1028 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1029 | *) |
| 1030 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1031 | ''|none) return;; |
| 1032 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1033 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1034 | esac |
| 1035 | esac |
| 1036 | case $CONFIGS_ENABLED in |
| 1037 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1038 | *) maybe_calc_verify="<= calc verify";; |
| 1039 | esac |
| 1040 | } |
| 1041 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1042 | # Compare file content |
| 1043 | # Usage: find_in_both pattern file1 file2 |
| 1044 | # extract from file1 the first line matching the pattern |
| 1045 | # check in file2 that the same line can be found |
| 1046 | find_in_both() { |
| 1047 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1048 | if [ -z "$srv_pattern" ]; then |
| 1049 | return 1; |
| 1050 | fi |
| 1051 | |
| 1052 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1053 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1054 | else |
| 1055 | return 1; |
| 1056 | fi |
| 1057 | } |
| 1058 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1059 | SKIP_HANDSHAKE_CHECK="NO" |
| 1060 | skip_handshake_stage_check() { |
| 1061 | SKIP_HANDSHAKE_CHECK="YES" |
| 1062 | } |
| 1063 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1064 | # Analyze the commands that will be used in a test. |
| 1065 | # |
| 1066 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1067 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1068 | # |
| 1069 | # Inputs: |
| 1070 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1071 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1072 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1073 | # |
| 1074 | # Outputs: |
| 1075 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1076 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1077 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1078 | # 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] | 1079 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1080 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1081 | case " $SRV_CMD " in |
| 1082 | *' server_addr=::1 '*) |
| 1083 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1084 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1085 | fi |
| 1086 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1087 | # update CMD_IS_GNUTLS variable |
| 1088 | is_gnutls "$SRV_CMD" |
| 1089 | |
| 1090 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1091 | # set the default priority |
| 1092 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1093 | case "$SRV_CMD" in |
| 1094 | *--priority*) :;; |
| 1095 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1096 | esac |
| 1097 | fi |
| 1098 | |
| 1099 | # update CMD_IS_GNUTLS variable |
| 1100 | is_gnutls "$CLI_CMD" |
| 1101 | |
| 1102 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1103 | # set the default priority |
| 1104 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1105 | case "$CLI_CMD" in |
| 1106 | *--priority*) :;; |
| 1107 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1108 | esac |
| 1109 | fi |
| 1110 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1111 | # fix client port |
| 1112 | if [ -n "$PXY_CMD" ]; then |
| 1113 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1114 | else |
| 1115 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1116 | fi |
| 1117 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1118 | # prepend valgrind to our commands if active |
| 1119 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1120 | if is_polar "$SRV_CMD"; then |
| 1121 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1122 | fi |
| 1123 | if is_polar "$CLI_CMD"; then |
| 1124 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1125 | fi |
| 1126 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1127 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1128 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1129 | # Check for failure conditions after a test case. |
| 1130 | # |
| 1131 | # Inputs from run_test: |
| 1132 | # * positional parameters: test options (see run_test documentation) |
| 1133 | # * $CLI_EXIT: client return code |
| 1134 | # * $CLI_EXPECT: expected client return code |
| 1135 | # * $SRV_RET: server return code |
| 1136 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1137 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1138 | # |
| 1139 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1140 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1141 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1142 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1143 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1144 | if [ $TIMES_LEFT -gt 0 ] && |
| 1145 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1146 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1147 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1148 | return |
| 1149 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1150 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1151 | # 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] | 1152 | # (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] | 1153 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1154 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1155 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1156 | then |
| 1157 | if is_polar "$SRV_CMD"; then |
| 1158 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1159 | else |
| 1160 | fail "server or client failed to reach handshake stage" |
| 1161 | return |
| 1162 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1163 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1164 | if is_polar "$CLI_CMD"; then |
| 1165 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1166 | else |
| 1167 | fail "server or client failed to reach handshake stage" |
| 1168 | return |
| 1169 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1170 | fi |
| 1171 | fi |
| 1172 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1173 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1174 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1175 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1176 | # care anyway), in case e.g. the server reports a memory leak. |
| 1177 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1178 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1179 | return |
| 1180 | fi |
| 1181 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1182 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1183 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1184 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1185 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1186 | 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] | 1187 | return |
| 1188 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1189 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1190 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1191 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1192 | # 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] | 1193 | while [ $# -gt 0 ] |
| 1194 | do |
| 1195 | case $1 in |
| 1196 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1197 | 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] | 1198 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1199 | return |
| 1200 | fi |
| 1201 | ;; |
| 1202 | |
| 1203 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1204 | 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] | 1205 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1206 | return |
| 1207 | fi |
| 1208 | ;; |
| 1209 | |
| 1210 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1211 | 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] | 1212 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1213 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1214 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1215 | return |
| 1216 | fi |
| 1217 | ;; |
| 1218 | |
| 1219 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1220 | 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] | 1221 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1222 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1223 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1224 | return |
| 1225 | fi |
| 1226 | ;; |
| 1227 | |
| 1228 | # The filtering in the following two options (-u and -U) do the following |
| 1229 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1230 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1231 | # - keep one of each non-unique line |
| 1232 | # - count how many lines remain |
| 1233 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1234 | # if there were no duplicates. |
| 1235 | "-U") |
| 1236 | 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 |
| 1237 | fail "lines following pattern '$2' must be unique in Server output" |
| 1238 | return |
| 1239 | fi |
| 1240 | ;; |
| 1241 | |
| 1242 | "-u") |
| 1243 | 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 |
| 1244 | 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] | 1245 | return |
| 1246 | fi |
| 1247 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1248 | "-F") |
| 1249 | if ! $2 "$SRV_OUT"; then |
| 1250 | fail "function call to '$2' failed on Server output" |
| 1251 | return |
| 1252 | fi |
| 1253 | ;; |
| 1254 | "-f") |
| 1255 | if ! $2 "$CLI_OUT"; then |
| 1256 | fail "function call to '$2' failed on Client output" |
| 1257 | return |
| 1258 | fi |
| 1259 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1260 | "-g") |
| 1261 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1262 | fail "function call to '$2' failed on Server and Client output" |
| 1263 | return |
| 1264 | fi |
| 1265 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1266 | |
| 1267 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1268 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1269 | exit 1 |
| 1270 | esac |
| 1271 | shift 2 |
| 1272 | done |
| 1273 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1274 | # check valgrind's results |
| 1275 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1276 | 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] | 1277 | fail "Server has memory errors" |
| 1278 | return |
| 1279 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1280 | 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] | 1281 | fail "Client has memory errors" |
| 1282 | return |
| 1283 | fi |
| 1284 | fi |
| 1285 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1286 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1287 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1288 | } |
| 1289 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1290 | # Run the current test case: start the server and if applicable the proxy, run |
| 1291 | # the client, wait for all processes to finish or time out. |
| 1292 | # |
| 1293 | # Inputs: |
| 1294 | # * $NAME: test case name |
| 1295 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1296 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1297 | # |
| 1298 | # Outputs: |
| 1299 | # * $CLI_EXIT: client return code |
| 1300 | # * $SRV_RET: server return code |
| 1301 | do_run_test_once() { |
| 1302 | # run the commands |
| 1303 | if [ -n "$PXY_CMD" ]; then |
| 1304 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1305 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1306 | PXY_PID=$! |
| 1307 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1308 | fi |
| 1309 | |
| 1310 | check_osrv_dtls |
| 1311 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1312 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1313 | SRV_PID=$! |
| 1314 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1315 | |
| 1316 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1317 | # The client must be a subprocess of the script in order for killing it to |
| 1318 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1319 | # not at the end of the line: the latter approach will spawn eval as a |
| 1320 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1321 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1322 | wait_client_done |
| 1323 | |
| 1324 | sleep 0.05 |
| 1325 | |
| 1326 | # terminate the server (and the proxy) |
| 1327 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1328 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1329 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1330 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1331 | SRV_RET=$? |
| 1332 | |
| 1333 | if [ -n "$PXY_CMD" ]; then |
| 1334 | kill $PXY_PID >/dev/null 2>&1 |
| 1335 | wait $PXY_PID |
| 1336 | fi |
| 1337 | } |
| 1338 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1339 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1340 | # Options: -s pattern pattern that must be present in server output |
| 1341 | # -c pattern pattern that must be present in client output |
| 1342 | # -u pattern lines after pattern must be unique in client output |
| 1343 | # -f call shell function on client output |
| 1344 | # -S pattern pattern that must be absent in server output |
| 1345 | # -C pattern pattern that must be absent in client output |
| 1346 | # -U pattern lines after pattern must be unique in server output |
| 1347 | # -F call shell function on server output |
| 1348 | # -g call shell function on server and client output |
| 1349 | run_test() { |
| 1350 | NAME="$1" |
| 1351 | shift 1 |
| 1352 | |
| 1353 | if is_excluded "$NAME"; then |
| 1354 | SKIP_NEXT="NO" |
| 1355 | # There was no request to run the test, so don't record its outcome. |
| 1356 | return |
| 1357 | fi |
| 1358 | |
| 1359 | print_name "$NAME" |
| 1360 | |
| 1361 | # Do we only run numbered tests? |
| 1362 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1363 | case ",$RUN_TEST_NUMBER," in |
| 1364 | *",$TESTS,"*) :;; |
| 1365 | *) SKIP_NEXT="YES";; |
| 1366 | esac |
| 1367 | fi |
| 1368 | |
| 1369 | # does this test use a proxy? |
| 1370 | if [ "X$1" = "X-p" ]; then |
| 1371 | PXY_CMD="$2" |
| 1372 | shift 2 |
| 1373 | else |
| 1374 | PXY_CMD="" |
| 1375 | fi |
| 1376 | |
| 1377 | # get commands and client output |
| 1378 | SRV_CMD="$1" |
| 1379 | CLI_CMD="$2" |
| 1380 | CLI_EXPECT="$3" |
| 1381 | shift 3 |
| 1382 | |
| 1383 | # Check if test uses files |
| 1384 | case "$SRV_CMD $CLI_CMD" in |
| 1385 | *data_files/*) |
| 1386 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1387 | esac |
| 1388 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1389 | # Check if the test uses DTLS. |
| 1390 | detect_dtls "$SRV_CMD" |
| 1391 | if [ "$DTLS" -eq 1 ]; then |
| 1392 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1393 | fi |
| 1394 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1395 | # If the client or server requires certain features that can be detected |
| 1396 | # from their command-line arguments, check that they're enabled. |
| 1397 | detect_required_features "$SRV_CMD" "$@" |
| 1398 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1399 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1400 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1401 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1402 | |
| 1403 | # should we skip? |
| 1404 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1405 | SKIP_NEXT="NO" |
| 1406 | record_outcome "SKIP" |
| 1407 | SKIPS=$(( $SKIPS + 1 )) |
| 1408 | return |
| 1409 | fi |
| 1410 | |
| 1411 | analyze_test_commands "$@" |
| 1412 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1413 | # One regular run and two retries |
| 1414 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1415 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1416 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1417 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1418 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1419 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1420 | check_test_failure "$@" |
| 1421 | case $outcome in |
| 1422 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1423 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1424 | FAIL) return;; |
| 1425 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1426 | done |
| 1427 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1428 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1429 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1430 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1431 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1432 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1433 | if [ -n "$PXY_CMD" ]; then |
| 1434 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1435 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1436 | fi |
| 1437 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1438 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1439 | } |
| 1440 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1441 | run_test_psa() { |
| 1442 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1443 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1444 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1445 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1446 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1447 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1448 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1449 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1450 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1451 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1452 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1453 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1454 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1455 | -S "error" \ |
| 1456 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1457 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1458 | } |
| 1459 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1460 | run_test_psa_force_curve() { |
| 1461 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1462 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1463 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1464 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1465 | "$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] | 1466 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1467 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1468 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1469 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1470 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1471 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1472 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1473 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1474 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1475 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1476 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1477 | } |
| 1478 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1479 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1480 | # a maximum fragment length. |
| 1481 | # first argument ($1) is MFL for SSL client |
| 1482 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1483 | run_test_memory_after_hanshake_with_mfl() |
| 1484 | { |
| 1485 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1486 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1487 | |
| 1488 | # Leave some margin for robustness |
| 1489 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1490 | |
| 1491 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1492 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1493 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1494 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1495 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1496 | 0 \ |
| 1497 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1498 | } |
| 1499 | |
| 1500 | |
| 1501 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1502 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1503 | run_tests_memory_after_hanshake() |
| 1504 | { |
| 1505 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1506 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1507 | |
| 1508 | # first test with default MFU is to get reference memory usage |
| 1509 | MEMORY_USAGE_MFL_16K=0 |
| 1510 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1511 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1512 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1513 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1514 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1515 | 0 \ |
| 1516 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1517 | |
| 1518 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1519 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1520 | |
| 1521 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1522 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1523 | |
| 1524 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1525 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1526 | |
| 1527 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1528 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1529 | } |
| 1530 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1531 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1532 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1533 | rm -f context_srv.txt |
| 1534 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1535 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1536 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1537 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1538 | 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] | 1539 | exit 1 |
| 1540 | } |
| 1541 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1542 | # |
| 1543 | # MAIN |
| 1544 | # |
| 1545 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1546 | get_options "$@" |
| 1547 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1548 | populate_enabled_hash_algs |
| 1549 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1550 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1551 | # patterns rather than regular expressions, use a case statement instead |
| 1552 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1553 | # detects simple cases: plain substring, everything, nothing. |
| 1554 | # |
| 1555 | # As an exception, the character '.' is treated as an ordinary character |
| 1556 | # if it is the only special character in the string. This is because it's |
| 1557 | # rare to need "any one character", but needing a literal '.' is common |
| 1558 | # (e.g. '-f "DTLS 1.2"'). |
| 1559 | need_grep= |
| 1560 | case "$FILTER" in |
| 1561 | '^$') simple_filter=;; |
| 1562 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1563 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1564 | need_grep=1;; |
| 1565 | *) # No regexp or shell-pattern special character |
| 1566 | simple_filter="*$FILTER*";; |
| 1567 | esac |
| 1568 | case "$EXCLUDE" in |
| 1569 | '^$') simple_exclude=;; |
| 1570 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1571 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1572 | need_grep=1;; |
| 1573 | *) # No regexp or shell-pattern special character |
| 1574 | simple_exclude="*$EXCLUDE*";; |
| 1575 | esac |
| 1576 | if [ -n "$need_grep" ]; then |
| 1577 | is_excluded () { |
| 1578 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1579 | } |
| 1580 | else |
| 1581 | is_excluded () { |
| 1582 | case "$1" in |
| 1583 | $simple_exclude) true;; |
| 1584 | $simple_filter) false;; |
| 1585 | *) true;; |
| 1586 | esac |
| 1587 | } |
| 1588 | fi |
| 1589 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1590 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1591 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1592 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1593 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1594 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1595 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1596 | exit 1 |
| 1597 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1598 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1599 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1600 | exit 1 |
| 1601 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1602 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1603 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1604 | exit 1 |
| 1605 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1606 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1607 | if which valgrind >/dev/null 2>&1; then :; else |
| 1608 | echo "Memcheck not possible. Valgrind not found" |
| 1609 | exit 1 |
| 1610 | fi |
| 1611 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1612 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1613 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1614 | exit 1 |
| 1615 | fi |
| 1616 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1617 | # used by watchdog |
| 1618 | MAIN_PID="$$" |
| 1619 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1620 | # We use somewhat arbitrary delays for tests: |
| 1621 | # - how long do we wait for the server to start (when lsof not available)? |
| 1622 | # - how long do we allow for the client to finish? |
| 1623 | # (not to check performance, just to avoid waiting indefinitely) |
| 1624 | # Things are slower with valgrind, so give extra time here. |
| 1625 | # |
| 1626 | # Note: without lsof, there is a trade-off between the running time of this |
| 1627 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1628 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1629 | # 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] | 1630 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1631 | START_DELAY=6 |
| 1632 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1633 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1634 | START_DELAY=2 |
| 1635 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1636 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1637 | |
| 1638 | # some particular tests need more time: |
| 1639 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1640 | # - for the server, we sleep for a number of seconds after the client exits |
| 1641 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1642 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1643 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1644 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1645 | # 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] | 1646 | # +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] | 1647 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1648 | # 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] | 1649 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1650 | 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] | 1651 | 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] | 1652 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1653 | 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] | 1654 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1655 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1656 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1657 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1658 | 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] | 1659 | 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] | 1660 | fi |
| 1661 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1662 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1663 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1664 | 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] | 1665 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1666 | 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] | 1667 | fi |
| 1668 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1669 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1670 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1671 | 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] | 1672 | fi |
| 1673 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1674 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1675 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1676 | 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] | 1677 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1678 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1679 | # Allow SHA-1, because many of our test certificates use it |
| 1680 | P_SRV="$P_SRV allow_sha1=1" |
| 1681 | P_CLI="$P_CLI allow_sha1=1" |
| 1682 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1683 | # Also pick a unique name for intermediate files |
| 1684 | SRV_OUT="srv_out.$$" |
| 1685 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1686 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1687 | SESSION="session.$$" |
| 1688 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1689 | SKIP_NEXT="NO" |
| 1690 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1691 | trap cleanup INT TERM HUP |
| 1692 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1693 | # Basic test |
| 1694 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1695 | # Checks that: |
| 1696 | # - 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] | 1697 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1699 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1700 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1701 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1702 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1703 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1704 | "$P_CLI" \ |
| 1705 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1706 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1707 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1708 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1709 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1710 | -S "error" \ |
| 1711 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1714 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1715 | run_test "Default, DTLS" \ |
| 1716 | "$P_SRV dtls=1" \ |
| 1717 | "$P_CLI dtls=1" \ |
| 1718 | 0 \ |
| 1719 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1720 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1723 | run_test "TLS client auth: required" \ |
| 1724 | "$P_SRV auth_mode=required" \ |
| 1725 | "$P_CLI" \ |
| 1726 | 0 \ |
| 1727 | -s "Verifying peer X.509 certificate... ok" |
| 1728 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1730 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1731 | "$P_SRV" \ |
| 1732 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1733 | 0 \ |
| 1734 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1735 | -c "Key size is 256" |
| 1736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1738 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1739 | "$P_SRV" \ |
| 1740 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1741 | 0 \ |
| 1742 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1743 | -c "Key size is 128" |
| 1744 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1747 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1748 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1749 | run_test "TLS: password protected client key" \ |
| 1750 | "$P_SRV auth_mode=required" \ |
| 1751 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1752 | 0 |
| 1753 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1756 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1757 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1758 | run_test "TLS: password protected server key" \ |
| 1759 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1760 | "$P_CLI" \ |
| 1761 | 0 |
| 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 |
| 1766 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1767 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1768 | run_test "TLS: password protected server key, two certificates" \ |
| 1769 | "$P_SRV \ |
| 1770 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1771 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1772 | "$P_CLI" \ |
| 1773 | 0 |
| 1774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1776 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1777 | run_test "CA callback on client" \ |
| 1778 | "$P_SRV debug_level=3" \ |
| 1779 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1780 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1781 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1782 | -S "error" \ |
| 1783 | -C "error" |
| 1784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1786 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1787 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1788 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1789 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1790 | run_test "CA callback on server" \ |
| 1791 | "$P_SRV auth_mode=required" \ |
| 1792 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1793 | key_file=data_files/server5.key" \ |
| 1794 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1795 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1796 | -s "Verifying peer X.509 certificate... ok" \ |
| 1797 | -S "error" \ |
| 1798 | -C "error" |
| 1799 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1800 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1802 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1803 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1804 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1805 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1806 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1807 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1808 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1809 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1810 | 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] | 1811 | 0 \ |
| 1812 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1813 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1814 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1815 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1816 | -S "error" \ |
| 1817 | -C "error" |
| 1818 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1819 | # Test using a RSA opaque private key for client authentication |
| 1820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1821 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1822 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1823 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1824 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1825 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1826 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1827 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1828 | key_file=data_files/server2.key" \ |
| 1829 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1830 | 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] | 1831 | 0 \ |
| 1832 | -c "key type: Opaque" \ |
| 1833 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1834 | -s "Verifying peer X.509 certificate... ok" \ |
| 1835 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1836 | -S "error" \ |
| 1837 | -C "error" |
| 1838 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1840 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1841 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_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: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +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 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1849 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1850 | 0 \ |
| 1851 | -c "key type: Opaque" \ |
| 1852 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1853 | -s "Verifying peer X.509 certificate... ok" \ |
| 1854 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1855 | -S "error" \ |
| 1856 | -C "error" |
| 1857 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1858 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1860 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1861 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1862 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1863 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1864 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1865 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1866 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1867 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1868 | 0 \ |
| 1869 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1870 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1871 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1872 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1873 | -S "error" \ |
| 1874 | -C "error" |
| 1875 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1877 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1878 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1879 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1880 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1881 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1882 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1883 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1884 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1885 | "$P_CLI" \ |
| 1886 | 0 \ |
| 1887 | -c "Verifying peer X.509 certificate... ok" \ |
| 1888 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1889 | -s "key types: Opaque, none" \ |
| 1890 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1891 | -S "error" \ |
| 1892 | -C "error" |
| 1893 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [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 | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1898 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1899 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1900 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1901 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1902 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1903 | debug_level=1" \ |
| 1904 | "$P_CLI" \ |
| 1905 | 1 \ |
| 1906 | -s "key types: Opaque, none" \ |
| 1907 | -s "error" \ |
| 1908 | -c "error" \ |
| 1909 | -c "Public key type mismatch" |
| 1910 | |
| 1911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1913 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1914 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1915 | requires_config_enabled MBEDTLS_RSA_C |
| 1916 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1917 | requires_hash_alg SHA_256 |
| 1918 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1919 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1920 | key_file=data_files/server2.key key_opaque_algs=ecdh,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_SSL_ASYNC_PRIVATE |
| 1934 | requires_hash_alg SHA_256 |
| 1935 | 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] | 1936 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1937 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1938 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1939 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1940 | 1 \ |
| 1941 | -s "key types: Opaque, none" \ |
| 1942 | -s "got ciphersuites in common, but none of them usable" \ |
| 1943 | -s "error" \ |
| 1944 | -c "error" |
| 1945 | |
| 1946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1947 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1948 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1949 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1950 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1952 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1953 | 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] | 1954 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1955 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1956 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1957 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +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 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1968 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1970 | 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] | 1971 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1972 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 1973 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1974 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1975 | 1 \ |
| 1976 | -s "key types: Opaque, none" \ |
| 1977 | -s "got ciphersuites in common, but none of them usable" \ |
| 1978 | -s "error" \ |
| 1979 | -c "error" |
| 1980 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 1981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1982 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1983 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1984 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1985 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 1986 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 1987 | 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] | 1988 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 1989 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 1990 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 1991 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1992 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 1993 | 0 \ |
| 1994 | -c "Verifying peer X.509 certificate... ok" \ |
| 1995 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 1996 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 1997 | -s "key types: Opaque, Opaque" \ |
| 1998 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1999 | -S "error" \ |
| 2000 | -C "error" |
| 2001 | |
| 2002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2003 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2004 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2005 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2006 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2007 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2008 | 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] | 2009 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2010 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2011 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2012 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2013 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2014 | 0 \ |
| 2015 | -c "Verifying peer X.509 certificate... ok" \ |
| 2016 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2017 | -c "CN=Polarssl Test EC CA" \ |
| 2018 | -s "key types: Opaque, Opaque" \ |
| 2019 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2020 | -S "error" \ |
| 2021 | -C "error" |
| 2022 | |
| 2023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2025 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2026 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2027 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2029 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2030 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2031 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2032 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2033 | crt_file2=data_files/server2-sha256.crt \ |
| 2034 | 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] | 2035 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2036 | 0 \ |
| 2037 | -c "Verifying peer X.509 certificate... ok" \ |
| 2038 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2039 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2040 | -s "key types: Opaque, Opaque" \ |
| 2041 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2042 | -S "error" \ |
| 2043 | -C "error" |
| 2044 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2046 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2047 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2048 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2049 | "$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] | 2050 | "$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] | 2051 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2052 | -s "The SSL configuration is tls13 only" \ |
| 2053 | -c "key type: Opaque" \ |
| 2054 | -s "key types: Opaque, Opaque" \ |
| 2055 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2056 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2057 | |
| 2058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2059 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2060 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2061 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2062 | "$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] | 2063 | "$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] | 2064 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2065 | -s "The SSL configuration is tls13 only" \ |
| 2066 | -c "key type: Opaque" \ |
| 2067 | -s "key types: Opaque, Opaque" \ |
| 2068 | -C "error" \ |
| 2069 | -S "error" \ |
| 2070 | |
| 2071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2072 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2073 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2074 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2075 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2076 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2077 | 0 \ |
| 2078 | -s "The SSL configuration is tls13 only" \ |
| 2079 | -s "key types: Opaque, Opaque" \ |
| 2080 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2081 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2082 | -C "error" \ |
| 2083 | -S "error" \ |
| 2084 | |
| 2085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2086 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2087 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2088 | 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] | 2089 | "$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] | 2090 | "$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] | 2091 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2092 | -s "The SSL configuration is tls13 only" \ |
| 2093 | -c "key type: Opaque" \ |
| 2094 | -s "key types: Opaque, Opaque" \ |
| 2095 | -C "error" \ |
| 2096 | -S "error" \ |
| 2097 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2098 | # Test using a RSA opaque private key for server authentication |
| 2099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2100 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2101 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2102 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2103 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2104 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2105 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2106 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2107 | 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] | 2108 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2109 | 0 \ |
| 2110 | -c "Verifying peer X.509 certificate... ok" \ |
| 2111 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2112 | -s "key types: Opaque, none" \ |
| 2113 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2114 | -S "error" \ |
| 2115 | -C "error" |
| 2116 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 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: DHE-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 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2127 | 0 \ |
| 2128 | -c "Verifying peer X.509 certificate... ok" \ |
| 2129 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2130 | -s "key types: Opaque, none" \ |
| 2131 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2132 | -S "error" \ |
| 2133 | -C "error" |
| 2134 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [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 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2139 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2140 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2141 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2142 | psk=abc123 psk_identity=foo" \ |
| 2143 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2144 | psk=abc123 psk_identity=foo" \ |
| 2145 | 0 \ |
| 2146 | -c "Verifying peer X.509 certificate... ok" \ |
| 2147 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2148 | -s "key types: Opaque, Opaque" \ |
| 2149 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2150 | -S "error" \ |
| 2151 | -C "error" |
| 2152 | |
| 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 |
| 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-" \ |
| 2159 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2160 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2161 | 0 \ |
| 2162 | -c "Verifying peer X.509 certificate... ok" \ |
| 2163 | -c "Ciphersuite is TLS-RSA-" \ |
| 2164 | -s "key types: Opaque, Opaque" \ |
| 2165 | -s "Ciphersuite is TLS-RSA-" \ |
| 2166 | -S "error" \ |
| 2167 | -C "error" |
| 2168 | |
| 2169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2170 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2171 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2173 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2174 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2175 | 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] | 2176 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2177 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2178 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2179 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2180 | 1 \ |
| 2181 | -s "key types: Opaque, none" \ |
| 2182 | -s "got ciphersuites in common, but none of them usable" \ |
| 2183 | -s "error" \ |
| 2184 | -c "error" |
| 2185 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2187 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2188 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2189 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2190 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2191 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2192 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2193 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +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 \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2196 | crt_file2=data_files/server4.crt \ |
| 2197 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2198 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2199 | 0 \ |
| 2200 | -c "Verifying peer X.509 certificate... ok" \ |
| 2201 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2202 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2203 | -s "key types: Opaque, Opaque" \ |
| 2204 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2205 | -S "error" \ |
| 2206 | -C "error" |
| 2207 | |
| 2208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2209 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2210 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2211 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2212 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2213 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2215 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2216 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2217 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2218 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2219 | crt_file2=data_files/server4.crt \ |
| 2220 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2221 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2222 | 0 \ |
| 2223 | -c "Verifying peer X.509 certificate... ok" \ |
| 2224 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2225 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2226 | -s "key types: Opaque, Opaque" \ |
| 2227 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2228 | -S "error" \ |
| 2229 | -C "error" |
| 2230 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2231 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2234 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2235 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2236 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2237 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2238 | "$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] | 2239 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2240 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2241 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2242 | 0 \ |
| 2243 | -c "key type: Opaque" \ |
| 2244 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2245 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2246 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2247 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2248 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2249 | -S "error" \ |
| 2250 | -C "error" |
| 2251 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2252 | # Test using a RSA opaque private key for client/server authentication |
| 2253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2254 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2255 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2256 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2257 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2258 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2259 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2260 | "$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] | 2261 | 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] | 2262 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2263 | 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] | 2264 | 0 \ |
| 2265 | -c "key type: Opaque" \ |
| 2266 | -c "Verifying peer X.509 certificate... ok" \ |
| 2267 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2268 | -s "key types: Opaque, none" \ |
| 2269 | -s "Verifying peer X.509 certificate... ok" \ |
| 2270 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2271 | -S "error" \ |
| 2272 | -C "error" |
| 2273 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2275 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2276 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2277 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2278 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2279 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2280 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2281 | "$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] | 2282 | 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] | 2283 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2284 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2285 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2286 | 0 \ |
| 2287 | -c "key type: Opaque" \ |
| 2288 | -c "Verifying peer X.509 certificate... ok" \ |
| 2289 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2290 | -s "key types: Opaque, none" \ |
| 2291 | -s "Verifying peer X.509 certificate... ok" \ |
| 2292 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2293 | -S "error" \ |
| 2294 | -C "error" |
| 2295 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2296 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2297 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2298 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2299 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2300 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2301 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2302 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2303 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2304 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2305 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2306 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2307 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2308 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2310 | run_test_psa_force_curve "secp521r1" |
| 2311 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2312 | run_test_psa_force_curve "brainpoolP512r1" |
| 2313 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2314 | run_test_psa_force_curve "secp384r1" |
| 2315 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2316 | run_test_psa_force_curve "brainpoolP384r1" |
| 2317 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2318 | run_test_psa_force_curve "secp256r1" |
| 2319 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2320 | run_test_psa_force_curve "secp256k1" |
| 2321 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2322 | run_test_psa_force_curve "brainpoolP256r1" |
| 2323 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2324 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2325 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2326 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2327 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2328 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2329 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2330 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2331 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2332 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2333 | run_test_psa_force_curve "secp192r1" |
| 2334 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2335 | run_test_psa_force_curve "secp192k1" |
| 2336 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2337 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2340 | run_test "ServerHello contains gmt_unix_time" \ |
| 2341 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2342 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2343 | 0 \ |
| 2344 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2345 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2346 | |
| 2347 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2349 | run_test "Unique IV in GCM" \ |
| 2350 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2351 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2352 | 0 \ |
| 2353 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2354 | -U "IV used" |
| 2355 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2356 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2358 | run_test "Configuration-specific CRT verification callback" \ |
| 2359 | "$P_SRV debug_level=3" \ |
| 2360 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2361 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2362 | -S "error" \ |
| 2363 | -c "Verify requested for " \ |
| 2364 | -c "Use configuration-specific verification callback" \ |
| 2365 | -C "Use context-specific verification callback" \ |
| 2366 | -C "error" |
| 2367 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2369 | run_test "Context-specific CRT verification callback" \ |
| 2370 | "$P_SRV debug_level=3" \ |
| 2371 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2372 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2373 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2374 | -c "Verify requested for " \ |
| 2375 | -c "Use context-specific verification callback" \ |
| 2376 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2377 | -C "error" |
| 2378 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2379 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2381 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2382 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2383 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2384 | 1 \ |
| 2385 | -c "The certificate is signed with an unacceptable hash" |
| 2386 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2388 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2389 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2390 | "$P_CLI allow_sha1=1" \ |
| 2391 | 0 |
| 2392 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2394 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2395 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2396 | "$P_CLI allow_sha1=0" \ |
| 2397 | 0 |
| 2398 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2400 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2401 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2402 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2403 | 1 \ |
| 2404 | -s "The certificate is signed with an unacceptable hash" |
| 2405 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2407 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2408 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2409 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2410 | 0 |
| 2411 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2413 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2414 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2415 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2416 | 0 |
| 2417 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2418 | # Dummy TLS 1.3 test |
| 2419 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2420 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2424 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2425 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2426 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2427 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2428 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2429 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2433 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2434 | 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] | 2435 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2436 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2437 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2438 | |
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: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 2444 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2445 | "$P_CLI tls13_kex_modes=ephemeral" \ |
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: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2453 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2454 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 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: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2462 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2463 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 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" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2471 | "$P_SRV tls13_kex_modes=all" \ |
| 2472 | "$P_CLI tls13_kex_modes=all" \ |
| 2473 | 0 |
| 2474 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2475 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2477 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2478 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2479 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2480 | 0 \ |
| 2481 | -c "next record in same datagram" \ |
| 2482 | -s "next record in same datagram" |
| 2483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2485 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2486 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2487 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2488 | 0 \ |
| 2489 | -s "next record in same datagram" \ |
| 2490 | -C "next record in same datagram" |
| 2491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2493 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2494 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2495 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2496 | 0 \ |
| 2497 | -S "next record in same datagram" \ |
| 2498 | -c "next record in same datagram" |
| 2499 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2501 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2502 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2503 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2504 | 0 \ |
| 2505 | -S "next record in same datagram" \ |
| 2506 | -C "next record in same datagram" |
| 2507 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2508 | # Tests for Context serialization |
| 2509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2512 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2513 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2514 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2515 | 0 \ |
| 2516 | -c "Deserializing connection..." \ |
| 2517 | -S "Deserializing connection..." |
| 2518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2520 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2521 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2522 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2523 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2524 | 0 \ |
| 2525 | -c "Deserializing connection..." \ |
| 2526 | -S "Deserializing connection..." |
| 2527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2529 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2530 | run_test "Context serialization, client serializes, GCM" \ |
| 2531 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2532 | "$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] | 2533 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2534 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 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 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2539 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2540 | run_test "Context serialization, client serializes, with CID" \ |
| 2541 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2542 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2543 | 0 \ |
| 2544 | -c "Deserializing connection..." \ |
| 2545 | -S "Deserializing connection..." |
| 2546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2548 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2549 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2550 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2551 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2552 | 0 \ |
| 2553 | -C "Deserializing connection..." \ |
| 2554 | -s "Deserializing connection..." |
| 2555 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2557 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2558 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2559 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2560 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2566 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2567 | run_test "Context serialization, server serializes, GCM" \ |
| 2568 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2569 | "$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] | 2570 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2571 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 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 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2575 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2577 | run_test "Context serialization, server serializes, with CID" \ |
| 2578 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2579 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2580 | 0 \ |
| 2581 | -C "Deserializing connection..." \ |
| 2582 | -s "Deserializing connection..." |
| 2583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2585 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2586 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2587 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2588 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2589 | 0 \ |
| 2590 | -c "Deserializing connection..." \ |
| 2591 | -s "Deserializing connection..." |
| 2592 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2594 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2595 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2596 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2597 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2603 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2604 | run_test "Context serialization, both serialize, GCM" \ |
| 2605 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2606 | "$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] | 2607 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2608 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 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 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2613 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2614 | run_test "Context serialization, both serialize, with CID" \ |
| 2615 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2616 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2617 | 0 \ |
| 2618 | -c "Deserializing connection..." \ |
| 2619 | -s "Deserializing connection..." |
| 2620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2623 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2624 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2625 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2626 | 0 \ |
| 2627 | -c "Deserializing connection..." \ |
| 2628 | -S "Deserializing connection..." |
| 2629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2632 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2633 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2634 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2641 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2642 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2643 | "$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] | 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 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2649 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2650 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2651 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2652 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2653 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2654 | 0 \ |
| 2655 | -c "Deserializing connection..." \ |
| 2656 | -S "Deserializing connection..." |
| 2657 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2659 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2660 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2661 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2662 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2663 | 0 \ |
| 2664 | -C "Deserializing connection..." \ |
| 2665 | -s "Deserializing connection..." |
| 2666 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2668 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2669 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2670 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2671 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2678 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2679 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2680 | "$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] | 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 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2687 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2688 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2689 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2690 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2691 | 0 \ |
| 2692 | -C "Deserializing connection..." \ |
| 2693 | -s "Deserializing connection..." |
| 2694 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2697 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2698 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2699 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2700 | 0 \ |
| 2701 | -c "Deserializing connection..." \ |
| 2702 | -s "Deserializing connection..." |
| 2703 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2705 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2706 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2707 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2708 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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 | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2714 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2715 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2716 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2717 | "$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] | 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 | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2723 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2724 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2725 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2726 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2727 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2728 | 0 \ |
| 2729 | -c "Deserializing connection..." \ |
| 2730 | -s "Deserializing connection..." |
| 2731 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2733 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2734 | run_test "Saving the serialized context to a file" \ |
| 2735 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2736 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2737 | 0 \ |
| 2738 | -s "Save serialized context to a file... ok" \ |
| 2739 | -c "Save serialized context to a file... ok" |
| 2740 | rm -f context_srv.txt |
| 2741 | rm -f context_cli.txt |
| 2742 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2743 | # Tests for DTLS Connection ID extension |
| 2744 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2745 | # So far, the CID API isn't implemented, so we can't |
| 2746 | # grep for output witnessing its use. This needs to be |
| 2747 | # changed once the CID extension is implemented. |
| 2748 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2750 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2751 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2752 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2753 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2754 | 0 \ |
| 2755 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2756 | -s "found CID extension" \ |
| 2757 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2758 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2759 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2760 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2761 | -C "found CID extension" \ |
| 2762 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2763 | -C "Copy CIDs into SSL transform" \ |
| 2764 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2767 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2768 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2769 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2770 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2771 | 0 \ |
| 2772 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2773 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2774 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2775 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2776 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2777 | -C "found CID extension" \ |
| 2778 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2779 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2780 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2781 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2783 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2784 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2785 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2786 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2787 | 0 \ |
| 2788 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2789 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2790 | -c "client hello, adding CID extension" \ |
| 2791 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2792 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2793 | -s "server hello, adding CID extension" \ |
| 2794 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2795 | -c "Use of CID extension negotiated" \ |
| 2796 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2797 | -c "Copy CIDs into SSL transform" \ |
| 2798 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2799 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2800 | -s "Use of Connection ID has been negotiated" \ |
| 2801 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2804 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2805 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2806 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2807 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2808 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2809 | 0 \ |
| 2810 | -c "Enable use of CID extension." \ |
| 2811 | -s "Enable use of CID extension." \ |
| 2812 | -c "client hello, adding CID extension" \ |
| 2813 | -s "found CID extension" \ |
| 2814 | -s "Use of CID extension negotiated" \ |
| 2815 | -s "server hello, adding CID extension" \ |
| 2816 | -c "found CID extension" \ |
| 2817 | -c "Use of CID extension negotiated" \ |
| 2818 | -s "Copy CIDs into SSL transform" \ |
| 2819 | -c "Copy CIDs into SSL transform" \ |
| 2820 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2821 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2822 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2823 | -c "Use of Connection ID has been negotiated" \ |
| 2824 | -c "ignoring unexpected CID" \ |
| 2825 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2826 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2827 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2828 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2829 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2830 | -p "$P_PXY mtu=800" \ |
| 2831 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2832 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2833 | 0 \ |
| 2834 | -c "Enable use of CID extension." \ |
| 2835 | -s "Enable use of CID extension." \ |
| 2836 | -c "client hello, adding CID extension" \ |
| 2837 | -s "found CID extension" \ |
| 2838 | -s "Use of CID extension negotiated" \ |
| 2839 | -s "server hello, adding CID extension" \ |
| 2840 | -c "found CID extension" \ |
| 2841 | -c "Use of CID extension negotiated" \ |
| 2842 | -s "Copy CIDs into SSL transform" \ |
| 2843 | -c "Copy CIDs into SSL transform" \ |
| 2844 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2845 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2846 | -s "Use of Connection ID has been negotiated" \ |
| 2847 | -c "Use of Connection ID has been negotiated" |
| 2848 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2850 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2851 | 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] | 2852 | -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] | 2853 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2854 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2855 | 0 \ |
| 2856 | -c "Enable use of CID extension." \ |
| 2857 | -s "Enable use of CID extension." \ |
| 2858 | -c "client hello, adding CID extension" \ |
| 2859 | -s "found CID extension" \ |
| 2860 | -s "Use of CID extension negotiated" \ |
| 2861 | -s "server hello, adding CID extension" \ |
| 2862 | -c "found CID extension" \ |
| 2863 | -c "Use of CID extension negotiated" \ |
| 2864 | -s "Copy CIDs into SSL transform" \ |
| 2865 | -c "Copy CIDs into SSL transform" \ |
| 2866 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2867 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2868 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2869 | -c "Use of Connection ID has been negotiated" \ |
| 2870 | -c "ignoring unexpected CID" \ |
| 2871 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2874 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2875 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2876 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2877 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2878 | 0 \ |
| 2879 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2880 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2881 | -c "client hello, adding CID extension" \ |
| 2882 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2883 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2884 | -s "server hello, adding CID extension" \ |
| 2885 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2886 | -c "Use of CID extension negotiated" \ |
| 2887 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2888 | -c "Copy CIDs into SSL transform" \ |
| 2889 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2890 | -s "Peer CID (length 0 Bytes):" \ |
| 2891 | -s "Use of Connection ID has been negotiated" \ |
| 2892 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2893 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2895 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2896 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2897 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2898 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2899 | 0 \ |
| 2900 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2901 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2902 | -c "client hello, adding CID extension" \ |
| 2903 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2904 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2905 | -s "server hello, adding CID extension" \ |
| 2906 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2907 | -c "Use of CID extension negotiated" \ |
| 2908 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2909 | -c "Copy CIDs into SSL transform" \ |
| 2910 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2911 | -c "Peer CID (length 0 Bytes):" \ |
| 2912 | -s "Use of Connection ID has been negotiated" \ |
| 2913 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2916 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2917 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2918 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2919 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2920 | 0 \ |
| 2921 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2922 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2923 | -c "client hello, adding CID extension" \ |
| 2924 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2925 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2926 | -s "server hello, adding CID extension" \ |
| 2927 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2928 | -c "Use of CID extension negotiated" \ |
| 2929 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2930 | -c "Copy CIDs into SSL transform" \ |
| 2931 | -S "Use of Connection ID has been negotiated" \ |
| 2932 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2933 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2935 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2936 | 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] | 2937 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2938 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2939 | 0 \ |
| 2940 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2941 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2942 | -c "client hello, adding CID extension" \ |
| 2943 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2944 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2945 | -s "server hello, adding CID extension" \ |
| 2946 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2947 | -c "Use of CID extension negotiated" \ |
| 2948 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2949 | -c "Copy CIDs into SSL transform" \ |
| 2950 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2951 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2952 | -s "Use of Connection ID has been negotiated" \ |
| 2953 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2954 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2956 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2957 | 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] | 2958 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2959 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2960 | 0 \ |
| 2961 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2962 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2963 | -c "client hello, adding CID extension" \ |
| 2964 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2965 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2966 | -s "server hello, adding CID extension" \ |
| 2967 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2968 | -c "Use of CID extension negotiated" \ |
| 2969 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2970 | -c "Copy CIDs into SSL transform" \ |
| 2971 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2972 | -s "Peer CID (length 0 Bytes):" \ |
| 2973 | -s "Use of Connection ID has been negotiated" \ |
| 2974 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2978 | 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] | 2979 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2980 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2981 | 0 \ |
| 2982 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2983 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2984 | -c "client hello, adding CID extension" \ |
| 2985 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2986 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2987 | -s "server hello, adding CID extension" \ |
| 2988 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2989 | -c "Use of CID extension negotiated" \ |
| 2990 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2991 | -c "Copy CIDs into SSL transform" \ |
| 2992 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2993 | -c "Peer CID (length 0 Bytes):" \ |
| 2994 | -s "Use of Connection ID has been negotiated" \ |
| 2995 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2998 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2999 | 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] | 3000 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3001 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3002 | 0 \ |
| 3003 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3004 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3005 | -c "client hello, adding CID extension" \ |
| 3006 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3007 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3008 | -s "server hello, adding CID extension" \ |
| 3009 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3010 | -c "Use of CID extension negotiated" \ |
| 3011 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3012 | -c "Copy CIDs into SSL transform" \ |
| 3013 | -S "Use of Connection ID has been negotiated" \ |
| 3014 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3018 | 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] | 3019 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3020 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3021 | 0 \ |
| 3022 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3023 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3024 | -c "client hello, adding CID extension" \ |
| 3025 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3026 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3027 | -s "server hello, adding CID extension" \ |
| 3028 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3029 | -c "Use of CID extension negotiated" \ |
| 3030 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3031 | -c "Copy CIDs into SSL transform" \ |
| 3032 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3033 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3034 | -s "Use of Connection ID has been negotiated" \ |
| 3035 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3036 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3038 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3039 | 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] | 3040 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3041 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3042 | 0 \ |
| 3043 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3044 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3045 | -c "client hello, adding CID extension" \ |
| 3046 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3047 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3048 | -s "server hello, adding CID extension" \ |
| 3049 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3050 | -c "Use of CID extension negotiated" \ |
| 3051 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3052 | -c "Copy CIDs into SSL transform" \ |
| 3053 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3054 | -s "Peer CID (length 0 Bytes):" \ |
| 3055 | -s "Use of Connection ID has been negotiated" \ |
| 3056 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3057 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3059 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3060 | 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] | 3061 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3062 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3063 | 0 \ |
| 3064 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3065 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3066 | -c "client hello, adding CID extension" \ |
| 3067 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3068 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3069 | -s "server hello, adding CID extension" \ |
| 3070 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3071 | -c "Use of CID extension negotiated" \ |
| 3072 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3073 | -c "Copy CIDs into SSL transform" \ |
| 3074 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3075 | -c "Peer CID (length 0 Bytes):" \ |
| 3076 | -s "Use of Connection ID has been negotiated" \ |
| 3077 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3078 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3080 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3081 | 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] | 3082 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3083 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3084 | 0 \ |
| 3085 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3086 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3087 | -c "client hello, adding CID extension" \ |
| 3088 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3089 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3090 | -s "server hello, adding CID extension" \ |
| 3091 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3092 | -c "Use of CID extension negotiated" \ |
| 3093 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3094 | -c "Copy CIDs into SSL transform" \ |
| 3095 | -S "Use of Connection ID has been negotiated" \ |
| 3096 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3100 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3102 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3103 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3104 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3105 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3106 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3107 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3108 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3109 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3110 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3111 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3112 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3113 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3115 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3116 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3117 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3118 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3119 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3120 | 0 \ |
| 3121 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3122 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3123 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3124 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3125 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3126 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3127 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3128 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3131 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3132 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3133 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3134 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3135 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3136 | 0 \ |
| 3137 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3138 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3139 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3140 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3141 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3142 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3143 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3144 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3147 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3149 | 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] | 3150 | -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] | 3151 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3152 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3153 | 0 \ |
| 3154 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3155 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3156 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3157 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3158 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3159 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3160 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3161 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3162 | -c "ignoring unexpected CID" \ |
| 3163 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3167 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3168 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3169 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3170 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 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): de ad" \ |
| 3177 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3178 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3179 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3182 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3183 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3184 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3185 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3186 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3187 | 0 \ |
| 3188 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3189 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3190 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3191 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3192 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3193 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3194 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3195 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3196 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3198 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3200 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3201 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3202 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3203 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3204 | 0 \ |
| 3205 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3206 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3207 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3208 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3209 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3210 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3211 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3212 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3213 | -c "ignoring unexpected CID" \ |
| 3214 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3215 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3219 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3220 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3221 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3222 | 0 \ |
| 3223 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3224 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3225 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3226 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3227 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3228 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3229 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3231 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3232 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3233 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3234 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3235 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3236 | 0 \ |
| 3237 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3238 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3239 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3240 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3241 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3242 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3243 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3245 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3247 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3248 | -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] | 3249 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3250 | "$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" \ |
| 3251 | 0 \ |
| 3252 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3253 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3254 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3255 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3256 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3257 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3258 | -c "ignoring unexpected CID" \ |
| 3259 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3264 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3265 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3266 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3267 | 0 \ |
| 3268 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3269 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 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" \ |
| 3275 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3276 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3277 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3279 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3280 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3281 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3282 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3294 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3295 | -c "ignoring unexpected CID" \ |
| 3296 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3297 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3299 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3300 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3301 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3302 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3303 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3304 | 0 \ |
| 3305 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3306 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3307 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3308 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3309 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3310 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3311 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3312 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3313 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3318 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3319 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3331 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3332 | -c "ignoring unexpected CID" \ |
| 3333 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3334 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3335 | # 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] | 3336 | # tests check that the buffer contents are reallocated when the message is |
| 3337 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3340 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3341 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3342 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3343 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3344 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3345 | 0 \ |
| 3346 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3347 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3348 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3349 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3350 | -s "Reallocating in_buf" \ |
| 3351 | -s "Reallocating out_buf" |
| 3352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3355 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3356 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3357 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3358 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3359 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3360 | 0 \ |
| 3361 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3362 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3363 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3364 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3365 | -s "Reallocating in_buf" \ |
| 3366 | -s "Reallocating out_buf" |
| 3367 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3368 | # Tests for Encrypt-then-MAC extension |
| 3369 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3371 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3372 | "$P_SRV debug_level=3 \ |
| 3373 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3374 | "$P_CLI debug_level=3" \ |
| 3375 | 0 \ |
| 3376 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3377 | -s "found encrypt then mac extension" \ |
| 3378 | -s "server hello, adding encrypt then mac extension" \ |
| 3379 | -c "found encrypt_then_mac extension" \ |
| 3380 | -c "using encrypt then mac" \ |
| 3381 | -s "using encrypt then mac" |
| 3382 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3384 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3385 | "$P_SRV debug_level=3 etm=0 \ |
| 3386 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3387 | "$P_CLI debug_level=3 etm=1" \ |
| 3388 | 0 \ |
| 3389 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3390 | -s "found encrypt then mac extension" \ |
| 3391 | -S "server hello, adding encrypt then mac extension" \ |
| 3392 | -C "found encrypt_then_mac extension" \ |
| 3393 | -C "using encrypt then mac" \ |
| 3394 | -S "using encrypt then mac" |
| 3395 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3397 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3398 | "$P_SRV debug_level=3 etm=1 \ |
| 3399 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3400 | "$P_CLI debug_level=3 etm=1" \ |
| 3401 | 0 \ |
| 3402 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3403 | -s "found encrypt then mac extension" \ |
| 3404 | -S "server hello, adding encrypt then mac extension" \ |
| 3405 | -C "found encrypt_then_mac extension" \ |
| 3406 | -C "using encrypt then mac" \ |
| 3407 | -S "using encrypt then mac" |
| 3408 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3410 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3411 | "$P_SRV debug_level=3 etm=1 \ |
| 3412 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3413 | "$P_CLI debug_level=3 etm=0" \ |
| 3414 | 0 \ |
| 3415 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3416 | -S "found encrypt then mac extension" \ |
| 3417 | -S "server hello, adding encrypt then mac extension" \ |
| 3418 | -C "found encrypt_then_mac extension" \ |
| 3419 | -C "using encrypt then mac" \ |
| 3420 | -S "using encrypt then mac" |
| 3421 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3422 | # Tests for Extended Master Secret extension |
| 3423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3426 | run_test "Extended Master Secret: default" \ |
| 3427 | "$P_SRV debug_level=3" \ |
| 3428 | "$P_CLI debug_level=3" \ |
| 3429 | 0 \ |
| 3430 | -c "client hello, adding extended_master_secret extension" \ |
| 3431 | -s "found extended master secret extension" \ |
| 3432 | -s "server hello, adding extended master secret extension" \ |
| 3433 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3434 | -c "session hash for extended master secret" \ |
| 3435 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3436 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3438 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3439 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3440 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3441 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3442 | 0 \ |
| 3443 | -c "client hello, adding extended_master_secret extension" \ |
| 3444 | -s "found extended master secret extension" \ |
| 3445 | -S "server hello, adding extended master secret extension" \ |
| 3446 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3447 | -C "session hash for extended master secret" \ |
| 3448 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3449 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3450 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3452 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3453 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3454 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3455 | 0 \ |
| 3456 | -C "client hello, adding extended_master_secret extension" \ |
| 3457 | -S "found extended master secret extension" \ |
| 3458 | -S "server hello, adding extended master secret extension" \ |
| 3459 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3460 | -C "session hash for extended master secret" \ |
| 3461 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3462 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3463 | # Test sending and receiving empty application data records |
| 3464 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3466 | run_test "Encrypt then MAC: empty application data record" \ |
| 3467 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3468 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3469 | 0 \ |
| 3470 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3471 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3472 | -c "0 bytes written in 1 fragments" |
| 3473 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3475 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3476 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3477 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3478 | 0 \ |
| 3479 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3480 | -c "0 bytes written in 1 fragments" |
| 3481 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3483 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3484 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3485 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3486 | 0 \ |
| 3487 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3488 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3489 | -c "0 bytes written in 1 fragments" |
| 3490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3492 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3493 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3494 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3495 | 0 \ |
| 3496 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3497 | -c "0 bytes written in 1 fragments" |
| 3498 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3499 | # Tests for CBC 1/n-1 record splitting |
| 3500 | |
| 3501 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3502 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3503 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3504 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3505 | 0 \ |
| 3506 | -s "Read from client: 123 bytes read" \ |
| 3507 | -S "Read from client: 1 bytes read" \ |
| 3508 | -S "122 bytes read" |
| 3509 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3510 | # Tests for Session Tickets |
| 3511 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3513 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3514 | "$P_SRV debug_level=3 tickets=1" \ |
| 3515 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3516 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3517 | -c "client hello, adding session ticket extension" \ |
| 3518 | -s "found session ticket extension" \ |
| 3519 | -s "server hello, adding session ticket extension" \ |
| 3520 | -c "found session_ticket extension" \ |
| 3521 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3522 | -S "session successfully restored from cache" \ |
| 3523 | -s "session successfully restored from ticket" \ |
| 3524 | -s "a session has been resumed" \ |
| 3525 | -c "a session has been resumed" |
| 3526 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3528 | run_test "Session resume using tickets: manual rotation" \ |
| 3529 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3530 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3531 | 0 \ |
| 3532 | -c "client hello, adding session ticket extension" \ |
| 3533 | -s "found session ticket extension" \ |
| 3534 | -s "server hello, adding session ticket extension" \ |
| 3535 | -c "found session_ticket extension" \ |
| 3536 | -c "parse new session ticket" \ |
| 3537 | -S "session successfully restored from cache" \ |
| 3538 | -s "session successfully restored from ticket" \ |
| 3539 | -s "a session has been resumed" \ |
| 3540 | -c "a session has been resumed" |
| 3541 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3543 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3544 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3545 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3546 | 0 \ |
| 3547 | -c "client hello, adding session ticket extension" \ |
| 3548 | -s "found session ticket extension" \ |
| 3549 | -s "server hello, adding session ticket extension" \ |
| 3550 | -c "found session_ticket extension" \ |
| 3551 | -c "parse new session ticket" \ |
| 3552 | -S "session successfully restored from cache" \ |
| 3553 | -s "session successfully restored from ticket" \ |
| 3554 | -s "a session has been resumed" \ |
| 3555 | -c "a session has been resumed" |
| 3556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3558 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3559 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3560 | "$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] | 3561 | 0 \ |
| 3562 | -c "client hello, adding session ticket extension" \ |
| 3563 | -s "found session ticket extension" \ |
| 3564 | -s "server hello, adding session ticket extension" \ |
| 3565 | -c "found session_ticket extension" \ |
| 3566 | -c "parse new session ticket" \ |
| 3567 | -S "session successfully restored from cache" \ |
| 3568 | -S "session successfully restored from ticket" \ |
| 3569 | -S "a session has been resumed" \ |
| 3570 | -C "a session has been resumed" |
| 3571 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3573 | run_test "Session resume using tickets: session copy" \ |
| 3574 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3575 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3576 | 0 \ |
| 3577 | -c "client hello, adding session ticket extension" \ |
| 3578 | -s "found session ticket extension" \ |
| 3579 | -s "server hello, adding session ticket extension" \ |
| 3580 | -c "found session_ticket extension" \ |
| 3581 | -c "parse new session ticket" \ |
| 3582 | -S "session successfully restored from cache" \ |
| 3583 | -s "session successfully restored from ticket" \ |
| 3584 | -s "a session has been resumed" \ |
| 3585 | -c "a session has been resumed" |
| 3586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3588 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3589 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3590 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3591 | 0 \ |
| 3592 | -c "client hello, adding session ticket extension" \ |
| 3593 | -c "found session_ticket extension" \ |
| 3594 | -c "parse new session ticket" \ |
| 3595 | -c "a session has been resumed" |
| 3596 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3598 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3599 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3600 | "( $O_CLI -sess_out $SESSION; \ |
| 3601 | $O_CLI -sess_in $SESSION; \ |
| 3602 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3603 | 0 \ |
| 3604 | -s "found session ticket extension" \ |
| 3605 | -s "server hello, adding session ticket extension" \ |
| 3606 | -S "session successfully restored from cache" \ |
| 3607 | -s "session successfully restored from ticket" \ |
| 3608 | -s "a session has been resumed" |
| 3609 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3611 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3612 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3613 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3614 | 0 \ |
| 3615 | -c "client hello, adding session ticket extension" \ |
| 3616 | -s "found session ticket extension" \ |
| 3617 | -s "server hello, adding session ticket extension" \ |
| 3618 | -c "found session_ticket extension" \ |
| 3619 | -c "parse new session ticket" \ |
| 3620 | -S "session successfully restored from cache" \ |
| 3621 | -s "session successfully restored from ticket" \ |
| 3622 | -s "a session has been resumed" \ |
| 3623 | -c "a session has been resumed" |
| 3624 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3626 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3627 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3628 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3629 | 0 \ |
| 3630 | -c "client hello, adding session ticket extension" \ |
| 3631 | -s "found session ticket extension" \ |
| 3632 | -s "server hello, adding session ticket extension" \ |
| 3633 | -c "found session_ticket extension" \ |
| 3634 | -c "parse new session ticket" \ |
| 3635 | -S "session successfully restored from cache" \ |
| 3636 | -s "session successfully restored from ticket" \ |
| 3637 | -s "a session has been resumed" \ |
| 3638 | -c "a session has been resumed" |
| 3639 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3641 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3642 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3643 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3644 | 0 \ |
| 3645 | -c "client hello, adding session ticket extension" \ |
| 3646 | -s "found session ticket extension" \ |
| 3647 | -s "server hello, adding session ticket extension" \ |
| 3648 | -c "found session_ticket extension" \ |
| 3649 | -c "parse new session ticket" \ |
| 3650 | -S "session successfully restored from cache" \ |
| 3651 | -s "session successfully restored from ticket" \ |
| 3652 | -s "a session has been resumed" \ |
| 3653 | -c "a session has been resumed" |
| 3654 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3656 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3657 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3658 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3659 | 0 \ |
| 3660 | -c "client hello, adding session ticket extension" \ |
| 3661 | -s "found session ticket extension" \ |
| 3662 | -s "server hello, adding session ticket extension" \ |
| 3663 | -c "found session_ticket extension" \ |
| 3664 | -c "parse new session ticket" \ |
| 3665 | -S "session successfully restored from cache" \ |
| 3666 | -s "session successfully restored from ticket" \ |
| 3667 | -s "a session has been resumed" \ |
| 3668 | -c "a session has been resumed" |
| 3669 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3671 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3672 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3673 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3674 | 0 \ |
| 3675 | -c "client hello, adding session ticket extension" \ |
| 3676 | -s "found session ticket extension" \ |
| 3677 | -s "server hello, adding session ticket extension" \ |
| 3678 | -c "found session_ticket extension" \ |
| 3679 | -c "parse new session ticket" \ |
| 3680 | -S "session successfully restored from cache" \ |
| 3681 | -s "session successfully restored from ticket" \ |
| 3682 | -s "a session has been resumed" \ |
| 3683 | -c "a session has been resumed" |
| 3684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3686 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3687 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3688 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3689 | 0 \ |
| 3690 | -c "client hello, adding session ticket extension" \ |
| 3691 | -s "found session ticket extension" \ |
| 3692 | -s "server hello, adding session ticket extension" \ |
| 3693 | -c "found session_ticket extension" \ |
| 3694 | -c "parse new session ticket" \ |
| 3695 | -S "session successfully restored from cache" \ |
| 3696 | -s "session successfully restored from ticket" \ |
| 3697 | -s "a session has been resumed" \ |
| 3698 | -c "a session has been resumed" |
| 3699 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3701 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3702 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3703 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3704 | 0 \ |
| 3705 | -c "client hello, adding session ticket extension" \ |
| 3706 | -s "found session ticket extension" \ |
| 3707 | -s "server hello, adding session ticket extension" \ |
| 3708 | -c "found session_ticket extension" \ |
| 3709 | -c "parse new session ticket" \ |
| 3710 | -S "session successfully restored from cache" \ |
| 3711 | -s "session successfully restored from ticket" \ |
| 3712 | -s "a session has been resumed" \ |
| 3713 | -c "a session has been resumed" |
| 3714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3716 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3717 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3718 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3719 | 0 \ |
| 3720 | -c "client hello, adding session ticket extension" \ |
| 3721 | -s "found session ticket extension" \ |
| 3722 | -s "server hello, adding session ticket extension" \ |
| 3723 | -c "found session_ticket extension" \ |
| 3724 | -c "parse new session ticket" \ |
| 3725 | -S "session successfully restored from cache" \ |
| 3726 | -s "session successfully restored from ticket" \ |
| 3727 | -s "a session has been resumed" \ |
| 3728 | -c "a session has been resumed" |
| 3729 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3731 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3732 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3733 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3734 | 0 \ |
| 3735 | -c "client hello, adding session ticket extension" \ |
| 3736 | -s "found session ticket extension" \ |
| 3737 | -s "server hello, adding session ticket extension" \ |
| 3738 | -c "found session_ticket extension" \ |
| 3739 | -c "parse new session ticket" \ |
| 3740 | -S "session successfully restored from cache" \ |
| 3741 | -s "session successfully restored from ticket" \ |
| 3742 | -s "a session has been resumed" \ |
| 3743 | -c "a session has been resumed" |
| 3744 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3746 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3747 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3748 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3749 | 0 \ |
| 3750 | -c "client hello, adding session ticket extension" \ |
| 3751 | -s "found session ticket extension" \ |
| 3752 | -s "server hello, adding session ticket extension" \ |
| 3753 | -c "found session_ticket extension" \ |
| 3754 | -c "parse new session ticket" \ |
| 3755 | -S "session successfully restored from cache" \ |
| 3756 | -s "session successfully restored from ticket" \ |
| 3757 | -s "a session has been resumed" \ |
| 3758 | -c "a session has been resumed" |
| 3759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3761 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3762 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3763 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3764 | 0 \ |
| 3765 | -c "client hello, adding session ticket extension" \ |
| 3766 | -s "found session ticket extension" \ |
| 3767 | -s "server hello, adding session ticket extension" \ |
| 3768 | -c "found session_ticket extension" \ |
| 3769 | -c "parse new session ticket" \ |
| 3770 | -S "session successfully restored from cache" \ |
| 3771 | -s "session successfully restored from ticket" \ |
| 3772 | -s "a session has been resumed" \ |
| 3773 | -c "a session has been resumed" |
| 3774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3776 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3777 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3778 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3779 | 0 \ |
| 3780 | -c "client hello, adding session ticket extension" \ |
| 3781 | -s "found session ticket extension" \ |
| 3782 | -s "server hello, adding session ticket extension" \ |
| 3783 | -c "found session_ticket extension" \ |
| 3784 | -c "parse new session ticket" \ |
| 3785 | -S "session successfully restored from cache" \ |
| 3786 | -s "session successfully restored from ticket" \ |
| 3787 | -s "a session has been resumed" \ |
| 3788 | -c "a session has been resumed" |
| 3789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3791 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3792 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3793 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3794 | 0 \ |
| 3795 | -c "client hello, adding session ticket extension" \ |
| 3796 | -s "found session ticket extension" \ |
| 3797 | -s "server hello, adding session ticket extension" \ |
| 3798 | -c "found session_ticket extension" \ |
| 3799 | -c "parse new session ticket" \ |
| 3800 | -S "session successfully restored from cache" \ |
| 3801 | -s "session successfully restored from ticket" \ |
| 3802 | -s "a session has been resumed" \ |
| 3803 | -c "a session has been resumed" |
| 3804 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3806 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3807 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3808 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3809 | 0 \ |
| 3810 | -c "client hello, adding session ticket extension" \ |
| 3811 | -s "found session ticket extension" \ |
| 3812 | -s "server hello, adding session ticket extension" \ |
| 3813 | -c "found session_ticket extension" \ |
| 3814 | -c "parse new session ticket" \ |
| 3815 | -S "session successfully restored from cache" \ |
| 3816 | -s "session successfully restored from ticket" \ |
| 3817 | -s "a session has been resumed" \ |
| 3818 | -c "a session has been resumed" |
| 3819 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3821 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3822 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3823 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3824 | 0 \ |
| 3825 | -c "client hello, adding session ticket extension" \ |
| 3826 | -s "found session ticket extension" \ |
| 3827 | -s "server hello, adding session ticket extension" \ |
| 3828 | -c "found session_ticket extension" \ |
| 3829 | -c "parse new session ticket" \ |
| 3830 | -S "session successfully restored from cache" \ |
| 3831 | -s "session successfully restored from ticket" \ |
| 3832 | -s "a session has been resumed" \ |
| 3833 | -c "a session has been resumed" |
| 3834 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3835 | # Tests for Session Tickets with DTLS |
| 3836 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3837 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3838 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3839 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3840 | "$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] | 3841 | 0 \ |
| 3842 | -c "client hello, adding session ticket extension" \ |
| 3843 | -s "found session ticket extension" \ |
| 3844 | -s "server hello, adding session ticket extension" \ |
| 3845 | -c "found session_ticket extension" \ |
| 3846 | -c "parse new session ticket" \ |
| 3847 | -S "session successfully restored from cache" \ |
| 3848 | -s "session successfully restored from ticket" \ |
| 3849 | -s "a session has been resumed" \ |
| 3850 | -c "a session has been resumed" |
| 3851 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3853 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3854 | "$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] | 3855 | "$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] | 3856 | 0 \ |
| 3857 | -c "client hello, adding session ticket extension" \ |
| 3858 | -s "found session ticket extension" \ |
| 3859 | -s "server hello, adding session ticket extension" \ |
| 3860 | -c "found session_ticket extension" \ |
| 3861 | -c "parse new session ticket" \ |
| 3862 | -S "session successfully restored from cache" \ |
| 3863 | -s "session successfully restored from ticket" \ |
| 3864 | -s "a session has been resumed" \ |
| 3865 | -c "a session has been resumed" |
| 3866 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3867 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3868 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3869 | "$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] | 3870 | "$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] | 3871 | 0 \ |
| 3872 | -c "client hello, adding session ticket extension" \ |
| 3873 | -s "found session ticket extension" \ |
| 3874 | -s "server hello, adding session ticket extension" \ |
| 3875 | -c "found session_ticket extension" \ |
| 3876 | -c "parse new session ticket" \ |
| 3877 | -S "session successfully restored from cache" \ |
| 3878 | -S "session successfully restored from ticket" \ |
| 3879 | -S "a session has been resumed" \ |
| 3880 | -C "a session has been resumed" |
| 3881 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3883 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3884 | "$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] | 3885 | "$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] | 3886 | 0 \ |
| 3887 | -c "client hello, adding session ticket extension" \ |
| 3888 | -s "found session ticket extension" \ |
| 3889 | -s "server hello, adding session ticket extension" \ |
| 3890 | -c "found session_ticket extension" \ |
| 3891 | -c "parse new session ticket" \ |
| 3892 | -S "session successfully restored from cache" \ |
| 3893 | -s "session successfully restored from ticket" \ |
| 3894 | -s "a session has been resumed" \ |
| 3895 | -c "a session has been resumed" |
| 3896 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3898 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3899 | "$O_SRV -dtls" \ |
| 3900 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3901 | 0 \ |
| 3902 | -c "client hello, adding session ticket extension" \ |
| 3903 | -c "found session_ticket extension" \ |
| 3904 | -c "parse new session ticket" \ |
| 3905 | -c "a session has been resumed" |
| 3906 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3907 | # 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] | 3908 | # 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] | 3909 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3911 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3912 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3913 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3914 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3915 | rm -f $SESSION )" \ |
| 3916 | 0 \ |
| 3917 | -s "found session ticket extension" \ |
| 3918 | -s "server hello, adding session ticket extension" \ |
| 3919 | -S "session successfully restored from cache" \ |
| 3920 | -s "session successfully restored from ticket" \ |
| 3921 | -s "a session has been resumed" |
| 3922 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3923 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3924 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3926 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3927 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3928 | "$P_SRV debug_level=3 tickets=0" \ |
| 3929 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3930 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3931 | -c "client hello, adding session ticket extension" \ |
| 3932 | -s "found session ticket extension" \ |
| 3933 | -S "server hello, adding session ticket extension" \ |
| 3934 | -C "found session_ticket extension" \ |
| 3935 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3936 | -s "session successfully restored from cache" \ |
| 3937 | -S "session successfully restored from ticket" \ |
| 3938 | -s "a session has been resumed" \ |
| 3939 | -c "a session has been resumed" |
| 3940 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3942 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3943 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3944 | "$P_SRV debug_level=3 tickets=1" \ |
| 3945 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3946 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3947 | -C "client hello, adding session ticket extension" \ |
| 3948 | -S "found session ticket extension" \ |
| 3949 | -S "server hello, adding session ticket extension" \ |
| 3950 | -C "found session_ticket extension" \ |
| 3951 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3952 | -s "session successfully restored from cache" \ |
| 3953 | -S "session successfully restored from ticket" \ |
| 3954 | -s "a session has been resumed" \ |
| 3955 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3958 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3959 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3960 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3961 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3962 | 0 \ |
| 3963 | -S "session successfully restored from cache" \ |
| 3964 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3965 | -S "a session has been resumed" \ |
| 3966 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3967 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3969 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3970 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3971 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3972 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3973 | 0 \ |
| 3974 | -s "session successfully restored from cache" \ |
| 3975 | -S "session successfully restored from ticket" \ |
| 3976 | -s "a session has been resumed" \ |
| 3977 | -c "a session has been resumed" |
| 3978 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3980 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3981 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3982 | "$P_SRV debug_level=3 tickets=0" \ |
| 3983 | "$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] | 3984 | 0 \ |
| 3985 | -s "session successfully restored from cache" \ |
| 3986 | -S "session successfully restored from ticket" \ |
| 3987 | -s "a session has been resumed" \ |
| 3988 | -c "a session has been resumed" |
| 3989 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3991 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3992 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3993 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3994 | "$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] | 3995 | 0 \ |
| 3996 | -S "session successfully restored from cache" \ |
| 3997 | -S "session successfully restored from ticket" \ |
| 3998 | -S "a session has been resumed" \ |
| 3999 | -C "a session has been resumed" |
| 4000 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4002 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4003 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4004 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 4005 | "$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] | 4006 | 0 \ |
| 4007 | -s "session successfully restored from cache" \ |
| 4008 | -S "session successfully restored from ticket" \ |
| 4009 | -s "a session has been resumed" \ |
| 4010 | -c "a session has been resumed" |
| 4011 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4013 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4014 | run_test "Session resume using cache: session copy" \ |
| 4015 | "$P_SRV debug_level=3 tickets=0" \ |
| 4016 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4017 | 0 \ |
| 4018 | -s "session successfully restored from cache" \ |
| 4019 | -S "session successfully restored from ticket" \ |
| 4020 | -s "a session has been resumed" \ |
| 4021 | -c "a session has been resumed" |
| 4022 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4024 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4025 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4026 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4027 | "( $O_CLI -sess_out $SESSION; \ |
| 4028 | $O_CLI -sess_in $SESSION; \ |
| 4029 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4030 | 0 \ |
| 4031 | -s "found session ticket extension" \ |
| 4032 | -S "server hello, adding session ticket extension" \ |
| 4033 | -s "session successfully restored from cache" \ |
| 4034 | -S "session successfully restored from ticket" \ |
| 4035 | -s "a session has been resumed" |
| 4036 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4039 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4040 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4041 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4042 | 0 \ |
| 4043 | -C "found session_ticket extension" \ |
| 4044 | -C "parse new session ticket" \ |
| 4045 | -c "a session has been resumed" |
| 4046 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4047 | # Tests for Session resume and extensions |
| 4048 | |
| 4049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4050 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4051 | run_test "Session resume and connection ID" \ |
| 4052 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4053 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4054 | 0 \ |
| 4055 | -c "Enable use of CID extension." \ |
| 4056 | -s "Enable use of CID extension." \ |
| 4057 | -c "client hello, adding CID extension" \ |
| 4058 | -s "found CID extension" \ |
| 4059 | -s "Use of CID extension negotiated" \ |
| 4060 | -s "server hello, adding CID extension" \ |
| 4061 | -c "found CID extension" \ |
| 4062 | -c "Use of CID extension negotiated" \ |
| 4063 | -s "Copy CIDs into SSL transform" \ |
| 4064 | -c "Copy CIDs into SSL transform" \ |
| 4065 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4066 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4067 | -s "Use of Connection ID has been negotiated" \ |
| 4068 | -c "Use of Connection ID has been negotiated" |
| 4069 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4070 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4073 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4074 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4075 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4076 | "$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] | 4077 | 0 \ |
| 4078 | -c "client hello, adding session ticket extension" \ |
| 4079 | -s "found session ticket extension" \ |
| 4080 | -S "server hello, adding session ticket extension" \ |
| 4081 | -C "found session_ticket extension" \ |
| 4082 | -C "parse new session ticket" \ |
| 4083 | -s "session successfully restored from cache" \ |
| 4084 | -S "session successfully restored from ticket" \ |
| 4085 | -s "a session has been resumed" \ |
| 4086 | -c "a session has been resumed" |
| 4087 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4089 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4090 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4091 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4092 | "$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] | 4093 | 0 \ |
| 4094 | -C "client hello, adding session ticket extension" \ |
| 4095 | -S "found session ticket extension" \ |
| 4096 | -S "server hello, adding session ticket extension" \ |
| 4097 | -C "found session_ticket extension" \ |
| 4098 | -C "parse new session ticket" \ |
| 4099 | -s "session successfully restored from cache" \ |
| 4100 | -S "session successfully restored from ticket" \ |
| 4101 | -s "a session has been resumed" \ |
| 4102 | -c "a session has been resumed" |
| 4103 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4105 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4106 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4107 | "$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] | 4108 | "$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] | 4109 | 0 \ |
| 4110 | -S "session successfully restored from cache" \ |
| 4111 | -S "session successfully restored from ticket" \ |
| 4112 | -S "a session has been resumed" \ |
| 4113 | -C "a session has been resumed" |
| 4114 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4116 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4117 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4118 | "$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] | 4119 | "$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] | 4120 | 0 \ |
| 4121 | -s "session successfully restored from cache" \ |
| 4122 | -S "session successfully restored from ticket" \ |
| 4123 | -s "a session has been resumed" \ |
| 4124 | -c "a session has been resumed" |
| 4125 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4127 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4128 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4129 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4130 | "$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] | 4131 | 0 \ |
| 4132 | -s "session successfully restored from cache" \ |
| 4133 | -S "session successfully restored from ticket" \ |
| 4134 | -s "a session has been resumed" \ |
| 4135 | -c "a session has been resumed" |
| 4136 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4138 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4139 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4140 | "$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] | 4141 | "$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] | 4142 | 0 \ |
| 4143 | -S "session successfully restored from cache" \ |
| 4144 | -S "session successfully restored from ticket" \ |
| 4145 | -S "a session has been resumed" \ |
| 4146 | -C "a session has been resumed" |
| 4147 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4149 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4150 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4151 | "$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] | 4152 | "$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] | 4153 | 0 \ |
| 4154 | -s "session successfully restored from cache" \ |
| 4155 | -S "session successfully restored from ticket" \ |
| 4156 | -s "a session has been resumed" \ |
| 4157 | -c "a session has been resumed" |
| 4158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4160 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4161 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4162 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4163 | "$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] | 4164 | 0 \ |
| 4165 | -s "session successfully restored from cache" \ |
| 4166 | -S "session successfully restored from ticket" \ |
| 4167 | -s "a session has been resumed" \ |
| 4168 | -c "a session has been resumed" |
| 4169 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4170 | # 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] | 4171 | # 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] | 4172 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4175 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4176 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4177 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4178 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4179 | rm -f $SESSION )" \ |
| 4180 | 0 \ |
| 4181 | -s "found session ticket extension" \ |
| 4182 | -S "server hello, adding session ticket extension" \ |
| 4183 | -s "session successfully restored from cache" \ |
| 4184 | -S "session successfully restored from ticket" \ |
| 4185 | -s "a session has been resumed" |
| 4186 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4189 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4190 | "$O_SRV -dtls" \ |
| 4191 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4192 | 0 \ |
| 4193 | -C "found session_ticket extension" \ |
| 4194 | -C "parse new session ticket" \ |
| 4195 | -c "a session has been resumed" |
| 4196 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4197 | # Tests for Max Fragment Length extension |
| 4198 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4199 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4201 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4202 | "$P_SRV debug_level=3" \ |
| 4203 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4204 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4205 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4206 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4207 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4208 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4209 | -C "client hello, adding max_fragment_length extension" \ |
| 4210 | -S "found max fragment length extension" \ |
| 4211 | -S "server hello, max_fragment_length extension" \ |
| 4212 | -C "found max_fragment_length extension" |
| 4213 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4214 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4216 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4217 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4218 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4219 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4220 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4221 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4222 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4223 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4224 | -C "client hello, adding max_fragment_length extension" \ |
| 4225 | -S "found max fragment length extension" \ |
| 4226 | -S "server hello, max_fragment_length extension" \ |
| 4227 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4228 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4229 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4230 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4231 | |
| 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, DTLS: enabled, default, larger message" \ |
| 4235 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4236 | "$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] | 4237 | 1 \ |
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" \ |
| 4246 | -c "fragment larger than.*maximum " |
| 4247 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4248 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4249 | # (session fragment length will be 16384 regardless of mbedtls |
| 4250 | # content length configuration.) |
| 4251 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4252 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4254 | run_test "Max fragment length: disabled, larger message" \ |
| 4255 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4256 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4257 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4258 | -C "Maximum incoming record payload length is 16384" \ |
| 4259 | -C "Maximum outgoing record payload length is 16384" \ |
| 4260 | -S "Maximum incoming record payload length is 16384" \ |
| 4261 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4262 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4263 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4264 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4265 | |
| 4266 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4268 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4269 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4270 | "$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] | 4271 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4272 | -C "Maximum incoming record payload length is 16384" \ |
| 4273 | -C "Maximum outgoing record payload length is 16384" \ |
| 4274 | -S "Maximum incoming record payload length is 16384" \ |
| 4275 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4276 | -c "fragment larger than.*maximum " |
| 4277 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4278 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4281 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4282 | "$P_SRV debug_level=3" \ |
| 4283 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4284 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4285 | -c "Maximum incoming record payload length is 4096" \ |
| 4286 | -c "Maximum outgoing record payload length is 4096" \ |
| 4287 | -s "Maximum incoming record payload length is 4096" \ |
| 4288 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4289 | -c "client hello, adding max_fragment_length extension" \ |
| 4290 | -s "found max fragment length extension" \ |
| 4291 | -s "server hello, max_fragment_length extension" \ |
| 4292 | -c "found max_fragment_length extension" |
| 4293 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4294 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4295 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4297 | run_test "Max fragment length: client 512, server 1024" \ |
| 4298 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4299 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4300 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4301 | -c "Maximum incoming record payload length is 512" \ |
| 4302 | -c "Maximum outgoing record payload length is 512" \ |
| 4303 | -s "Maximum incoming record payload length is 512" \ |
| 4304 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4305 | -c "client hello, adding max_fragment_length extension" \ |
| 4306 | -s "found max fragment length extension" \ |
| 4307 | -s "server hello, max_fragment_length extension" \ |
| 4308 | -c "found max_fragment_length extension" |
| 4309 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4310 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4313 | run_test "Max fragment length: client 512, server 2048" \ |
| 4314 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4315 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4316 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4317 | -c "Maximum incoming record payload length is 512" \ |
| 4318 | -c "Maximum outgoing record payload length is 512" \ |
| 4319 | -s "Maximum incoming record payload length is 512" \ |
| 4320 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4321 | -c "client hello, adding max_fragment_length extension" \ |
| 4322 | -s "found max fragment length extension" \ |
| 4323 | -s "server hello, max_fragment_length extension" \ |
| 4324 | -c "found max_fragment_length extension" |
| 4325 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4326 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4329 | run_test "Max fragment length: client 512, server 4096" \ |
| 4330 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4331 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4332 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4333 | -c "Maximum incoming record payload length is 512" \ |
| 4334 | -c "Maximum outgoing record payload length is 512" \ |
| 4335 | -s "Maximum incoming record payload length is 512" \ |
| 4336 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4337 | -c "client hello, adding max_fragment_length extension" \ |
| 4338 | -s "found max fragment length extension" \ |
| 4339 | -s "server hello, max_fragment_length extension" \ |
| 4340 | -c "found max_fragment_length extension" |
| 4341 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4342 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4343 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4345 | run_test "Max fragment length: client 1024, server 512" \ |
| 4346 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4347 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4348 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4349 | -c "Maximum incoming record payload length is 1024" \ |
| 4350 | -c "Maximum outgoing record payload length is 1024" \ |
| 4351 | -s "Maximum incoming record payload length is 1024" \ |
| 4352 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4353 | -c "client hello, adding max_fragment_length extension" \ |
| 4354 | -s "found max fragment length extension" \ |
| 4355 | -s "server hello, max_fragment_length extension" \ |
| 4356 | -c "found max_fragment_length extension" |
| 4357 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4358 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4359 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4361 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4362 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4363 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4364 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4365 | -c "Maximum incoming record payload length is 1024" \ |
| 4366 | -c "Maximum outgoing record payload length is 1024" \ |
| 4367 | -s "Maximum incoming record payload length is 1024" \ |
| 4368 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4369 | -c "client hello, adding max_fragment_length extension" \ |
| 4370 | -s "found max fragment length extension" \ |
| 4371 | -s "server hello, max_fragment_length extension" \ |
| 4372 | -c "found max_fragment_length extension" |
| 4373 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4374 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4375 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4377 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4378 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4379 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4380 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4381 | -c "Maximum incoming record payload length is 1024" \ |
| 4382 | -c "Maximum outgoing record payload length is 1024" \ |
| 4383 | -s "Maximum incoming record payload length is 1024" \ |
| 4384 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4385 | -c "client hello, adding max_fragment_length extension" \ |
| 4386 | -s "found max fragment length extension" \ |
| 4387 | -s "server hello, max_fragment_length extension" \ |
| 4388 | -c "found max_fragment_length extension" |
| 4389 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4390 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4391 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4393 | run_test "Max fragment length: client 2048, server 512" \ |
| 4394 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4395 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4396 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4397 | -c "Maximum incoming record payload length is 2048" \ |
| 4398 | -c "Maximum outgoing record payload length is 2048" \ |
| 4399 | -s "Maximum incoming record payload length is 2048" \ |
| 4400 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4401 | -c "client hello, adding max_fragment_length extension" \ |
| 4402 | -s "found max fragment length extension" \ |
| 4403 | -s "server hello, max_fragment_length extension" \ |
| 4404 | -c "found max_fragment_length extension" |
| 4405 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4406 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4407 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4409 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4410 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4411 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4412 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4413 | -c "Maximum incoming record payload length is 2048" \ |
| 4414 | -c "Maximum outgoing record payload length is 2048" \ |
| 4415 | -s "Maximum incoming record payload length is 2048" \ |
| 4416 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4417 | -c "client hello, adding max_fragment_length extension" \ |
| 4418 | -s "found max fragment length extension" \ |
| 4419 | -s "server hello, max_fragment_length extension" \ |
| 4420 | -c "found max_fragment_length extension" |
| 4421 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4422 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4425 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4426 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4427 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4428 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4429 | -c "Maximum incoming record payload length is 2048" \ |
| 4430 | -c "Maximum outgoing record payload length is 2048" \ |
| 4431 | -s "Maximum incoming record payload length is 2048" \ |
| 4432 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4433 | -c "client hello, adding max_fragment_length extension" \ |
| 4434 | -s "found max fragment length extension" \ |
| 4435 | -s "server hello, max_fragment_length extension" \ |
| 4436 | -c "found max_fragment_length extension" |
| 4437 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4438 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4439 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4441 | run_test "Max fragment length: client 4096, server 512" \ |
| 4442 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4443 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4444 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4445 | -c "Maximum incoming record payload length is 4096" \ |
| 4446 | -c "Maximum outgoing record payload length is 4096" \ |
| 4447 | -s "Maximum incoming record payload length is 4096" \ |
| 4448 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4449 | -c "client hello, adding max_fragment_length extension" \ |
| 4450 | -s "found max fragment length extension" \ |
| 4451 | -s "server hello, max_fragment_length extension" \ |
| 4452 | -c "found max_fragment_length extension" |
| 4453 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4454 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4455 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4457 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4458 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4459 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4460 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4461 | -c "Maximum incoming record payload length is 4096" \ |
| 4462 | -c "Maximum outgoing record payload length is 4096" \ |
| 4463 | -s "Maximum incoming record payload length is 4096" \ |
| 4464 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4465 | -c "client hello, adding max_fragment_length extension" \ |
| 4466 | -s "found max fragment length extension" \ |
| 4467 | -s "server hello, max_fragment_length extension" \ |
| 4468 | -c "found max_fragment_length extension" |
| 4469 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4470 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4471 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4473 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4474 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4475 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4476 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4477 | -c "Maximum incoming record payload length is 4096" \ |
| 4478 | -c "Maximum outgoing record payload length is 4096" \ |
| 4479 | -s "Maximum incoming record payload length is 4096" \ |
| 4480 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4481 | -c "client hello, adding max_fragment_length extension" \ |
| 4482 | -s "found max fragment length extension" \ |
| 4483 | -s "server hello, max_fragment_length extension" \ |
| 4484 | -c "found max_fragment_length extension" |
| 4485 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4486 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4487 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4489 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4490 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4491 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4492 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4493 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4494 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4495 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4496 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4497 | -C "client hello, adding max_fragment_length extension" \ |
| 4498 | -S "found max fragment length extension" \ |
| 4499 | -S "server hello, max_fragment_length extension" \ |
| 4500 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4501 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4502 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4504 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4506 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4507 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4508 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4509 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4510 | -c "Maximum incoming record payload length is 4096" \ |
| 4511 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4512 | -c "client hello, adding max_fragment_length extension" \ |
| 4513 | -c "found max_fragment_length extension" |
| 4514 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4515 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4516 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4518 | run_test "Max fragment length: client, message just fits" \ |
| 4519 | "$P_SRV debug_level=3" \ |
| 4520 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4521 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4522 | -c "Maximum incoming record payload length is 2048" \ |
| 4523 | -c "Maximum outgoing record payload length is 2048" \ |
| 4524 | -s "Maximum incoming record payload length is 2048" \ |
| 4525 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4526 | -c "client hello, adding max_fragment_length extension" \ |
| 4527 | -s "found max fragment length extension" \ |
| 4528 | -s "server hello, max_fragment_length extension" \ |
| 4529 | -c "found max_fragment_length extension" \ |
| 4530 | -c "2048 bytes written in 1 fragments" \ |
| 4531 | -s "2048 bytes read" |
| 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, larger message" \ |
| 4537 | "$P_SRV debug_level=3" \ |
| 4538 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 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 "2345 bytes written in 2 fragments" \ |
| 4549 | -s "2048 bytes read" \ |
| 4550 | -s "297 bytes read" |
| 4551 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4552 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4553 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4555 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4556 | "$P_SRV debug_level=3 dtls=1" \ |
| 4557 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4558 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4559 | -c "Maximum incoming record payload length is 2048" \ |
| 4560 | -c "Maximum outgoing record payload length is 2048" \ |
| 4561 | -s "Maximum incoming record payload length is 2048" \ |
| 4562 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4563 | -c "client hello, adding max_fragment_length extension" \ |
| 4564 | -s "found max fragment length extension" \ |
| 4565 | -s "server hello, max_fragment_length extension" \ |
| 4566 | -c "found max_fragment_length extension" \ |
| 4567 | -c "fragment larger than.*maximum" |
| 4568 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4569 | # Tests for renegotiation |
| 4570 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4571 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4573 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4574 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4575 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4576 | 0 \ |
| 4577 | -C "client hello, adding renegotiation extension" \ |
| 4578 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4579 | -S "found renegotiation extension" \ |
| 4580 | -s "server hello, secure renegotiation extension" \ |
| 4581 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4582 | -C "=> renegotiate" \ |
| 4583 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4584 | -S "write hello request" |
| 4585 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4588 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4589 | "$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] | 4590 | "$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] | 4591 | 0 \ |
| 4592 | -c "client hello, adding renegotiation extension" \ |
| 4593 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4594 | -s "found renegotiation extension" \ |
| 4595 | -s "server hello, secure renegotiation extension" \ |
| 4596 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4597 | -c "=> renegotiate" \ |
| 4598 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4599 | -S "write hello request" |
| 4600 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4601 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4603 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4604 | "$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] | 4605 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4606 | 0 \ |
| 4607 | -c "client hello, adding renegotiation extension" \ |
| 4608 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4609 | -s "found renegotiation extension" \ |
| 4610 | -s "server hello, secure renegotiation extension" \ |
| 4611 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4612 | -c "=> renegotiate" \ |
| 4613 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4614 | -s "write hello request" |
| 4615 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4616 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4617 | # 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] | 4618 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
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 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4621 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4622 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4623 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 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" \ |
| 4630 | -c "=> renegotiate" \ |
| 4631 | -s "=> renegotiate" \ |
| 4632 | -S "write hello request" \ |
| 4633 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4634 | |
| 4635 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4636 | # 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] | 4637 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4638 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4639 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4640 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4641 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4642 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4643 | 0 \ |
| 4644 | -c "client hello, adding renegotiation extension" \ |
| 4645 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4646 | -s "found renegotiation extension" \ |
| 4647 | -s "server hello, secure renegotiation extension" \ |
| 4648 | -c "found renegotiation extension" \ |
| 4649 | -c "=> renegotiate" \ |
| 4650 | -s "=> renegotiate" \ |
| 4651 | -s "write hello request" \ |
| 4652 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4653 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4654 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4656 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4657 | "$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] | 4658 | "$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] | 4659 | 0 \ |
| 4660 | -c "client hello, adding renegotiation extension" \ |
| 4661 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4662 | -s "found renegotiation extension" \ |
| 4663 | -s "server hello, secure renegotiation extension" \ |
| 4664 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4665 | -c "=> renegotiate" \ |
| 4666 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4667 | -s "write hello request" |
| 4668 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4669 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4670 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4671 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4673 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4674 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4675 | "$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" \ |
| 4676 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4677 | -c "Maximum incoming record payload length is 2048" \ |
| 4678 | -c "Maximum outgoing record payload length is 2048" \ |
| 4679 | -s "Maximum incoming record payload length is 2048" \ |
| 4680 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4681 | -c "client hello, adding max_fragment_length extension" \ |
| 4682 | -s "found max fragment length extension" \ |
| 4683 | -s "server hello, max_fragment_length extension" \ |
| 4684 | -c "found max_fragment_length extension" \ |
| 4685 | -c "client hello, adding renegotiation extension" \ |
| 4686 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4687 | -s "found renegotiation extension" \ |
| 4688 | -s "server hello, secure renegotiation extension" \ |
| 4689 | -c "found renegotiation extension" \ |
| 4690 | -c "=> renegotiate" \ |
| 4691 | -s "=> renegotiate" \ |
| 4692 | -s "write hello request" |
| 4693 | |
| 4694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4696 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4697 | "$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] | 4698 | "$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] | 4699 | 1 \ |
| 4700 | -c "client hello, adding renegotiation extension" \ |
| 4701 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4702 | -S "found renegotiation extension" \ |
| 4703 | -s "server hello, secure renegotiation extension" \ |
| 4704 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4705 | -c "=> renegotiate" \ |
| 4706 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4707 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4708 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4709 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4710 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4711 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4713 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4714 | "$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] | 4715 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4716 | 0 \ |
| 4717 | -C "client hello, adding renegotiation extension" \ |
| 4718 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4719 | -S "found renegotiation extension" \ |
| 4720 | -s "server hello, secure renegotiation extension" \ |
| 4721 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4722 | -C "=> renegotiate" \ |
| 4723 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4724 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4725 | -S "SSL - An unexpected message was received from our peer" \ |
| 4726 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4727 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4730 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4731 | "$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] | 4732 | renego_delay=-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 | fae355e | 2014-07-04 14:32:27 +0200 | [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" \ |
| 4740 | -C "=> renegotiate" \ |
| 4741 | -S "=> renegotiate" \ |
| 4742 | -s "write hello request" \ |
| 4743 | -S "SSL - An unexpected message was received from our peer" \ |
| 4744 | -S "failed" |
| 4745 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4746 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4747 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4749 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4750 | "$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] | 4751 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4752 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4753 | 0 \ |
| 4754 | -C "client hello, adding renegotiation extension" \ |
| 4755 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4756 | -S "found renegotiation extension" \ |
| 4757 | -s "server hello, secure renegotiation extension" \ |
| 4758 | -c "found renegotiation extension" \ |
| 4759 | -C "=> renegotiate" \ |
| 4760 | -S "=> renegotiate" \ |
| 4761 | -s "write hello request" \ |
| 4762 | -S "SSL - An unexpected message was received from our peer" \ |
| 4763 | -S "failed" |
| 4764 | |
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 0" \ |
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=0 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" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4780 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4781 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4784 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4785 | "$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] | 4786 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4787 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4788 | 0 \ |
| 4789 | -c "client hello, adding renegotiation extension" \ |
| 4790 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4791 | -s "found renegotiation extension" \ |
| 4792 | -s "server hello, secure renegotiation extension" \ |
| 4793 | -c "found renegotiation extension" \ |
| 4794 | -c "=> renegotiate" \ |
| 4795 | -s "=> renegotiate" \ |
| 4796 | -s "write hello request" \ |
| 4797 | -S "SSL - An unexpected message was received from our peer" \ |
| 4798 | -S "failed" |
| 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 | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4802 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4803 | "$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] | 4804 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4805 | 0 \ |
| 4806 | -C "client hello, adding renegotiation extension" \ |
| 4807 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4808 | -S "found renegotiation extension" \ |
| 4809 | -s "server hello, secure renegotiation extension" \ |
| 4810 | -c "found renegotiation extension" \ |
| 4811 | -S "record counter limit reached: renegotiate" \ |
| 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 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4818 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4821 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4822 | "$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] | 4823 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4824 | 0 \ |
| 4825 | -c "client hello, adding renegotiation extension" \ |
| 4826 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4827 | -s "found renegotiation extension" \ |
| 4828 | -s "server hello, secure renegotiation extension" \ |
| 4829 | -c "found renegotiation extension" \ |
| 4830 | -s "record counter limit reached: renegotiate" \ |
| 4831 | -c "=> renegotiate" \ |
| 4832 | -s "=> renegotiate" \ |
| 4833 | -s "write hello request" \ |
| 4834 | -S "SSL - An unexpected message was received from our peer" \ |
| 4835 | -S "failed" |
| 4836 | |
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, two times 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=7 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, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4858 | "$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] | 4859 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4875 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4876 | "$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] | 4877 | "$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] | 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 | -c "=> renegotiate" \ |
| 4885 | -s "=> renegotiate" \ |
| 4886 | -S "write hello request" |
| 4887 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4888 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4889 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4890 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4891 | "$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] | 4892 | "$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] | 4893 | 0 \ |
| 4894 | -c "client hello, adding renegotiation extension" \ |
| 4895 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4896 | -s "found renegotiation extension" \ |
| 4897 | -s "server hello, secure renegotiation extension" \ |
| 4898 | -c "found renegotiation extension" \ |
| 4899 | -c "=> renegotiate" \ |
| 4900 | -s "=> renegotiate" \ |
| 4901 | -s "write hello request" |
| 4902 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4903 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4905 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4906 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4907 | "$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] | 4908 | 0 \ |
| 4909 | -c "client hello, adding renegotiation extension" \ |
| 4910 | -c "found renegotiation extension" \ |
| 4911 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4912 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4913 | -C "error" \ |
| 4914 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4915 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4916 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4917 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4919 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4920 | "$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] | 4921 | "$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] | 4922 | 0 \ |
| 4923 | -c "client hello, adding renegotiation extension" \ |
| 4924 | -c "found renegotiation extension" \ |
| 4925 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4926 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4927 | -C "error" \ |
| 4928 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4929 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4930 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4931 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4933 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4934 | "$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] | 4935 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4936 | 1 \ |
| 4937 | -c "client hello, adding renegotiation extension" \ |
| 4938 | -C "found renegotiation extension" \ |
| 4939 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4940 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4941 | -c "error" \ |
| 4942 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4943 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4944 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4945 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4947 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4948 | "$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] | 4949 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4950 | allow_legacy=0" \ |
| 4951 | 1 \ |
| 4952 | -c "client hello, adding renegotiation extension" \ |
| 4953 | -C "found renegotiation extension" \ |
| 4954 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4955 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4956 | -c "error" \ |
| 4957 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4958 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4959 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4960 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4962 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4963 | "$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] | 4964 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4965 | allow_legacy=1" \ |
| 4966 | 0 \ |
| 4967 | -c "client hello, adding renegotiation extension" \ |
| 4968 | -C "found renegotiation extension" \ |
| 4969 | -c "=> renegotiate" \ |
| 4970 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4971 | -C "error" \ |
| 4972 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4973 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4974 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4976 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4977 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4978 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4979 | 0 \ |
| 4980 | -c "client hello, adding renegotiation extension" \ |
| 4981 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4982 | -s "found renegotiation extension" \ |
| 4983 | -s "server hello, secure renegotiation extension" \ |
| 4984 | -c "found renegotiation extension" \ |
| 4985 | -c "=> renegotiate" \ |
| 4986 | -s "=> renegotiate" \ |
| 4987 | -S "write hello request" |
| 4988 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4989 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4991 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4992 | "$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] | 4993 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4994 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4995 | 0 \ |
| 4996 | -c "client hello, adding renegotiation extension" \ |
| 4997 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4998 | -s "found renegotiation extension" \ |
| 4999 | -s "server hello, secure renegotiation extension" \ |
| 5000 | -c "found renegotiation extension" \ |
| 5001 | -c "=> renegotiate" \ |
| 5002 | -s "=> renegotiate" \ |
| 5003 | -s "write hello request" |
| 5004 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5006 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5007 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5008 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5009 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5010 | 0 \ |
| 5011 | -c "client hello, adding renegotiation extension" \ |
| 5012 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5013 | -s "found renegotiation extension" \ |
| 5014 | -s "server hello, secure renegotiation extension" \ |
| 5015 | -s "record counter limit reached: renegotiate" \ |
| 5016 | -c "=> renegotiate" \ |
| 5017 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5018 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5019 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5020 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5023 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5024 | "$G_SRV -u --mtu 4096" \ |
| 5025 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5026 | 0 \ |
| 5027 | -c "client hello, adding renegotiation extension" \ |
| 5028 | -c "found renegotiation extension" \ |
| 5029 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5030 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5031 | -C "error" \ |
| 5032 | -s "Extra-header:" |
| 5033 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5034 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5035 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5036 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5038 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5039 | "$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] | 5040 | "$P_CLI debug_level=3" \ |
| 5041 | 0 \ |
| 5042 | -c "found renegotiation extension" \ |
| 5043 | -C "error" \ |
| 5044 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5045 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5046 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5048 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5049 | "$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] | 5050 | "$P_CLI debug_level=3" \ |
| 5051 | 0 \ |
| 5052 | -C "found renegotiation extension" \ |
| 5053 | -C "error" \ |
| 5054 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5055 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5056 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5058 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5059 | "$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] | 5060 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5061 | 1 \ |
| 5062 | -C "found renegotiation extension" \ |
| 5063 | -c "error" \ |
| 5064 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5065 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5066 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5068 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5069 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5070 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5071 | 0 \ |
| 5072 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5073 | -s "server hello, secure renegotiation extension" |
| 5074 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5075 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5077 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5078 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5079 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5080 | 0 \ |
| 5081 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5082 | -S "server hello, secure renegotiation extension" |
| 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 unsafe, server break legacy" \ |
| 5087 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5088 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5089 | 1 \ |
| 5090 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5091 | -S "server hello, secure renegotiation extension" |
| 5092 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5093 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5094 | |
| 5095 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5097 | run_test "DER format: no trailing bytes" \ |
| 5098 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5099 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5100 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5101 | 0 \ |
| 5102 | -c "Handshake was completed" \ |
| 5103 | |
| 5104 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5106 | run_test "DER format: with a trailing zero byte" \ |
| 5107 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5108 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5109 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5110 | 0 \ |
| 5111 | -c "Handshake was completed" \ |
| 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: with a trailing random byte" \ |
| 5116 | "$P_SRV crt_file=data_files/server5-der1b.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 2 trailing random bytes" \ |
| 5125 | "$P_SRV crt_file=data_files/server5-der2.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 4 trailing random bytes" \ |
| 5134 | "$P_SRV crt_file=data_files/server5-der4.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 8 trailing random bytes" \ |
| 5143 | "$P_SRV crt_file=data_files/server5-der8.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 9 trailing random bytes" \ |
| 5152 | "$P_SRV crt_file=data_files/server5-der9.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 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5158 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5159 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5161 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5162 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5163 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5164 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5165 | 1 \ |
| 5166 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5167 | -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] | 5168 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5169 | -c "X509 - Certificate verification failed" |
| 5170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5173 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5174 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5175 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5176 | 0 \ |
| 5177 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5178 | -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] | 5179 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5180 | -C "X509 - Certificate verification failed" |
| 5181 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5183 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5184 | "$P_SRV" \ |
| 5185 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5186 | 0 \ |
| 5187 | -c "x509_verify_cert() returned" \ |
| 5188 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5189 | -c "! Certificate verification flags"\ |
| 5190 | -C "! mbedtls_ssl_handshake returned" \ |
| 5191 | -C "X509 - Certificate verification failed" \ |
| 5192 | -C "SSL - No CA Chain is set, but required to operate" |
| 5193 | |
| 5194 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5195 | "$P_SRV" \ |
| 5196 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5197 | 1 \ |
| 5198 | -c "x509_verify_cert() returned" \ |
| 5199 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5200 | -c "! Certificate verification flags"\ |
| 5201 | -c "! mbedtls_ssl_handshake returned" \ |
| 5202 | -c "SSL - No CA Chain is set, but required to operate" |
| 5203 | |
| 5204 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5205 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5206 | # the client informs the server about the supported curves - it does, though, in the |
| 5207 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5208 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5209 | # different means to have the server ignoring the client's supported curve list. |
| 5210 | |
| 5211 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5213 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5214 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5215 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5216 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5217 | 1 \ |
| 5218 | -c "bad certificate (EC key curve)"\ |
| 5219 | -c "! Certificate verification flags"\ |
| 5220 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5221 | |
| 5222 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5224 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5225 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5226 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5227 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5228 | 1 \ |
| 5229 | -c "bad certificate (EC key curve)"\ |
| 5230 | -c "! Certificate verification flags"\ |
| 5231 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5232 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5234 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5235 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5236 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5237 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5238 | 0 \ |
| 5239 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5240 | -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] | 5241 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5242 | -C "X509 - Certificate verification failed" |
| 5243 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5245 | run_test "Authentication: client SHA256, server required" \ |
| 5246 | "$P_SRV auth_mode=required" \ |
| 5247 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5248 | key_file=data_files/server6.key \ |
| 5249 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5250 | 0 \ |
| 5251 | -c "Supported Signature Algorithm found: 4," \ |
| 5252 | -c "Supported Signature Algorithm found: 5," |
| 5253 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5255 | run_test "Authentication: client SHA384, server required" \ |
| 5256 | "$P_SRV auth_mode=required" \ |
| 5257 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5258 | key_file=data_files/server6.key \ |
| 5259 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5260 | 0 \ |
| 5261 | -c "Supported Signature Algorithm found: 4," \ |
| 5262 | -c "Supported Signature Algorithm found: 5," |
| 5263 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5264 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5265 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5266 | "$P_CLI debug_level=3 crt_file=none \ |
| 5267 | key_file=data_files/server5.key" \ |
| 5268 | 1 \ |
| 5269 | -S "skip write certificate request" \ |
| 5270 | -C "skip parse certificate request" \ |
| 5271 | -c "got a certificate request" \ |
| 5272 | -c "= write certificate$" \ |
| 5273 | -C "skip write certificate$" \ |
| 5274 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5275 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5276 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5277 | -s "No client certification received from the client, but required by the authentication mode" |
| 5278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5279 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5280 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5281 | "$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] | 5282 | key_file=data_files/server5.key" \ |
| 5283 | 1 \ |
| 5284 | -S "skip write certificate request" \ |
| 5285 | -C "skip parse certificate request" \ |
| 5286 | -c "got a certificate request" \ |
| 5287 | -C "skip write certificate" \ |
| 5288 | -C "skip write certificate verify" \ |
| 5289 | -S "skip parse certificate verify" \ |
| 5290 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5291 | -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] | 5292 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5293 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5294 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5295 | # We don't check that the client receives the alert because it might |
| 5296 | # detect that its write end of the connection is closed and abort |
| 5297 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5298 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5299 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5300 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5301 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5302 | key_file=data_files/server5.key" \ |
| 5303 | 0 \ |
| 5304 | -S "skip write certificate request" \ |
| 5305 | -C "skip parse certificate request" \ |
| 5306 | -c "got a certificate request" \ |
| 5307 | -C "skip write certificate" \ |
| 5308 | -C "skip write certificate verify" \ |
| 5309 | -S "skip parse certificate verify" \ |
| 5310 | -S "x509_verify_cert() returned" \ |
| 5311 | -S "! The certificate is not correctly signed" \ |
| 5312 | -S "X509 - Certificate verification failed" |
| 5313 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5314 | run_test "Authentication: client cert not trusted, server required" \ |
| 5315 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5316 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5317 | key_file=data_files/server5.key" \ |
| 5318 | 1 \ |
| 5319 | -S "skip write certificate request" \ |
| 5320 | -C "skip parse certificate request" \ |
| 5321 | -c "got a certificate request" \ |
| 5322 | -C "skip write certificate" \ |
| 5323 | -C "skip write certificate verify" \ |
| 5324 | -S "skip parse certificate verify" \ |
| 5325 | -s "x509_verify_cert() returned" \ |
| 5326 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5327 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5328 | -s "X509 - Certificate verification failed" |
| 5329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5330 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5331 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5332 | "$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] | 5333 | key_file=data_files/server5.key" \ |
| 5334 | 0 \ |
| 5335 | -S "skip write certificate request" \ |
| 5336 | -C "skip parse certificate request" \ |
| 5337 | -c "got a certificate request" \ |
| 5338 | -C "skip write certificate" \ |
| 5339 | -C "skip write certificate verify" \ |
| 5340 | -S "skip parse certificate verify" \ |
| 5341 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5342 | -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] | 5343 | -S "! mbedtls_ssl_handshake returned" \ |
| 5344 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5345 | -S "X509 - Certificate verification failed" |
| 5346 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5348 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5349 | "$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] | 5350 | key_file=data_files/server5.key" \ |
| 5351 | 0 \ |
| 5352 | -s "skip write certificate request" \ |
| 5353 | -C "skip parse certificate request" \ |
| 5354 | -c "got no certificate request" \ |
| 5355 | -c "skip write certificate" \ |
| 5356 | -c "skip write certificate verify" \ |
| 5357 | -s "skip parse certificate verify" \ |
| 5358 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5359 | -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] | 5360 | -S "! mbedtls_ssl_handshake returned" \ |
| 5361 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5362 | -S "X509 - Certificate verification failed" |
| 5363 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5364 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5365 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5366 | "$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] | 5367 | 0 \ |
| 5368 | -S "skip write certificate request" \ |
| 5369 | -C "skip parse certificate request" \ |
| 5370 | -c "got a certificate request" \ |
| 5371 | -C "skip write certificate$" \ |
| 5372 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5373 | -c "skip write certificate verify" \ |
| 5374 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5375 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5376 | -S "! mbedtls_ssl_handshake returned" \ |
| 5377 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5378 | -S "X509 - Certificate verification failed" |
| 5379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5381 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5382 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5383 | "$O_CLI" \ |
| 5384 | 0 \ |
| 5385 | -S "skip write certificate request" \ |
| 5386 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5387 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5388 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5389 | -S "X509 - Certificate verification failed" |
| 5390 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5392 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5393 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5394 | "$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] | 5395 | 0 \ |
| 5396 | -C "skip parse certificate request" \ |
| 5397 | -c "got a certificate request" \ |
| 5398 | -C "skip write certificate$" \ |
| 5399 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5400 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5401 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5403 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5404 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5405 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5406 | 1 \ |
| 5407 | -C "skip parse certificate request" \ |
| 5408 | -c "got a certificate request" \ |
| 5409 | -C "skip write certificate$" \ |
| 5410 | -c "skip write certificate verify" \ |
| 5411 | -c "! mbedtls_ssl_handshake returned" |
| 5412 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5413 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5414 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5415 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5416 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5417 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5418 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5419 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5420 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5421 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5422 | # 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] | 5423 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5424 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5425 | run_test "Authentication: server max_int chain, client default" \ |
| 5426 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5427 | key_file=data_files/dir-maxpath/09.key" \ |
| 5428 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5429 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5430 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5431 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5432 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5433 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5434 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5435 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5436 | key_file=data_files/dir-maxpath/10.key" \ |
| 5437 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5438 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5439 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5440 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5441 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5442 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5444 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5445 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5446 | key_file=data_files/dir-maxpath/10.key" \ |
| 5447 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5448 | auth_mode=optional" \ |
| 5449 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5450 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5451 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5452 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5453 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5455 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5456 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5457 | key_file=data_files/dir-maxpath/10.key" \ |
| 5458 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5459 | auth_mode=none" \ |
| 5460 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5461 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5462 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5463 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5464 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5465 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5466 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5467 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5468 | key_file=data_files/dir-maxpath/10.key" \ |
| 5469 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5470 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5471 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5472 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5473 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5474 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5475 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5476 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5477 | key_file=data_files/dir-maxpath/10.key" \ |
| 5478 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5479 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5480 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5481 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5482 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5483 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5484 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5485 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5486 | key_file=data_files/dir-maxpath/10.key" \ |
| 5487 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5488 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5489 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5490 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5491 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5492 | run_test "Authentication: client max_int chain, server required" \ |
| 5493 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5494 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5495 | key_file=data_files/dir-maxpath/09.key" \ |
| 5496 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5497 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5498 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5499 | # Tests for CA list in CertificateRequest messages |
| 5500 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5502 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5503 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5504 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5505 | key_file=data_files/server6.key" \ |
| 5506 | 0 \ |
| 5507 | -s "requested DN" |
| 5508 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5510 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5511 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5512 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5513 | key_file=data_files/server6.key" \ |
| 5514 | 0 \ |
| 5515 | -S "requested DN" |
| 5516 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5518 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5519 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5520 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5521 | key_file=data_files/server5.key" \ |
| 5522 | 1 \ |
| 5523 | -S "requested DN" \ |
| 5524 | -s "x509_verify_cert() returned" \ |
| 5525 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5526 | -s "! mbedtls_ssl_handshake returned" \ |
| 5527 | -c "! mbedtls_ssl_handshake returned" \ |
| 5528 | -s "X509 - Certificate verification failed" |
| 5529 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5531 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5532 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5533 | crt_file2=data_files/server1.crt \ |
| 5534 | key_file2=data_files/server1.key" \ |
| 5535 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5536 | crt_file=data_files/server6.crt \ |
| 5537 | key_file=data_files/server6.key" \ |
| 5538 | 0 \ |
| 5539 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5540 | |
| 5541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5542 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5543 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5544 | crt_file2=data_files/server2.crt \ |
| 5545 | key_file2=data_files/server2.key" \ |
| 5546 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5547 | crt_file=data_files/server6.crt \ |
| 5548 | key_file=data_files/server6.key" \ |
| 5549 | 0 \ |
| 5550 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5551 | |
| 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5553 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5554 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5555 | crt_file2=data_files/server1.crt \ |
| 5556 | key_file2=data_files/server1.key" \ |
| 5557 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5558 | crt_file=data_files/server6.crt \ |
| 5559 | key_file=data_files/server6.key" \ |
| 5560 | 0 \ |
| 5561 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5562 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5563 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5564 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5565 | |
| 5566 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5568 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5569 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5570 | key_file=data_files/server5.key" \ |
| 5571 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5572 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5573 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5574 | -c "x509_verify_cert() returned" \ |
| 5575 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5576 | -c "! mbedtls_ssl_handshake returned" \ |
| 5577 | -c "X509 - Certificate verification failed" |
| 5578 | |
| 5579 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5581 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5582 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5583 | key_file=data_files/server5.key" \ |
| 5584 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5585 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5586 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5587 | -c "x509_verify_cert() returned" \ |
| 5588 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5589 | -C "! mbedtls_ssl_handshake returned" \ |
| 5590 | -C "X509 - Certificate verification failed" |
| 5591 | |
| 5592 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5593 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5594 | # the client informs the server about the supported curves - it does, though, in the |
| 5595 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5596 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5597 | # different means to have the server ignoring the client's supported curve list. |
| 5598 | |
| 5599 | requires_config_enabled MBEDTLS_ECP_C |
| 5600 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5602 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5603 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5604 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5605 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5606 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5607 | -c "use CA callback for X.509 CRT verification" \ |
| 5608 | -c "bad certificate (EC key curve)" \ |
| 5609 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5610 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5611 | |
| 5612 | requires_config_enabled MBEDTLS_ECP_C |
| 5613 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5615 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5616 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5617 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5618 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5619 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5620 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5621 | -c "bad certificate (EC key curve)"\ |
| 5622 | -c "! Certificate verification flags"\ |
| 5623 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5624 | |
| 5625 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5627 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5628 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5629 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5630 | key_file=data_files/server6.key \ |
| 5631 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5632 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5633 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5634 | -c "Supported Signature Algorithm found: 4," \ |
| 5635 | -c "Supported Signature Algorithm found: 5," |
| 5636 | |
| 5637 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5639 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5640 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5641 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5642 | key_file=data_files/server6.key \ |
| 5643 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5644 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5645 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5646 | -c "Supported Signature Algorithm found: 4," \ |
| 5647 | -c "Supported Signature Algorithm found: 5," |
| 5648 | |
| 5649 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5651 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5652 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5653 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5654 | key_file=data_files/server5.key" \ |
| 5655 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5656 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5657 | -S "skip write certificate request" \ |
| 5658 | -C "skip parse certificate request" \ |
| 5659 | -c "got a certificate request" \ |
| 5660 | -C "skip write certificate" \ |
| 5661 | -C "skip write certificate verify" \ |
| 5662 | -S "skip parse certificate verify" \ |
| 5663 | -s "x509_verify_cert() returned" \ |
| 5664 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5665 | -s "! mbedtls_ssl_handshake returned" \ |
| 5666 | -s "send alert level=2 message=48" \ |
| 5667 | -c "! mbedtls_ssl_handshake returned" \ |
| 5668 | -s "X509 - Certificate verification failed" |
| 5669 | # We don't check that the client receives the alert because it might |
| 5670 | # detect that its write end of the connection is closed and abort |
| 5671 | # before reading the alert message. |
| 5672 | |
| 5673 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5675 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5676 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5677 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5678 | key_file=data_files/server5.key" \ |
| 5679 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5680 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5681 | -S "skip write certificate request" \ |
| 5682 | -C "skip parse certificate request" \ |
| 5683 | -c "got a certificate request" \ |
| 5684 | -C "skip write certificate" \ |
| 5685 | -C "skip write certificate verify" \ |
| 5686 | -S "skip parse certificate verify" \ |
| 5687 | -s "x509_verify_cert() returned" \ |
| 5688 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5689 | -s "! mbedtls_ssl_handshake returned" \ |
| 5690 | -c "! mbedtls_ssl_handshake returned" \ |
| 5691 | -s "X509 - Certificate verification failed" |
| 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 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5695 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5696 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5697 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5698 | key_file=data_files/server5.key" \ |
| 5699 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5700 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5701 | -S "skip write certificate request" \ |
| 5702 | -C "skip parse certificate request" \ |
| 5703 | -c "got a certificate request" \ |
| 5704 | -C "skip write certificate" \ |
| 5705 | -C "skip write certificate verify" \ |
| 5706 | -S "skip parse certificate verify" \ |
| 5707 | -s "x509_verify_cert() returned" \ |
| 5708 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5709 | -S "! mbedtls_ssl_handshake returned" \ |
| 5710 | -C "! mbedtls_ssl_handshake returned" \ |
| 5711 | -S "X509 - Certificate verification failed" |
| 5712 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5713 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5714 | requires_full_size_output_buffer |
| 5715 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5717 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5718 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5719 | key_file=data_files/dir-maxpath/09.key" \ |
| 5720 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5721 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5722 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5723 | -C "X509 - A fatal error occurred" |
| 5724 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5725 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5726 | requires_full_size_output_buffer |
| 5727 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5729 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5730 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5731 | key_file=data_files/dir-maxpath/10.key" \ |
| 5732 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5733 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5734 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5735 | -c "X509 - A fatal error occurred" |
| 5736 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5737 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5738 | requires_full_size_output_buffer |
| 5739 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5741 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5742 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5743 | key_file=data_files/dir-maxpath/10.key" \ |
| 5744 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5745 | debug_level=3 auth_mode=optional" \ |
| 5746 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5747 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5748 | -c "X509 - A fatal error occurred" |
| 5749 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5750 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5751 | requires_full_size_output_buffer |
| 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 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5754 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5755 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5756 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5757 | key_file=data_files/dir-maxpath/10.key" \ |
| 5758 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5759 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5760 | -s "X509 - A fatal error occurred" |
| 5761 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5762 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5763 | requires_full_size_output_buffer |
| 5764 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5766 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5767 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5768 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5769 | key_file=data_files/dir-maxpath/10.key" \ |
| 5770 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5771 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5772 | -s "X509 - A fatal error occurred" |
| 5773 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5774 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5775 | requires_full_size_output_buffer |
| 5776 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5778 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5779 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5780 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5781 | key_file=data_files/dir-maxpath/09.key" \ |
| 5782 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5783 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5784 | -S "X509 - A fatal error occurred" |
| 5785 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5786 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5787 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5788 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5789 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5790 | "$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] | 5791 | key_file=data_files/server5.key \ |
| 5792 | crt_file2=data_files/server5-sha1.crt \ |
| 5793 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5794 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5795 | 0 \ |
| 5796 | -c "signed using.*ECDSA with SHA256" \ |
| 5797 | -C "signed using.*ECDSA with SHA1" |
| 5798 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5799 | # tests for SNI |
| 5800 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5801 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5802 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5803 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5804 | 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] | 5805 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5806 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5807 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5808 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5809 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5810 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5811 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5812 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5813 | 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] | 5814 | 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] | 5815 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5816 | 0 \ |
| 5817 | -s "parse ServerName extension" \ |
| 5818 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5819 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5820 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5821 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5822 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5823 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5824 | 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] | 5825 | 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] | 5826 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5827 | 0 \ |
| 5828 | -s "parse ServerName extension" \ |
| 5829 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5830 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5831 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5832 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5833 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5834 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5835 | 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] | 5836 | 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] | 5837 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5838 | 1 \ |
| 5839 | -s "parse ServerName extension" \ |
| 5840 | -s "ssl_sni_wrapper() returned" \ |
| 5841 | -s "mbedtls_ssl_handshake returned" \ |
| 5842 | -c "mbedtls_ssl_handshake returned" \ |
| 5843 | -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] | 5844 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5845 | run_test "SNI: client auth no override: optional" \ |
| 5846 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5847 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5848 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5849 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5850 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5851 | -S "skip write certificate request" \ |
| 5852 | -C "skip parse certificate request" \ |
| 5853 | -c "got a certificate request" \ |
| 5854 | -C "skip write certificate" \ |
| 5855 | -C "skip write certificate verify" \ |
| 5856 | -S "skip parse certificate verify" |
| 5857 | |
| 5858 | run_test "SNI: client auth override: none -> optional" \ |
| 5859 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5860 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5861 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5862 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5863 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5864 | -S "skip write certificate request" \ |
| 5865 | -C "skip parse certificate request" \ |
| 5866 | -c "got a certificate request" \ |
| 5867 | -C "skip write certificate" \ |
| 5868 | -C "skip write certificate verify" \ |
| 5869 | -S "skip parse certificate verify" |
| 5870 | |
| 5871 | run_test "SNI: client auth override: optional -> none" \ |
| 5872 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5873 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5874 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5875 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5876 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5877 | -s "skip write certificate request" \ |
| 5878 | -C "skip parse certificate request" \ |
| 5879 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 5880 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5881 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5882 | run_test "SNI: CA no override" \ |
| 5883 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5884 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5885 | ca_file=data_files/test-ca.crt \ |
| 5886 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5887 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5888 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5889 | 1 \ |
| 5890 | -S "skip write certificate request" \ |
| 5891 | -C "skip parse certificate request" \ |
| 5892 | -c "got a certificate request" \ |
| 5893 | -C "skip write certificate" \ |
| 5894 | -C "skip write certificate verify" \ |
| 5895 | -S "skip parse certificate verify" \ |
| 5896 | -s "x509_verify_cert() returned" \ |
| 5897 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5898 | -S "The certificate has been revoked (is on a CRL)" |
| 5899 | |
| 5900 | run_test "SNI: CA override" \ |
| 5901 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5902 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5903 | ca_file=data_files/test-ca.crt \ |
| 5904 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5905 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5906 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5907 | 0 \ |
| 5908 | -S "skip write certificate request" \ |
| 5909 | -C "skip parse certificate request" \ |
| 5910 | -c "got a certificate request" \ |
| 5911 | -C "skip write certificate" \ |
| 5912 | -C "skip write certificate verify" \ |
| 5913 | -S "skip parse certificate verify" \ |
| 5914 | -S "x509_verify_cert() returned" \ |
| 5915 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5916 | -S "The certificate has been revoked (is on a CRL)" |
| 5917 | |
| 5918 | run_test "SNI: CA override with CRL" \ |
| 5919 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5920 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5921 | ca_file=data_files/test-ca.crt \ |
| 5922 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5923 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5924 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5925 | 1 \ |
| 5926 | -S "skip write certificate request" \ |
| 5927 | -C "skip parse certificate request" \ |
| 5928 | -c "got a certificate request" \ |
| 5929 | -C "skip write certificate" \ |
| 5930 | -C "skip write certificate verify" \ |
| 5931 | -S "skip parse certificate verify" \ |
| 5932 | -s "x509_verify_cert() returned" \ |
| 5933 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5934 | -s "The certificate has been revoked (is on a CRL)" |
| 5935 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5936 | # Tests for SNI and DTLS |
| 5937 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5938 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5940 | run_test "SNI: DTLS, no SNI callback" \ |
| 5941 | "$P_SRV debug_level=3 dtls=1 \ |
| 5942 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5943 | "$P_CLI server_name=localhost dtls=1" \ |
| 5944 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5945 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5946 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5947 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5948 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5950 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5951 | "$P_SRV debug_level=3 dtls=1 \ |
| 5952 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5953 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5954 | "$P_CLI server_name=localhost dtls=1" \ |
| 5955 | 0 \ |
| 5956 | -s "parse ServerName extension" \ |
| 5957 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5958 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5959 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5960 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5962 | run_test "SNI: DTLS, matching cert 2" \ |
| 5963 | "$P_SRV debug_level=3 dtls=1 \ |
| 5964 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5965 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5966 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5967 | 0 \ |
| 5968 | -s "parse ServerName extension" \ |
| 5969 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5970 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5971 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5973 | run_test "SNI: DTLS, no matching cert" \ |
| 5974 | "$P_SRV debug_level=3 dtls=1 \ |
| 5975 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5976 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5977 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5978 | 1 \ |
| 5979 | -s "parse ServerName extension" \ |
| 5980 | -s "ssl_sni_wrapper() returned" \ |
| 5981 | -s "mbedtls_ssl_handshake returned" \ |
| 5982 | -c "mbedtls_ssl_handshake returned" \ |
| 5983 | -c "SSL - A fatal alert message was received from our peer" |
| 5984 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5986 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5987 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5988 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5989 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5990 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5991 | 0 \ |
| 5992 | -S "skip write certificate request" \ |
| 5993 | -C "skip parse certificate request" \ |
| 5994 | -c "got a certificate request" \ |
| 5995 | -C "skip write certificate" \ |
| 5996 | -C "skip write certificate verify" \ |
| 5997 | -S "skip parse certificate verify" |
| 5998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6000 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6001 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6002 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6003 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6004 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6005 | 0 \ |
| 6006 | -S "skip write certificate request" \ |
| 6007 | -C "skip parse certificate request" \ |
| 6008 | -c "got a certificate request" \ |
| 6009 | -C "skip write certificate" \ |
| 6010 | -C "skip write certificate verify" \ |
| 6011 | -S "skip parse certificate verify" |
| 6012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6014 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6015 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6016 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6017 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6018 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6019 | 0 \ |
| 6020 | -s "skip write certificate request" \ |
| 6021 | -C "skip parse certificate request" \ |
| 6022 | -c "got no certificate request" \ |
| 6023 | -c "skip write certificate" \ |
| 6024 | -c "skip write certificate verify" \ |
| 6025 | -s "skip parse certificate verify" |
| 6026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6028 | run_test "SNI: DTLS, CA no override" \ |
| 6029 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6030 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6031 | ca_file=data_files/test-ca.crt \ |
| 6032 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6033 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6034 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6035 | 1 \ |
| 6036 | -S "skip write certificate request" \ |
| 6037 | -C "skip parse certificate request" \ |
| 6038 | -c "got a certificate request" \ |
| 6039 | -C "skip write certificate" \ |
| 6040 | -C "skip write certificate verify" \ |
| 6041 | -S "skip parse certificate verify" \ |
| 6042 | -s "x509_verify_cert() returned" \ |
| 6043 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6044 | -S "The certificate has been revoked (is on a CRL)" |
| 6045 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6047 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6048 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6049 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6050 | ca_file=data_files/test-ca.crt \ |
| 6051 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6052 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6053 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6054 | 0 \ |
| 6055 | -S "skip write certificate request" \ |
| 6056 | -C "skip parse certificate request" \ |
| 6057 | -c "got a certificate request" \ |
| 6058 | -C "skip write certificate" \ |
| 6059 | -C "skip write certificate verify" \ |
| 6060 | -S "skip parse certificate verify" \ |
| 6061 | -S "x509_verify_cert() returned" \ |
| 6062 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6063 | -S "The certificate has been revoked (is on a CRL)" |
| 6064 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6066 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6067 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6068 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6069 | ca_file=data_files/test-ca.crt \ |
| 6070 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6071 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6072 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6073 | 1 \ |
| 6074 | -S "skip write certificate request" \ |
| 6075 | -C "skip parse certificate request" \ |
| 6076 | -c "got a certificate request" \ |
| 6077 | -C "skip write certificate" \ |
| 6078 | -C "skip write certificate verify" \ |
| 6079 | -S "skip parse certificate verify" \ |
| 6080 | -s "x509_verify_cert() returned" \ |
| 6081 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6082 | -s "The certificate has been revoked (is on a CRL)" |
| 6083 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6084 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6087 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6088 | "$P_CLI nbio=2 tickets=0" \ |
| 6089 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6090 | -S "mbedtls_ssl_handshake returned" \ |
| 6091 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6092 | -c "Read from server: .* bytes read" |
| 6093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6094 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6095 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6096 | "$P_CLI nbio=2 tickets=0" \ |
| 6097 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6098 | -S "mbedtls_ssl_handshake returned" \ |
| 6099 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6100 | -c "Read from server: .* bytes read" |
| 6101 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6103 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6104 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6105 | "$P_CLI nbio=2 tickets=1" \ |
| 6106 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6107 | -S "mbedtls_ssl_handshake returned" \ |
| 6108 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6109 | -c "Read from server: .* bytes read" |
| 6110 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6112 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6113 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6114 | "$P_CLI nbio=2 tickets=1" \ |
| 6115 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6116 | -S "mbedtls_ssl_handshake returned" \ |
| 6117 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6118 | -c "Read from server: .* bytes read" |
| 6119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6121 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6122 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6123 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6124 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6125 | -S "mbedtls_ssl_handshake returned" \ |
| 6126 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6127 | -c "Read from server: .* bytes read" |
| 6128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6130 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6131 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6132 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6133 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6134 | -S "mbedtls_ssl_handshake returned" \ |
| 6135 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6136 | -c "Read from server: .* bytes read" |
| 6137 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6139 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6140 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6141 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6142 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6143 | -S "mbedtls_ssl_handshake returned" \ |
| 6144 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6145 | -c "Read from server: .* bytes read" |
| 6146 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6147 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6148 | |
| 6149 | run_test "Event-driven I/O: basic handshake" \ |
| 6150 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6151 | "$P_CLI event=1 tickets=0" \ |
| 6152 | 0 \ |
| 6153 | -S "mbedtls_ssl_handshake returned" \ |
| 6154 | -C "mbedtls_ssl_handshake returned" \ |
| 6155 | -c "Read from server: .* bytes read" |
| 6156 | |
| 6157 | run_test "Event-driven I/O: client auth" \ |
| 6158 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6159 | "$P_CLI event=1 tickets=0" \ |
| 6160 | 0 \ |
| 6161 | -S "mbedtls_ssl_handshake returned" \ |
| 6162 | -C "mbedtls_ssl_handshake returned" \ |
| 6163 | -c "Read from server: .* bytes read" |
| 6164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6166 | run_test "Event-driven I/O: ticket" \ |
| 6167 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6168 | "$P_CLI event=1 tickets=1" \ |
| 6169 | 0 \ |
| 6170 | -S "mbedtls_ssl_handshake returned" \ |
| 6171 | -C "mbedtls_ssl_handshake returned" \ |
| 6172 | -c "Read from server: .* bytes read" |
| 6173 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6175 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6176 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6177 | "$P_CLI event=1 tickets=1" \ |
| 6178 | 0 \ |
| 6179 | -S "mbedtls_ssl_handshake returned" \ |
| 6180 | -C "mbedtls_ssl_handshake returned" \ |
| 6181 | -c "Read from server: .* bytes read" |
| 6182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6184 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6185 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6186 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6187 | 0 \ |
| 6188 | -S "mbedtls_ssl_handshake returned" \ |
| 6189 | -C "mbedtls_ssl_handshake returned" \ |
| 6190 | -c "Read from server: .* bytes read" |
| 6191 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6193 | run_test "Event-driven I/O: ticket + resume" \ |
| 6194 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6195 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6196 | 0 \ |
| 6197 | -S "mbedtls_ssl_handshake returned" \ |
| 6198 | -C "mbedtls_ssl_handshake returned" \ |
| 6199 | -c "Read from server: .* bytes read" |
| 6200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6202 | run_test "Event-driven I/O: session-id resume" \ |
| 6203 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6204 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6205 | 0 \ |
| 6206 | -S "mbedtls_ssl_handshake returned" \ |
| 6207 | -C "mbedtls_ssl_handshake returned" \ |
| 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 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6211 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6212 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6213 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6214 | 0 \ |
| 6215 | -c "Read from server: .* bytes read" |
| 6216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6218 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6219 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6220 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6221 | 0 \ |
| 6222 | -c "Read from server: .* bytes read" |
| 6223 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6225 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6226 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6227 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6228 | 0 \ |
| 6229 | -c "Read from server: .* bytes read" |
| 6230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6232 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6233 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6234 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6235 | 0 \ |
| 6236 | -c "Read from server: .* bytes read" |
| 6237 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6239 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6240 | "$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] | 6241 | "$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] | 6242 | 0 \ |
| 6243 | -c "Read from server: .* bytes read" |
| 6244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6246 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6247 | "$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] | 6248 | "$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] | 6249 | 0 \ |
| 6250 | -c "Read from server: .* bytes read" |
| 6251 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6253 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6254 | "$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] | 6255 | "$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] | 6256 | 0 \ |
| 6257 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6258 | |
| 6259 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6260 | # During session resumption, the client will send its ApplicationData record |
| 6261 | # within the same datagram as the Finished messages. In this situation, the |
| 6262 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6263 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6265 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6266 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6267 | "$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] | 6268 | "$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] | 6269 | 0 \ |
| 6270 | -c "Read from server: .* bytes read" |
| 6271 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6272 | # Tests for version negotiation |
| 6273 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6275 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6276 | "$P_SRV" \ |
| 6277 | "$P_CLI" \ |
| 6278 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6279 | -S "mbedtls_ssl_handshake returned" \ |
| 6280 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6281 | -s "Protocol is TLSv1.2" \ |
| 6282 | -c "Protocol is TLSv1.2" |
| 6283 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6285 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6286 | "$P_SRV" \ |
| 6287 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6288 | 1 \ |
| 6289 | -s "Handshake protocol not within min/max boundaries" \ |
| 6290 | -c "Error in protocol version" \ |
| 6291 | -S "Protocol is TLSv1.0" \ |
| 6292 | -C "Handshake was completed" |
| 6293 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6294 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6295 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6296 | "$P_SRV" \ |
| 6297 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6298 | 1 \ |
| 6299 | -s "Handshake protocol not within min/max boundaries" \ |
| 6300 | -c "Error in protocol version" \ |
| 6301 | -S "Protocol is TLSv1.1" \ |
| 6302 | -C "Handshake was completed" |
| 6303 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6305 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6306 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6307 | "$P_CLI" \ |
| 6308 | 1 \ |
| 6309 | -s "Error in protocol version" \ |
| 6310 | -c "Handshake protocol not within min/max boundaries" \ |
| 6311 | -S "Version: TLS1.0" \ |
| 6312 | -C "Protocol is TLSv1.0" |
| 6313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6315 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6316 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6317 | "$P_CLI" \ |
| 6318 | 1 \ |
| 6319 | -s "Error in protocol version" \ |
| 6320 | -c "Handshake protocol not within min/max boundaries" \ |
| 6321 | -S "Version: TLS1.1" \ |
| 6322 | -C "Protocol is TLSv1.1" |
| 6323 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6324 | # Tests for ALPN extension |
| 6325 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6326 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6327 | "$P_SRV debug_level=3" \ |
| 6328 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6329 | 0 \ |
| 6330 | -C "client hello, adding alpn extension" \ |
| 6331 | -S "found alpn extension" \ |
| 6332 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6333 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6334 | -C "found alpn extension " \ |
| 6335 | -C "Application Layer Protocol is" \ |
| 6336 | -S "Application Layer Protocol is" |
| 6337 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6338 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6339 | "$P_SRV debug_level=3" \ |
| 6340 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6341 | 0 \ |
| 6342 | -c "client hello, adding alpn extension" \ |
| 6343 | -s "found alpn extension" \ |
| 6344 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6345 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6346 | -C "found alpn extension " \ |
| 6347 | -c "Application Layer Protocol is (none)" \ |
| 6348 | -S "Application Layer Protocol is" |
| 6349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6350 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6351 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6352 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6353 | 0 \ |
| 6354 | -C "client hello, adding alpn extension" \ |
| 6355 | -S "found alpn extension" \ |
| 6356 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6357 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6358 | -C "found alpn extension " \ |
| 6359 | -C "Application Layer Protocol is" \ |
| 6360 | -s "Application Layer Protocol is (none)" |
| 6361 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6362 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6363 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6364 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6365 | 0 \ |
| 6366 | -c "client hello, adding alpn extension" \ |
| 6367 | -s "found alpn extension" \ |
| 6368 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6369 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6370 | -c "found alpn extension" \ |
| 6371 | -c "Application Layer Protocol is abc" \ |
| 6372 | -s "Application Layer Protocol is abc" |
| 6373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6374 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6375 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6376 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6377 | 0 \ |
| 6378 | -c "client hello, adding alpn extension" \ |
| 6379 | -s "found alpn extension" \ |
| 6380 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6381 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6382 | -c "found alpn extension" \ |
| 6383 | -c "Application Layer Protocol is abc" \ |
| 6384 | -s "Application Layer Protocol is abc" |
| 6385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6386 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6387 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6388 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6389 | 0 \ |
| 6390 | -c "client hello, adding alpn extension" \ |
| 6391 | -s "found alpn extension" \ |
| 6392 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6393 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6394 | -c "found alpn extension" \ |
| 6395 | -c "Application Layer Protocol is 1234" \ |
| 6396 | -s "Application Layer Protocol is 1234" |
| 6397 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6398 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6399 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6400 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6401 | 1 \ |
| 6402 | -c "client hello, adding alpn extension" \ |
| 6403 | -s "found alpn extension" \ |
| 6404 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6405 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6406 | -C "found alpn extension" \ |
| 6407 | -C "Application Layer Protocol is 1234" \ |
| 6408 | -S "Application Layer Protocol is 1234" |
| 6409 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6410 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6411 | # Tests for keyUsage in leaf certificates, part 1: |
| 6412 | # server-side certificate/suite selection |
| 6413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6415 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6416 | "$P_SRV key_file=data_files/server2.key \ |
| 6417 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6418 | "$P_CLI" \ |
| 6419 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6420 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6421 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6423 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6424 | "$P_SRV key_file=data_files/server2.key \ |
| 6425 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6426 | "$P_CLI" \ |
| 6427 | 0 \ |
| 6428 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6429 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6430 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6431 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6432 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6433 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6434 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6435 | 1 \ |
| 6436 | -C "Ciphersuite is " |
| 6437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6439 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6440 | "$P_SRV key_file=data_files/server5.key \ |
| 6441 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6442 | "$P_CLI" \ |
| 6443 | 0 \ |
| 6444 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6445 | |
| 6446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6448 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6449 | "$P_SRV key_file=data_files/server5.key \ |
| 6450 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6451 | "$P_CLI" \ |
| 6452 | 0 \ |
| 6453 | -c "Ciphersuite is TLS-ECDH-" |
| 6454 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6456 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6457 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6458 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6459 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6460 | 1 \ |
| 6461 | -C "Ciphersuite is " |
| 6462 | |
| 6463 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6464 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6467 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6468 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6469 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6470 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6471 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6472 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6473 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6474 | -C "Processing of the Certificate handshake message failed" \ |
| 6475 | -c "Ciphersuite is TLS-" |
| 6476 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6478 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6479 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6480 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6481 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6482 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6483 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6484 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6485 | -C "Processing of the Certificate handshake message failed" \ |
| 6486 | -c "Ciphersuite is TLS-" |
| 6487 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6489 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6490 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6491 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6492 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6493 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6494 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6495 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6496 | -C "Processing of the Certificate handshake message failed" \ |
| 6497 | -c "Ciphersuite is TLS-" |
| 6498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6500 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6501 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6502 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6503 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6504 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6505 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6506 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6507 | -c "Processing of the Certificate handshake message failed" \ |
| 6508 | -C "Ciphersuite is TLS-" |
| 6509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6511 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6512 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6513 | -cert data_files/server2.ku-ke.crt" \ |
| 6514 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6515 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6516 | 0 \ |
| 6517 | -c "bad certificate (usage extensions)" \ |
| 6518 | -C "Processing of the Certificate handshake message failed" \ |
| 6519 | -c "Ciphersuite is TLS-" \ |
| 6520 | -c "! Usage does not match the keyUsage extension" |
| 6521 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6523 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6524 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6525 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6526 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6527 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6528 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6529 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6530 | -C "Processing of the Certificate handshake message failed" \ |
| 6531 | -c "Ciphersuite is TLS-" |
| 6532 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6534 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6535 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6536 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6537 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6538 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6539 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6540 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6541 | -c "Processing of the Certificate handshake message failed" \ |
| 6542 | -C "Ciphersuite is TLS-" |
| 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 | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6545 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6546 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6547 | -cert data_files/server2.ku-ds.crt" \ |
| 6548 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6549 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6550 | 0 \ |
| 6551 | -c "bad certificate (usage extensions)" \ |
| 6552 | -C "Processing of the Certificate handshake message failed" \ |
| 6553 | -c "Ciphersuite is TLS-" \ |
| 6554 | -c "! Usage does not match the keyUsage extension" |
| 6555 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6557 | requires_openssl_tls1_3 |
| 6558 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6559 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6560 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6561 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6562 | "$P_CLI debug_level=3" \ |
| 6563 | 0 \ |
| 6564 | -C "bad certificate (usage extensions)" \ |
| 6565 | -C "Processing of the Certificate handshake message failed" \ |
| 6566 | -c "Ciphersuite is" |
| 6567 | |
| 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6569 | requires_openssl_tls1_3 |
| 6570 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6571 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6572 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6573 | -cert data_files/server2.ku-ke.crt" \ |
| 6574 | "$P_CLI debug_level=1" \ |
| 6575 | 1 \ |
| 6576 | -c "bad certificate (usage extensions)" \ |
| 6577 | -c "Processing of the Certificate handshake message failed" \ |
| 6578 | -C "Ciphersuite is" |
| 6579 | |
| 6580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6581 | requires_openssl_tls1_3 |
| 6582 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6583 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6584 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6585 | -cert data_files/server2.ku-ka.crt" \ |
| 6586 | "$P_CLI debug_level=1" \ |
| 6587 | 1 \ |
| 6588 | -c "bad certificate (usage extensions)" \ |
| 6589 | -c "Processing of the Certificate handshake message failed" \ |
| 6590 | -C "Ciphersuite is" |
| 6591 | |
| 6592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6593 | requires_openssl_tls1_3 |
| 6594 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6595 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6596 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6597 | -cert data_files/server5.ku-ds.crt" \ |
| 6598 | "$P_CLI debug_level=3" \ |
| 6599 | 0 \ |
| 6600 | -C "bad certificate (usage extensions)" \ |
| 6601 | -C "Processing of the Certificate handshake message failed" \ |
| 6602 | -c "Ciphersuite is" |
| 6603 | |
| 6604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6605 | requires_openssl_tls1_3 |
| 6606 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6607 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6608 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6609 | -cert data_files/server5.ku-ke.crt" \ |
| 6610 | "$P_CLI debug_level=1" \ |
| 6611 | 1 \ |
| 6612 | -c "bad certificate (usage extensions)" \ |
| 6613 | -c "Processing of the Certificate handshake message failed" \ |
| 6614 | -C "Ciphersuite is" |
| 6615 | |
| 6616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6617 | requires_openssl_tls1_3 |
| 6618 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6619 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6620 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6621 | -cert data_files/server5.ku-ka.crt" \ |
| 6622 | "$P_CLI debug_level=1" \ |
| 6623 | 1 \ |
| 6624 | -c "bad certificate (usage extensions)" \ |
| 6625 | -c "Processing of the Certificate handshake message failed" \ |
| 6626 | -C "Ciphersuite is" |
| 6627 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6628 | # Tests for keyUsage in leaf certificates, part 3: |
| 6629 | # server-side checking of client cert |
| 6630 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6632 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6633 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6634 | "$O_CLI -key data_files/server2.key \ |
| 6635 | -cert data_files/server2.ku-ds.crt" \ |
| 6636 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6637 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6638 | -S "bad certificate (usage extensions)" \ |
| 6639 | -S "Processing of the Certificate handshake message failed" |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6642 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6643 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6644 | "$O_CLI -key data_files/server2.key \ |
| 6645 | -cert data_files/server2.ku-ke.crt" \ |
| 6646 | 0 \ |
| 6647 | -s "bad certificate (usage extensions)" \ |
| 6648 | -S "Processing of the Certificate handshake message failed" |
| 6649 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6651 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6652 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6653 | "$O_CLI -key data_files/server2.key \ |
| 6654 | -cert data_files/server2.ku-ke.crt" \ |
| 6655 | 1 \ |
| 6656 | -s "bad certificate (usage extensions)" \ |
| 6657 | -s "Processing of the Certificate handshake message failed" |
| 6658 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6660 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6661 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6662 | "$O_CLI -key data_files/server5.key \ |
| 6663 | -cert data_files/server5.ku-ds.crt" \ |
| 6664 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6665 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6666 | -S "bad certificate (usage extensions)" \ |
| 6667 | -S "Processing of the Certificate handshake message failed" |
| 6668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6670 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6671 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6672 | "$O_CLI -key data_files/server5.key \ |
| 6673 | -cert data_files/server5.ku-ka.crt" \ |
| 6674 | 0 \ |
| 6675 | -s "bad certificate (usage extensions)" \ |
| 6676 | -S "Processing of the Certificate handshake message failed" |
| 6677 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6679 | requires_openssl_tls1_3 |
| 6680 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6681 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
| 6682 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6683 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6684 | -cert data_files/server2.ku-ds.crt" \ |
| 6685 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6686 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6687 | -S "bad certificate (usage extensions)" \ |
| 6688 | -S "Processing of the Certificate handshake message failed" |
| 6689 | |
| 6690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6691 | requires_openssl_tls1_3 |
| 6692 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6693 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 6694 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6695 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6696 | -cert data_files/server2.ku-ke.crt" \ |
| 6697 | 0 \ |
| 6698 | -s "bad certificate (usage extensions)" \ |
| 6699 | -S "Processing of the Certificate handshake message failed" |
| 6700 | |
| 6701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6702 | requires_openssl_tls1_3 |
| 6703 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6704 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
| 6705 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6706 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6707 | -cert data_files/server5.ku-ds.crt" \ |
| 6708 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6709 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6710 | -S "bad certificate (usage extensions)" \ |
| 6711 | -S "Processing of the Certificate handshake message failed" |
| 6712 | |
| 6713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6714 | requires_openssl_tls1_3 |
| 6715 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6716 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
| 6717 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6718 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6719 | -cert data_files/server5.ku-ka.crt" \ |
| 6720 | 0 \ |
| 6721 | -s "bad certificate (usage extensions)" \ |
| 6722 | -S "Processing of the Certificate handshake message failed" |
| 6723 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6724 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6725 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6727 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6728 | "$P_SRV key_file=data_files/server5.key \ |
| 6729 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6730 | "$P_CLI" \ |
| 6731 | 0 |
| 6732 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6734 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6735 | "$P_SRV key_file=data_files/server5.key \ |
| 6736 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6737 | "$P_CLI" \ |
| 6738 | 0 |
| 6739 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6741 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6742 | "$P_SRV key_file=data_files/server5.key \ |
| 6743 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6744 | "$P_CLI" \ |
| 6745 | 0 |
| 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 "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6749 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6750 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6751 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6752 | 1 |
| 6753 | |
| 6754 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 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 "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6758 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6759 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6760 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6761 | 0 \ |
| 6762 | -C "bad certificate (usage extensions)" \ |
| 6763 | -C "Processing of the Certificate handshake message failed" \ |
| 6764 | -c "Ciphersuite is TLS-" |
| 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 "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6768 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6769 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6770 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6771 | 0 \ |
| 6772 | -C "bad certificate (usage extensions)" \ |
| 6773 | -C "Processing of the Certificate handshake message failed" \ |
| 6774 | -c "Ciphersuite is TLS-" |
| 6775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6777 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6778 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6779 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6780 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6781 | 0 \ |
| 6782 | -C "bad certificate (usage extensions)" \ |
| 6783 | -C "Processing of the Certificate handshake message failed" \ |
| 6784 | -c "Ciphersuite is TLS-" |
| 6785 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6786 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6787 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6788 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6789 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6790 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6791 | 1 \ |
| 6792 | -c "bad certificate (usage extensions)" \ |
| 6793 | -c "Processing of the Certificate handshake message failed" \ |
| 6794 | -C "Ciphersuite is TLS-" |
| 6795 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6797 | requires_openssl_tls1_3 |
| 6798 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6799 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6800 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6801 | -cert data_files/server5.eku-srv.crt" \ |
| 6802 | "$P_CLI debug_level=1" \ |
| 6803 | 0 \ |
| 6804 | -C "bad certificate (usage extensions)" \ |
| 6805 | -C "Processing of the Certificate handshake message failed" \ |
| 6806 | -c "Ciphersuite is" |
| 6807 | |
| 6808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6809 | requires_openssl_tls1_3 |
| 6810 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6811 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6812 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6813 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6814 | "$P_CLI debug_level=1" \ |
| 6815 | 0 \ |
| 6816 | -C "bad certificate (usage extensions)" \ |
| 6817 | -C "Processing of the Certificate handshake message failed" \ |
| 6818 | -c "Ciphersuite is" |
| 6819 | |
| 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6821 | requires_openssl_tls1_3 |
| 6822 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6823 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6824 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6825 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6826 | "$P_CLI debug_level=1" \ |
| 6827 | 0 \ |
| 6828 | -C "bad certificate (usage extensions)" \ |
| 6829 | -C "Processing of the Certificate handshake message failed" \ |
| 6830 | -c "Ciphersuite is" |
| 6831 | |
| 6832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6833 | requires_openssl_tls1_3 |
| 6834 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6835 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6836 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6837 | -cert data_files/server5.eku-cs.crt" \ |
| 6838 | "$P_CLI debug_level=1" \ |
| 6839 | 1 \ |
| 6840 | -c "bad certificate (usage extensions)" \ |
| 6841 | -c "Processing of the Certificate handshake message failed" \ |
| 6842 | -C "Ciphersuite is" |
| 6843 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6844 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6845 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6847 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6848 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6849 | "$O_CLI -key data_files/server5.key \ |
| 6850 | -cert data_files/server5.eku-cli.crt" \ |
| 6851 | 0 \ |
| 6852 | -S "bad certificate (usage extensions)" \ |
| 6853 | -S "Processing of the Certificate handshake message failed" |
| 6854 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6856 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6857 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6858 | "$O_CLI -key data_files/server5.key \ |
| 6859 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6860 | 0 \ |
| 6861 | -S "bad certificate (usage extensions)" \ |
| 6862 | -S "Processing of the Certificate handshake message failed" |
| 6863 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6864 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6865 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6866 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6867 | "$O_CLI -key data_files/server5.key \ |
| 6868 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6869 | 0 \ |
| 6870 | -S "bad certificate (usage extensions)" \ |
| 6871 | -S "Processing of the Certificate handshake message failed" |
| 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-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6875 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6876 | "$O_CLI -key data_files/server5.key \ |
| 6877 | -cert data_files/server5.eku-cs.crt" \ |
| 6878 | 0 \ |
| 6879 | -s "bad certificate (usage extensions)" \ |
| 6880 | -S "Processing of the Certificate handshake message failed" |
| 6881 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6882 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6883 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6884 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6885 | "$O_CLI -key data_files/server5.key \ |
| 6886 | -cert data_files/server5.eku-cs.crt" \ |
| 6887 | 1 \ |
| 6888 | -s "bad certificate (usage extensions)" \ |
| 6889 | -s "Processing of the Certificate handshake message failed" |
| 6890 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6892 | requires_openssl_tls1_3 |
| 6893 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6894 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
| 6895 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6896 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6897 | -cert data_files/server5.eku-cli.crt" \ |
| 6898 | 0 \ |
| 6899 | -S "bad certificate (usage extensions)" \ |
| 6900 | -S "Processing of the Certificate handshake message failed" |
| 6901 | |
| 6902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6903 | requires_openssl_tls1_3 |
| 6904 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6905 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
| 6906 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6907 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6908 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6909 | 0 \ |
| 6910 | -S "bad certificate (usage extensions)" \ |
| 6911 | -S "Processing of the Certificate handshake message failed" |
| 6912 | |
| 6913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6914 | requires_openssl_tls1_3 |
| 6915 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6916 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
| 6917 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6918 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6919 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6920 | 0 \ |
| 6921 | -S "bad certificate (usage extensions)" \ |
| 6922 | -S "Processing of the Certificate handshake message failed" |
| 6923 | |
| 6924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6925 | requires_openssl_tls1_3 |
| 6926 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6927 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
| 6928 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6929 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6930 | -cert data_files/server5.eku-cs.crt" \ |
| 6931 | 0 \ |
| 6932 | -s "bad certificate (usage extensions)" \ |
| 6933 | -S "Processing of the Certificate handshake message failed" |
| 6934 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6935 | # Tests for DHM parameters loading |
| 6936 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6938 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6939 | "$P_SRV" \ |
| 6940 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6941 | debug_level=3" \ |
| 6942 | 0 \ |
| 6943 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6944 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6947 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6948 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6949 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6950 | debug_level=3" \ |
| 6951 | 0 \ |
| 6952 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6953 | -c "value of 'DHM: G ' (2 bits)" |
| 6954 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6955 | # Tests for DHM client-side size checking |
| 6956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6958 | run_test "DHM size: server default, client default, OK" \ |
| 6959 | "$P_SRV" \ |
| 6960 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6961 | debug_level=1" \ |
| 6962 | 0 \ |
| 6963 | -C "DHM prime too short:" |
| 6964 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6966 | run_test "DHM size: server default, client 2048, OK" \ |
| 6967 | "$P_SRV" \ |
| 6968 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6969 | debug_level=1 dhmlen=2048" \ |
| 6970 | 0 \ |
| 6971 | -C "DHM prime too short:" |
| 6972 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6974 | run_test "DHM size: server 1024, client default, OK" \ |
| 6975 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6976 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6977 | debug_level=1" \ |
| 6978 | 0 \ |
| 6979 | -C "DHM prime too short:" |
| 6980 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6981 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6982 | run_test "DHM size: server 999, client 999, OK" \ |
| 6983 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6984 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6985 | debug_level=1 dhmlen=999" \ |
| 6986 | 0 \ |
| 6987 | -C "DHM prime too short:" |
| 6988 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6990 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6991 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6992 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6993 | debug_level=1 dhmlen=1000" \ |
| 6994 | 0 \ |
| 6995 | -C "DHM prime too short:" |
| 6996 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6998 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6999 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7000 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7001 | debug_level=1" \ |
| 7002 | 1 \ |
| 7003 | -c "DHM prime too short:" |
| 7004 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7006 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7007 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7008 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7009 | debug_level=1 dhmlen=1001" \ |
| 7010 | 1 \ |
| 7011 | -c "DHM prime too short:" |
| 7012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7014 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7015 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7016 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7017 | debug_level=1 dhmlen=1000" \ |
| 7018 | 1 \ |
| 7019 | -c "DHM prime too short:" |
| 7020 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7022 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7023 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7024 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7025 | debug_level=1 dhmlen=999" \ |
| 7026 | 1 \ |
| 7027 | -c "DHM prime too short:" |
| 7028 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7030 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7031 | "$P_SRV" \ |
| 7032 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7033 | debug_level=1 dhmlen=2049" \ |
| 7034 | 1 \ |
| 7035 | -c "DHM prime too short:" |
| 7036 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7037 | # Tests for PSK callback |
| 7038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7040 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7041 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7042 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7043 | psk_identity=foo psk=abc123" \ |
| 7044 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7045 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7046 | -S "SSL - Unknown identity received" \ |
| 7047 | -S "SSL - Verification of the message MAC failed" |
| 7048 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7049 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7051 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7052 | "$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] | 7053 | "$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] | 7054 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7055 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7056 | -C "session hash for extended master secret"\ |
| 7057 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7058 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7059 | -S "SSL - Unknown identity received" \ |
| 7060 | -S "SSL - Verification of the message MAC failed" |
| 7061 | |
| 7062 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7064 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7065 | "$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] | 7066 | "$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] | 7067 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7068 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7069 | -C "session hash for extended master secret"\ |
| 7070 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7071 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7072 | -S "SSL - Unknown identity received" \ |
| 7073 | -S "SSL - Verification of the message MAC failed" |
| 7074 | |
| 7075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7077 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7078 | "$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] | 7079 | "$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] | 7080 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7081 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7082 | -c "session hash for extended master secret"\ |
| 7083 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7084 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7085 | -S "SSL - Unknown identity received" \ |
| 7086 | -S "SSL - Verification of the message MAC failed" |
| 7087 | |
| 7088 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7090 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7091 | "$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] | 7092 | "$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] | 7093 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7094 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7095 | -c "session hash for extended master secret"\ |
| 7096 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7097 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7098 | -S "SSL - Unknown identity received" \ |
| 7099 | -S "SSL - Verification of the message MAC failed" |
| 7100 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7101 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7103 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7104 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7105 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7106 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7107 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7108 | -C "session hash for extended master secret"\ |
| 7109 | -S "session hash for extended master secret"\ |
| 7110 | -S "SSL - The handshake negotiation failed" \ |
| 7111 | -S "SSL - Unknown identity received" \ |
| 7112 | -S "SSL - Verification of the message MAC failed" |
| 7113 | |
| 7114 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7115 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7116 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7117 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7118 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7119 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7120 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7121 | -C "session hash for extended master secret"\ |
| 7122 | -S "session hash for extended master secret"\ |
| 7123 | -S "SSL - The handshake negotiation failed" \ |
| 7124 | -S "SSL - Unknown identity received" \ |
| 7125 | -S "SSL - Verification of the message MAC failed" |
| 7126 | |
| 7127 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7129 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7130 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7131 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7132 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7133 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7134 | -c "session hash for extended master secret"\ |
| 7135 | -s "session hash for extended master secret"\ |
| 7136 | -S "SSL - The handshake negotiation failed" \ |
| 7137 | -S "SSL - Unknown identity received" \ |
| 7138 | -S "SSL - Verification of the message MAC failed" |
| 7139 | |
| 7140 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7142 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7143 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7144 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7145 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7146 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7147 | -c "session hash for extended master secret"\ |
| 7148 | -s "session hash for extended master secret"\ |
| 7149 | -S "SSL - The handshake negotiation failed" \ |
| 7150 | -S "SSL - Unknown identity received" \ |
| 7151 | -S "SSL - Verification of the message MAC failed" |
| 7152 | |
| 7153 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7155 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7156 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7157 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7158 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7159 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7160 | -C "session hash for extended master secret"\ |
| 7161 | -S "session hash for extended master secret"\ |
| 7162 | -S "SSL - The handshake negotiation failed" \ |
| 7163 | -S "SSL - Unknown identity received" \ |
| 7164 | -S "SSL - Verification of the message MAC failed" |
| 7165 | |
| 7166 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7168 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7169 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7170 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7171 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7172 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7173 | -C "session hash for extended master secret"\ |
| 7174 | -S "session hash for extended master secret"\ |
| 7175 | -S "SSL - The handshake negotiation failed" \ |
| 7176 | -S "SSL - Unknown identity received" \ |
| 7177 | -S "SSL - Verification of the message MAC failed" |
| 7178 | |
| 7179 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7181 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7182 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7183 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7184 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7185 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7186 | -c "session hash for extended master secret"\ |
| 7187 | -s "session hash for extended master secret"\ |
| 7188 | -S "SSL - The handshake negotiation failed" \ |
| 7189 | -S "SSL - Unknown identity received" \ |
| 7190 | -S "SSL - Verification of the message MAC failed" |
| 7191 | |
| 7192 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7194 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7195 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7196 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7197 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7198 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7199 | -c "session hash for extended master secret"\ |
| 7200 | -s "session hash for extended master secret"\ |
| 7201 | -S "SSL - The handshake negotiation failed" \ |
| 7202 | -S "SSL - Unknown identity received" \ |
| 7203 | -S "SSL - Verification of the message MAC failed" |
| 7204 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7205 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7207 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7208 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7209 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7210 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7211 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7212 | -C "session hash for extended master secret"\ |
| 7213 | -S "session hash for extended master secret"\ |
| 7214 | -S "SSL - The handshake negotiation failed" \ |
| 7215 | -S "SSL - Unknown identity received" \ |
| 7216 | -S "SSL - Verification of the message MAC failed" |
| 7217 | |
| 7218 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7220 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7221 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7222 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7223 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7224 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7225 | -C "session hash for extended master secret"\ |
| 7226 | -S "session hash for extended master secret"\ |
| 7227 | -S "SSL - The handshake negotiation failed" \ |
| 7228 | -S "SSL - Unknown identity received" \ |
| 7229 | -S "SSL - Verification of the message MAC failed" |
| 7230 | |
| 7231 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7233 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7234 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7235 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7236 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7237 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7238 | -c "session hash for extended master secret"\ |
| 7239 | -s "session hash for extended master secret"\ |
| 7240 | -S "SSL - The handshake negotiation failed" \ |
| 7241 | -S "SSL - Unknown identity received" \ |
| 7242 | -S "SSL - Verification of the message MAC failed" |
| 7243 | |
| 7244 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7246 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7247 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7248 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7249 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7250 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7251 | -c "session hash for extended master secret"\ |
| 7252 | -s "session hash for extended master secret"\ |
| 7253 | -S "SSL - The handshake negotiation failed" \ |
| 7254 | -S "SSL - Unknown identity received" \ |
| 7255 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7256 | |
| 7257 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7259 | 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] | 7260 | "$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" \ |
| 7261 | "$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] | 7262 | psk_identity=foo psk=abc123" \ |
| 7263 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7264 | -C "session hash for extended master secret"\ |
| 7265 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7266 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7267 | -S "SSL - Unknown identity received" \ |
| 7268 | -S "SSL - Verification of the message MAC failed" |
| 7269 | |
| 7270 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7272 | 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] | 7273 | "$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" \ |
| 7274 | "$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] | 7275 | psk_identity=foo psk=abc123" \ |
| 7276 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7277 | -C "session hash for extended master secret"\ |
| 7278 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7279 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7280 | -S "SSL - Unknown identity received" \ |
| 7281 | -S "SSL - Verification of the message MAC failed" |
| 7282 | |
| 7283 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7285 | 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] | 7286 | "$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] | 7287 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7288 | "$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] | 7289 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7290 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7291 | -c "session hash for extended master secret"\ |
| 7292 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7293 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7294 | -S "SSL - Unknown identity received" \ |
| 7295 | -S "SSL - Verification of the message MAC failed" |
| 7296 | |
| 7297 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7299 | 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] | 7300 | "$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] | 7301 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7302 | "$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] | 7303 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7304 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7305 | -c "session hash for extended master secret"\ |
| 7306 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7307 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7308 | -S "SSL - Unknown identity received" \ |
| 7309 | -S "SSL - Verification of the message MAC failed" |
| 7310 | |
| 7311 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7313 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7314 | "$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" \ |
| 7315 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7316 | psk_identity=foo psk=abc123" \ |
| 7317 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7318 | -C "session hash for extended master secret"\ |
| 7319 | -S "session hash for extended master secret"\ |
| 7320 | -S "SSL - The handshake negotiation failed" \ |
| 7321 | -S "SSL - Unknown identity received" \ |
| 7322 | -S "SSL - Verification of the message MAC failed" |
| 7323 | |
| 7324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7326 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7327 | "$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" \ |
| 7328 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7329 | psk_identity=foo psk=abc123" \ |
| 7330 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7331 | -C "session hash for extended master secret"\ |
| 7332 | -S "session hash for extended master secret"\ |
| 7333 | -S "SSL - The handshake negotiation failed" \ |
| 7334 | -S "SSL - Unknown identity received" \ |
| 7335 | -S "SSL - Verification of the message MAC failed" |
| 7336 | |
| 7337 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7339 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7340 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7341 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7342 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7343 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7344 | 0 \ |
| 7345 | -c "session hash for extended master secret"\ |
| 7346 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7347 | -S "SSL - The handshake negotiation failed" \ |
| 7348 | -S "SSL - Unknown identity received" \ |
| 7349 | -S "SSL - Verification of the message MAC failed" |
| 7350 | |
| 7351 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7353 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7354 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7355 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7356 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7357 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7358 | 0 \ |
| 7359 | -c "session hash for extended master secret"\ |
| 7360 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7361 | -S "SSL - The handshake negotiation failed" \ |
| 7362 | -S "SSL - Unknown identity received" \ |
| 7363 | -S "SSL - Verification of the message MAC failed" |
| 7364 | |
| 7365 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7367 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7368 | "$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" \ |
| 7369 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7370 | psk_identity=foo psk=abc123" \ |
| 7371 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7372 | -C "session hash for extended master secret"\ |
| 7373 | -S "session hash for extended master secret"\ |
| 7374 | -S "SSL - The handshake negotiation failed" \ |
| 7375 | -S "SSL - Unknown identity received" \ |
| 7376 | -S "SSL - Verification of the message MAC failed" |
| 7377 | |
| 7378 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7380 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7381 | "$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" \ |
| 7382 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7383 | psk_identity=foo psk=abc123" \ |
| 7384 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7385 | -C "session hash for extended master secret"\ |
| 7386 | -S "session hash for extended master secret"\ |
| 7387 | -S "SSL - The handshake negotiation failed" \ |
| 7388 | -S "SSL - Unknown identity received" \ |
| 7389 | -S "SSL - Verification of the message MAC failed" |
| 7390 | |
| 7391 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7393 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7394 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7395 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7396 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7397 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7398 | 0 \ |
| 7399 | -c "session hash for extended master secret"\ |
| 7400 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7401 | -S "SSL - The handshake negotiation failed" \ |
| 7402 | -S "SSL - Unknown identity received" \ |
| 7403 | -S "SSL - Verification of the message MAC failed" |
| 7404 | |
| 7405 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7407 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7408 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7409 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7410 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7411 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7412 | 0 \ |
| 7413 | -c "session hash for extended master secret"\ |
| 7414 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7415 | -S "SSL - The handshake negotiation failed" \ |
| 7416 | -S "SSL - Unknown identity received" \ |
| 7417 | -S "SSL - Verification of the message MAC failed" |
| 7418 | |
| 7419 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7421 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7422 | "$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" \ |
| 7423 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7424 | psk_identity=foo psk=abc123" \ |
| 7425 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7426 | -C "session hash for extended master secret"\ |
| 7427 | -S "session hash for extended master secret"\ |
| 7428 | -S "SSL - The handshake negotiation failed" \ |
| 7429 | -S "SSL - Unknown identity received" \ |
| 7430 | -S "SSL - Verification of the message MAC failed" |
| 7431 | |
| 7432 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7434 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7435 | "$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" \ |
| 7436 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7437 | psk_identity=foo psk=abc123" \ |
| 7438 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7439 | -C "session hash for extended master secret"\ |
| 7440 | -S "session hash for extended master secret"\ |
| 7441 | -S "SSL - The handshake negotiation failed" \ |
| 7442 | -S "SSL - Unknown identity received" \ |
| 7443 | -S "SSL - Verification of the message MAC failed" |
| 7444 | |
| 7445 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7447 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7448 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7449 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7450 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7451 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7452 | 0 \ |
| 7453 | -c "session hash for extended master secret"\ |
| 7454 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7455 | -S "SSL - The handshake negotiation failed" \ |
| 7456 | -S "SSL - Unknown identity received" \ |
| 7457 | -S "SSL - Verification of the message MAC failed" |
| 7458 | |
| 7459 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7461 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7462 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7463 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7464 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7465 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7466 | 0 \ |
| 7467 | -c "session hash for extended master secret"\ |
| 7468 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7469 | -S "SSL - The handshake negotiation failed" \ |
| 7470 | -S "SSL - Unknown identity received" \ |
| 7471 | -S "SSL - Verification of the message MAC failed" |
| 7472 | |
| 7473 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7475 | 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] | 7476 | "$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" \ |
| 7477 | "$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] | 7478 | psk_identity=def psk=beef" \ |
| 7479 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7480 | -C "session hash for extended master secret"\ |
| 7481 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7482 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7483 | -S "SSL - Unknown identity received" \ |
| 7484 | -S "SSL - Verification of the message MAC failed" |
| 7485 | |
| 7486 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7488 | 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] | 7489 | "$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" \ |
| 7490 | "$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] | 7491 | psk_identity=def psk=beef" \ |
| 7492 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7493 | -C "session hash for extended master secret"\ |
| 7494 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7495 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7496 | -S "SSL - Unknown identity received" \ |
| 7497 | -S "SSL - Verification of the message MAC failed" |
| 7498 | |
| 7499 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7501 | 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] | 7502 | "$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] | 7503 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7504 | "$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] | 7505 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7506 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7507 | -c "session hash for extended master secret"\ |
| 7508 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7509 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7510 | -S "SSL - Unknown identity received" \ |
| 7511 | -S "SSL - Verification of the message MAC failed" |
| 7512 | |
| 7513 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7515 | 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] | 7516 | "$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] | 7517 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7518 | "$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] | 7519 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7520 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7521 | -c "session hash for extended master secret"\ |
| 7522 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7523 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7524 | -S "SSL - Unknown identity received" \ |
| 7525 | -S "SSL - Verification of the message MAC failed" |
| 7526 | |
| 7527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7529 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7530 | "$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" \ |
| 7531 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7532 | psk_identity=def psk=beef" \ |
| 7533 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7534 | -C "session hash for extended master secret"\ |
| 7535 | -S "session hash for extended master secret"\ |
| 7536 | -S "SSL - The handshake negotiation failed" \ |
| 7537 | -S "SSL - Unknown identity received" \ |
| 7538 | -S "SSL - Verification of the message MAC failed" |
| 7539 | |
| 7540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7542 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7543 | "$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" \ |
| 7544 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7545 | psk_identity=def psk=beef" \ |
| 7546 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7547 | -C "session hash for extended master secret"\ |
| 7548 | -S "session hash for extended master secret"\ |
| 7549 | -S "SSL - The handshake negotiation failed" \ |
| 7550 | -S "SSL - Unknown identity received" \ |
| 7551 | -S "SSL - Verification of the message MAC failed" |
| 7552 | |
| 7553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7555 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7556 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7557 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7558 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7559 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7560 | 0 \ |
| 7561 | -c "session hash for extended master secret"\ |
| 7562 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7563 | -S "SSL - The handshake negotiation failed" \ |
| 7564 | -S "SSL - Unknown identity received" \ |
| 7565 | -S "SSL - Verification of the message MAC failed" |
| 7566 | |
| 7567 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7569 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7570 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7571 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7572 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7573 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7574 | 0 \ |
| 7575 | -c "session hash for extended master secret"\ |
| 7576 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7577 | -S "SSL - The handshake negotiation failed" \ |
| 7578 | -S "SSL - Unknown identity received" \ |
| 7579 | -S "SSL - Verification of the message MAC failed" |
| 7580 | |
| 7581 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7583 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7584 | "$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" \ |
| 7585 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7586 | psk_identity=def psk=beef" \ |
| 7587 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7588 | -C "session hash for extended master secret"\ |
| 7589 | -S "session hash for extended master secret"\ |
| 7590 | -S "SSL - The handshake negotiation failed" \ |
| 7591 | -S "SSL - Unknown identity received" \ |
| 7592 | -S "SSL - Verification of the message MAC failed" |
| 7593 | |
| 7594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7596 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7597 | "$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" \ |
| 7598 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7599 | psk_identity=def psk=beef" \ |
| 7600 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7601 | -C "session hash for extended master secret"\ |
| 7602 | -S "session hash for extended master secret"\ |
| 7603 | -S "SSL - The handshake negotiation failed" \ |
| 7604 | -S "SSL - Unknown identity received" \ |
| 7605 | -S "SSL - Verification of the message MAC failed" |
| 7606 | |
| 7607 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7609 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7610 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7611 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7612 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7613 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7614 | 0 \ |
| 7615 | -c "session hash for extended master secret"\ |
| 7616 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7617 | -S "SSL - The handshake negotiation failed" \ |
| 7618 | -S "SSL - Unknown identity received" \ |
| 7619 | -S "SSL - Verification of the message MAC failed" |
| 7620 | |
| 7621 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7622 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7623 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7624 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7625 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7626 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7627 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7628 | 0 \ |
| 7629 | -c "session hash for extended master secret"\ |
| 7630 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7631 | -S "SSL - The handshake negotiation failed" \ |
| 7632 | -S "SSL - Unknown identity received" \ |
| 7633 | -S "SSL - Verification of the message MAC failed" |
| 7634 | |
| 7635 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7637 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7638 | "$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" \ |
| 7639 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7640 | psk_identity=def psk=beef" \ |
| 7641 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7642 | -C "session hash for extended master secret"\ |
| 7643 | -S "session hash for extended master secret"\ |
| 7644 | -S "SSL - The handshake negotiation failed" \ |
| 7645 | -S "SSL - Unknown identity received" \ |
| 7646 | -S "SSL - Verification of the message MAC failed" |
| 7647 | |
| 7648 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7650 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7651 | "$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" \ |
| 7652 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7653 | psk_identity=def psk=beef" \ |
| 7654 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7655 | -C "session hash for extended master secret"\ |
| 7656 | -S "session hash for extended master secret"\ |
| 7657 | -S "SSL - The handshake negotiation failed" \ |
| 7658 | -S "SSL - Unknown identity received" \ |
| 7659 | -S "SSL - Verification of the message MAC failed" |
| 7660 | |
| 7661 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7663 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7664 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7665 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7666 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7667 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7668 | 0 \ |
| 7669 | -c "session hash for extended master secret"\ |
| 7670 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7671 | -S "SSL - The handshake negotiation failed" \ |
| 7672 | -S "SSL - Unknown identity received" \ |
| 7673 | -S "SSL - Verification of the message MAC failed" |
| 7674 | |
| 7675 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7677 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7678 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7679 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7680 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7681 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7682 | 0 \ |
| 7683 | -c "session hash for extended master secret"\ |
| 7684 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7685 | -S "SSL - The handshake negotiation failed" \ |
| 7686 | -S "SSL - Unknown identity received" \ |
| 7687 | -S "SSL - Verification of the message MAC failed" |
| 7688 | |
| 7689 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7691 | 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] | 7692 | "$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" \ |
| 7693 | "$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] | 7694 | psk_identity=def psk=beef" \ |
| 7695 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7696 | -C "session hash for extended master secret"\ |
| 7697 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7698 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7699 | -S "SSL - Unknown identity received" \ |
| 7700 | -S "SSL - Verification of the message MAC failed" |
| 7701 | |
| 7702 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7704 | 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] | 7705 | "$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" \ |
| 7706 | "$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] | 7707 | psk_identity=def psk=beef" \ |
| 7708 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7709 | -C "session hash for extended master secret"\ |
| 7710 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7711 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7712 | -S "SSL - Unknown identity received" \ |
| 7713 | -S "SSL - Verification of the message MAC failed" |
| 7714 | |
| 7715 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7717 | 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] | 7718 | "$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" \ |
| 7719 | "$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] | 7720 | psk_identity=def psk=beef" \ |
| 7721 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7722 | -C "session hash for extended master secret"\ |
| 7723 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7724 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7725 | -S "SSL - Unknown identity received" \ |
| 7726 | -S "SSL - Verification of the message MAC failed" |
| 7727 | |
| 7728 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7730 | 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] | 7731 | "$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" \ |
| 7732 | "$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] | 7733 | psk_identity=def psk=beef" \ |
| 7734 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7735 | -C "session hash for extended master secret"\ |
| 7736 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7737 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7738 | -S "SSL - Unknown identity received" \ |
| 7739 | -S "SSL - Verification of the message MAC failed" |
| 7740 | |
| 7741 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7743 | 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] | 7744 | "$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" \ |
| 7745 | "$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] | 7746 | psk_identity=def psk=beef" \ |
| 7747 | 1 \ |
| 7748 | -s "SSL - Verification of the message MAC failed" |
| 7749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7751 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7752 | "$P_SRV" \ |
| 7753 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7754 | psk_identity=foo psk=abc123" \ |
| 7755 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7756 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7757 | -S "SSL - Unknown identity received" \ |
| 7758 | -S "SSL - Verification of the message MAC failed" |
| 7759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7761 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7762 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7763 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7764 | psk_identity=foo psk=abc123" \ |
| 7765 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7766 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7767 | -s "SSL - Unknown identity received" \ |
| 7768 | -S "SSL - Verification of the message MAC failed" |
| 7769 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7771 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7772 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7773 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7774 | psk_identity=abc psk=dead" \ |
| 7775 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7776 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7777 | -S "SSL - Unknown identity received" \ |
| 7778 | -S "SSL - Verification of the message MAC failed" |
| 7779 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7781 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7782 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7783 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7784 | psk_identity=def psk=beef" \ |
| 7785 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7786 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7787 | -S "SSL - Unknown identity received" \ |
| 7788 | -S "SSL - Verification of the message MAC failed" |
| 7789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7791 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7792 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7793 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7794 | psk_identity=ghi psk=beef" \ |
| 7795 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7796 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7797 | -s "SSL - Unknown identity received" \ |
| 7798 | -S "SSL - Verification of the message MAC failed" |
| 7799 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7801 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7802 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7803 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7804 | psk_identity=abc psk=beef" \ |
| 7805 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7806 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7807 | -S "SSL - Unknown identity received" \ |
| 7808 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7809 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7810 | # Tests for EC J-PAKE |
| 7811 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7812 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7814 | run_test "ECJPAKE: client not configured" \ |
| 7815 | "$P_SRV debug_level=3" \ |
| 7816 | "$P_CLI debug_level=3" \ |
| 7817 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7818 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7819 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7820 | -S "found ecjpake kkpp extension" \ |
| 7821 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7822 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7823 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7824 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7825 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7826 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7827 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7829 | run_test "ECJPAKE: server not configured" \ |
| 7830 | "$P_SRV debug_level=3" \ |
| 7831 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7832 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7833 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7834 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7835 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7836 | -s "found ecjpake kkpp extension" \ |
| 7837 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7838 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7839 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7840 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7841 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7842 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7843 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7845 | run_test "ECJPAKE: working, TLS" \ |
| 7846 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7847 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7848 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7849 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7850 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7851 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7852 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7853 | -s "found ecjpake kkpp extension" \ |
| 7854 | -S "skip ecjpake kkpp extension" \ |
| 7855 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7856 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7857 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7858 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7859 | -S "SSL - Verification of the message MAC failed" |
| 7860 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7861 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7862 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7864 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7865 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7866 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7867 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7868 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7869 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7870 | -s "SSL - Verification of the message MAC failed" |
| 7871 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7872 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7874 | run_test "ECJPAKE: working, DTLS" \ |
| 7875 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7876 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7877 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7878 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7879 | -c "re-using cached ecjpake parameters" \ |
| 7880 | -S "SSL - Verification of the message MAC failed" |
| 7881 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7882 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7884 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7885 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7886 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7887 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7888 | 0 \ |
| 7889 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7890 | -S "SSL - Verification of the message MAC failed" |
| 7891 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7892 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7893 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7895 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 7896 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7897 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 7898 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7899 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7900 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7901 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7902 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7903 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7904 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7906 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 7907 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 7908 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 7909 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7910 | 0 |
| 7911 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 7912 | # Test for ClientHello without extensions |
| 7913 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 7914 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 7916 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 7917 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7918 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 7919 | 0 \ |
| 7920 | -s "dumping 'client hello extensions' (0 bytes)" |
| 7921 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7922 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7923 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7924 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
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 | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7926 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7927 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7928 | "$P_CLI request_size=100" \ |
| 7929 | 0 \ |
| 7930 | -s "Read from client: 100 bytes read$" |
| 7931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7933 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 7934 | "$P_SRV buffer_size=100" \ |
| 7935 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7936 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7937 | -s "Read from client: 101 bytes read (100 + 1)" |
| 7938 | |
| 7939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7940 | requires_max_content_len 200 |
| 7941 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 7942 | "$P_SRV buffer_size=100" \ |
| 7943 | "$P_CLI request_size=200" \ |
| 7944 | 0 \ |
| 7945 | -s "Read from client: 200 bytes read (100 + 100)" |
| 7946 | |
| 7947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7948 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 7949 | "$P_SRV buffer_size=100" \ |
| 7950 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 7951 | 0 \ |
| 7952 | -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] | 7953 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7954 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7955 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7956 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7957 | "$P_SRV force_version=tls12" \ |
| 7958 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7960 | 0 \ |
| 7961 | -s "Read from client: 1 bytes read" |
| 7962 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7963 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7964 | "$P_SRV force_version=tls12" \ |
| 7965 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7966 | 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] | 7967 | 0 \ |
| 7968 | -s "Read from client: 1 bytes read" |
| 7969 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7970 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7971 | "$P_SRV force_version=tls12" \ |
| 7972 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7973 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7974 | 0 \ |
| 7975 | -s "Read from client: 1 bytes read" |
| 7976 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7977 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7978 | "$P_SRV force_version=tls12" \ |
| 7979 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7980 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7981 | 0 \ |
| 7982 | -s "Read from client: 1 bytes read" |
| 7983 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7984 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7985 | "$P_SRV force_version=tls12" \ |
| 7986 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7987 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7988 | 0 \ |
| 7989 | -s "Read from client: 1 bytes read" |
| 7990 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 7991 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 7992 | "$P_SRV force_version=tls13" \ |
| 7993 | "$P_CLI request_size=1 \ |
| 7994 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 7995 | 0 \ |
| 7996 | -s "Read from client: 1 bytes read" |
| 7997 | |
| 7998 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 7999 | "$P_SRV force_version=tls13" \ |
| 8000 | "$P_CLI request_size=1 \ |
| 8001 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8002 | 0 \ |
| 8003 | -s "Read from client: 1 bytes read" |
| 8004 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8005 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8006 | |
| 8007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8008 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8009 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8010 | "$P_CLI dtls=1 request_size=1 \ |
| 8011 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8012 | 0 \ |
| 8013 | -s "Read from client: 1 bytes read" |
| 8014 | |
| 8015 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8016 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8017 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8018 | "$P_CLI dtls=1 request_size=1 \ |
| 8019 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8020 | 0 \ |
| 8021 | -s "Read from client: 1 bytes read" |
| 8022 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8023 | # Tests for small server packets |
| 8024 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8025 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8026 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8027 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8028 | 0 \ |
| 8029 | -c "Read from server: 1 bytes read" |
| 8030 | |
| 8031 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8032 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8033 | "$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] | 8034 | 0 \ |
| 8035 | -c "Read from server: 1 bytes read" |
| 8036 | |
| 8037 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8038 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8039 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8040 | 0 \ |
| 8041 | -c "Read from server: 1 bytes read" |
| 8042 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8043 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8044 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8045 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8046 | 0 \ |
| 8047 | -c "Read from server: 1 bytes read" |
| 8048 | |
| 8049 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8050 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8051 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8052 | 0 \ |
| 8053 | -c "Read from server: 1 bytes read" |
| 8054 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8055 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8056 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8057 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8058 | 0 \ |
| 8059 | -c "Read from server: 1 bytes read" |
| 8060 | |
| 8061 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8062 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8063 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8064 | 0 \ |
| 8065 | -c "Read from server: 1 bytes read" |
| 8066 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8067 | # Tests for small server packets in DTLS |
| 8068 | |
| 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8070 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8071 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8072 | "$P_CLI dtls=1 \ |
| 8073 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8074 | 0 \ |
| 8075 | -c "Read from server: 1 bytes read" |
| 8076 | |
| 8077 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8078 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8079 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8080 | "$P_CLI dtls=1 \ |
| 8081 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8082 | 0 \ |
| 8083 | -c "Read from server: 1 bytes read" |
| 8084 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8085 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8086 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8087 | # How many fragments do we expect to write $1 bytes? |
| 8088 | fragments_for_write() { |
| 8089 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8090 | } |
| 8091 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8092 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8093 | "$P_SRV force_version=tls12" \ |
| 8094 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8095 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8096 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8097 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8098 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8099 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8100 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8101 | "$P_SRV force_version=tls12" \ |
| 8102 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8103 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8104 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8105 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8106 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8107 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8108 | "$P_SRV force_version=tls12" \ |
| 8109 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8110 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8111 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8112 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8113 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8114 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8115 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8116 | "$P_SRV force_version=tls12" \ |
| 8117 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8119 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8120 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8121 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8122 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8123 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8124 | "$P_SRV force_version=tls12" \ |
| 8125 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8126 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8127 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8128 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8129 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8130 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8131 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8132 | "$P_SRV force_version=tls13" \ |
| 8133 | "$P_CLI request_size=16384 \ |
| 8134 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8135 | 0 \ |
| 8136 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8137 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8138 | |
| 8139 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8140 | "$P_SRV force_version=tls13" \ |
| 8141 | "$P_CLI request_size=16384 \ |
| 8142 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8143 | 0 \ |
| 8144 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8145 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8146 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8147 | # 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] | 8148 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8149 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8150 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8151 | 0 \ |
| 8152 | -c "Read from server: 16384 bytes read" |
| 8153 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8154 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8155 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8156 | "$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] | 8157 | 0 \ |
| 8158 | -s "16384 bytes written in 1 fragments" \ |
| 8159 | -c "Read from server: 16384 bytes read" |
| 8160 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8161 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8162 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8163 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8164 | 0 \ |
| 8165 | -c "Read from server: 16384 bytes read" |
| 8166 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8167 | 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] | 8168 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8169 | "$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] | 8170 | 0 \ |
| 8171 | -s "16384 bytes written in 1 fragments" \ |
| 8172 | -c "Read from server: 16384 bytes read" |
| 8173 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8174 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8175 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8176 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8177 | 0 \ |
| 8178 | -c "Read from server: 16384 bytes read" |
| 8179 | |
| 8180 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8181 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8182 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8183 | 0 \ |
| 8184 | -c "Read from server: 16384 bytes read" |
| 8185 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8186 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8187 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8188 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8189 | 0 \ |
| 8190 | -c "Read from server: 16384 bytes read" |
| 8191 | |
| 8192 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8193 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8194 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8195 | 0 \ |
| 8196 | -c "Read from server: 16384 bytes read" |
| 8197 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8198 | # Tests for restartable ECC |
| 8199 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8200 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8201 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8202 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8203 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8205 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8206 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8207 | "$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] | 8208 | 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] | 8209 | debug_level=1" \ |
| 8210 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8211 | -C "x509_verify_cert.*4b00" \ |
| 8212 | -C "mbedtls_pk_verify.*4b00" \ |
| 8213 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8214 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8215 | |
| 8216 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8217 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8219 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8220 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8221 | "$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] | 8222 | 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] | 8223 | debug_level=1 ec_max_ops=0" \ |
| 8224 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8225 | -C "x509_verify_cert.*4b00" \ |
| 8226 | -C "mbedtls_pk_verify.*4b00" \ |
| 8227 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8228 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8229 | |
| 8230 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8231 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8233 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8234 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8235 | "$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] | 8236 | 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] | 8237 | debug_level=1 ec_max_ops=65535" \ |
| 8238 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8239 | -C "x509_verify_cert.*4b00" \ |
| 8240 | -C "mbedtls_pk_verify.*4b00" \ |
| 8241 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8242 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8243 | |
| 8244 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8245 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8247 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8248 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8249 | "$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] | 8250 | 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] | 8251 | debug_level=1 ec_max_ops=1000" \ |
| 8252 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8253 | -c "x509_verify_cert.*4b00" \ |
| 8254 | -c "mbedtls_pk_verify.*4b00" \ |
| 8255 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8256 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8257 | |
| 8258 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8259 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8261 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8262 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8263 | crt_file=data_files/server5-badsign.crt \ |
| 8264 | key_file=data_files/server5.key" \ |
| 8265 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8266 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8267 | debug_level=1 ec_max_ops=1000" \ |
| 8268 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8269 | -c "x509_verify_cert.*4b00" \ |
| 8270 | -C "mbedtls_pk_verify.*4b00" \ |
| 8271 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8272 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8273 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8274 | -c "! mbedtls_ssl_handshake returned" \ |
| 8275 | -c "X509 - Certificate verification failed" |
| 8276 | |
| 8277 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8278 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8280 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8281 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8282 | crt_file=data_files/server5-badsign.crt \ |
| 8283 | key_file=data_files/server5.key" \ |
| 8284 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8285 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8286 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8287 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8288 | -c "x509_verify_cert.*4b00" \ |
| 8289 | -c "mbedtls_pk_verify.*4b00" \ |
| 8290 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8291 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8292 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8293 | -C "! mbedtls_ssl_handshake returned" \ |
| 8294 | -C "X509 - Certificate verification failed" |
| 8295 | |
| 8296 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8297 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8299 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8300 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8301 | crt_file=data_files/server5-badsign.crt \ |
| 8302 | key_file=data_files/server5.key" \ |
| 8303 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8304 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8305 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8306 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8307 | -C "x509_verify_cert.*4b00" \ |
| 8308 | -c "mbedtls_pk_verify.*4b00" \ |
| 8309 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8310 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8311 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8312 | -C "! mbedtls_ssl_handshake returned" \ |
| 8313 | -C "X509 - Certificate verification failed" |
| 8314 | |
| 8315 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8316 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8318 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8319 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8320 | "$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] | 8321 | 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] | 8322 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8323 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8324 | -c "x509_verify_cert.*4b00" \ |
| 8325 | -c "mbedtls_pk_verify.*4b00" \ |
| 8326 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8327 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8328 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8329 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8330 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8332 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8333 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8334 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8335 | debug_level=1 ec_max_ops=1000" \ |
| 8336 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8337 | -c "x509_verify_cert.*4b00" \ |
| 8338 | -c "mbedtls_pk_verify.*4b00" \ |
| 8339 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8340 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8341 | |
| 8342 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8343 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8345 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8346 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8347 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 8348 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 8349 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8350 | -C "x509_verify_cert.*4b00" \ |
| 8351 | -C "mbedtls_pk_verify.*4b00" \ |
| 8352 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8353 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8354 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8355 | # Tests of asynchronous private key support in SSL |
| 8356 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8357 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8359 | run_test "SSL async private: sign, delay=0" \ |
| 8360 | "$P_SRV \ |
| 8361 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8362 | "$P_CLI" \ |
| 8363 | 0 \ |
| 8364 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8365 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8366 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8367 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8369 | run_test "SSL async private: sign, delay=1" \ |
| 8370 | "$P_SRV \ |
| 8371 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8372 | "$P_CLI" \ |
| 8373 | 0 \ |
| 8374 | -s "Async sign callback: using key slot " \ |
| 8375 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8376 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8377 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8378 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8380 | run_test "SSL async private: sign, delay=2" \ |
| 8381 | "$P_SRV \ |
| 8382 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8383 | "$P_CLI" \ |
| 8384 | 0 \ |
| 8385 | -s "Async sign callback: using key slot " \ |
| 8386 | -U "Async sign callback: using key slot " \ |
| 8387 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8388 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8389 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8390 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8391 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8392 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8394 | run_test "SSL async private: sign, SNI" \ |
| 8395 | "$P_SRV debug_level=3 \ |
| 8396 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8397 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8398 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8399 | "$P_CLI server_name=polarssl.example" \ |
| 8400 | 0 \ |
| 8401 | -s "Async sign callback: using key slot " \ |
| 8402 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8403 | -s "parse ServerName extension" \ |
| 8404 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8405 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8406 | |
| 8407 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8409 | run_test "SSL async private: decrypt, delay=0" \ |
| 8410 | "$P_SRV \ |
| 8411 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8412 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8413 | 0 \ |
| 8414 | -s "Async decrypt callback: using key slot " \ |
| 8415 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8416 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8417 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8419 | run_test "SSL async private: decrypt, delay=1" \ |
| 8420 | "$P_SRV \ |
| 8421 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8422 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8423 | 0 \ |
| 8424 | -s "Async decrypt callback: using key slot " \ |
| 8425 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8426 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8427 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8428 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8430 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8431 | "$P_SRV psk=abc123 \ |
| 8432 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8433 | "$P_CLI psk=abc123 \ |
| 8434 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8435 | 0 \ |
| 8436 | -s "Async decrypt callback: using key slot " \ |
| 8437 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8438 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8439 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8440 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8441 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8442 | "$P_SRV psk=abc123 \ |
| 8443 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8444 | "$P_CLI psk=abc123 \ |
| 8445 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8446 | 0 \ |
| 8447 | -s "Async decrypt callback: using key slot " \ |
| 8448 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8449 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8450 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8451 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8453 | run_test "SSL async private: sign callback not present" \ |
| 8454 | "$P_SRV \ |
| 8455 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8456 | "$P_CLI; [ \$? -eq 1 ] && |
| 8457 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8458 | 0 \ |
| 8459 | -S "Async sign callback" \ |
| 8460 | -s "! mbedtls_ssl_handshake returned" \ |
| 8461 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8462 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8463 | -s "Successful connection" |
| 8464 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8465 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8467 | run_test "SSL async private: decrypt callback not present" \ |
| 8468 | "$P_SRV debug_level=1 \ |
| 8469 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8470 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8471 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8472 | 0 \ |
| 8473 | -S "Async decrypt callback" \ |
| 8474 | -s "! mbedtls_ssl_handshake returned" \ |
| 8475 | -s "got no RSA private key" \ |
| 8476 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8477 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8478 | |
| 8479 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8482 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8483 | "$P_SRV \ |
| 8484 | async_operations=s async_private_delay1=1 \ |
| 8485 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8486 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8487 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8488 | 0 \ |
| 8489 | -s "Async sign callback: using key slot 0," \ |
| 8490 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8491 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8492 | |
| 8493 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8494 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8496 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8497 | "$P_SRV \ |
| 8498 | async_operations=s async_private_delay2=1 \ |
| 8499 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8500 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8501 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8502 | 0 \ |
| 8503 | -s "Async sign callback: using key slot 0," \ |
| 8504 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8505 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8506 | |
| 8507 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8510 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8511 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8512 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8513 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8514 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8515 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8516 | 0 \ |
| 8517 | -s "Async sign callback: using key slot 1," \ |
| 8518 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8519 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8520 | |
| 8521 | # key1: ECDSA, key2: RSA; use key2 directly |
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 | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8524 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8525 | "$P_SRV \ |
| 8526 | async_operations=s async_private_delay1=1 \ |
| 8527 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8528 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8529 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8530 | 0 \ |
| 8531 | -s "Async sign callback: no key matches this certificate." |
| 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 | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8535 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8536 | "$P_SRV \ |
| 8537 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8538 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8539 | "$P_CLI" \ |
| 8540 | 1 \ |
| 8541 | -s "Async sign callback: injected error" \ |
| 8542 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8543 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8544 | -s "! mbedtls_ssl_handshake returned" |
| 8545 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8546 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8548 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8549 | "$P_SRV \ |
| 8550 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8551 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8552 | "$P_CLI" \ |
| 8553 | 1 \ |
| 8554 | -s "Async sign callback: using key slot " \ |
| 8555 | -S "Async resume" \ |
| 8556 | -s "Async cancel" |
| 8557 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8558 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8560 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8561 | "$P_SRV \ |
| 8562 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8563 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8564 | "$P_CLI" \ |
| 8565 | 1 \ |
| 8566 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8567 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8568 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8569 | -s "! mbedtls_ssl_handshake returned" |
| 8570 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8571 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8573 | run_test "SSL async private: decrypt, error in start" \ |
| 8574 | "$P_SRV \ |
| 8575 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8576 | async_private_error=1" \ |
| 8577 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8578 | 1 \ |
| 8579 | -s "Async decrypt callback: injected error" \ |
| 8580 | -S "Async resume" \ |
| 8581 | -S "Async cancel" \ |
| 8582 | -s "! mbedtls_ssl_handshake returned" |
| 8583 | |
| 8584 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8586 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8587 | "$P_SRV \ |
| 8588 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8589 | async_private_error=2" \ |
| 8590 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8591 | 1 \ |
| 8592 | -s "Async decrypt callback: using key slot " \ |
| 8593 | -S "Async resume" \ |
| 8594 | -s "Async cancel" |
| 8595 | |
| 8596 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8598 | run_test "SSL async private: decrypt, error in resume" \ |
| 8599 | "$P_SRV \ |
| 8600 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8601 | async_private_error=3" \ |
| 8602 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8603 | 1 \ |
| 8604 | -s "Async decrypt callback: using key slot " \ |
| 8605 | -s "Async resume callback: decrypt done but injected error" \ |
| 8606 | -S "Async cancel" \ |
| 8607 | -s "! mbedtls_ssl_handshake returned" |
| 8608 | |
| 8609 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8611 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8612 | "$P_SRV \ |
| 8613 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8614 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8615 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8616 | 0 \ |
| 8617 | -s "Async cancel" \ |
| 8618 | -s "! mbedtls_ssl_handshake returned" \ |
| 8619 | -s "Async resume" \ |
| 8620 | -s "Successful connection" |
| 8621 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8622 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8624 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8625 | "$P_SRV \ |
| 8626 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8627 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8628 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8629 | 0 \ |
| 8630 | -s "! mbedtls_ssl_handshake returned" \ |
| 8631 | -s "Async resume" \ |
| 8632 | -s "Successful connection" |
| 8633 | |
| 8634 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8635 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8637 | 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] | 8638 | "$P_SRV \ |
| 8639 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8640 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8641 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8642 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8643 | [ \$? -eq 1 ] && |
| 8644 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8645 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8646 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8647 | -S "Async resume" \ |
| 8648 | -s "Async cancel" \ |
| 8649 | -s "! mbedtls_ssl_handshake returned" \ |
| 8650 | -s "Async sign callback: no key matches this certificate." \ |
| 8651 | -s "Successful connection" |
| 8652 | |
| 8653 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8654 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8656 | 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] | 8657 | "$P_SRV \ |
| 8658 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8659 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8660 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8661 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8662 | [ \$? -eq 1 ] && |
| 8663 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8664 | 0 \ |
| 8665 | -s "Async resume" \ |
| 8666 | -s "! mbedtls_ssl_handshake returned" \ |
| 8667 | -s "Async sign callback: no key matches this certificate." \ |
| 8668 | -s "Successful connection" |
| 8669 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8670 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8671 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8673 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8674 | "$P_SRV \ |
| 8675 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8676 | exchanges=2 renegotiation=1" \ |
| 8677 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8678 | 0 \ |
| 8679 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8680 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8681 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8684 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8685 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8686 | "$P_SRV \ |
| 8687 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8688 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8689 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8690 | 0 \ |
| 8691 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8692 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8693 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8694 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8695 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8697 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8698 | "$P_SRV \ |
| 8699 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8700 | exchanges=2 renegotiation=1" \ |
| 8701 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8702 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8703 | 0 \ |
| 8704 | -s "Async decrypt callback: using key slot " \ |
| 8705 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8706 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8707 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8710 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8711 | "$P_SRV \ |
| 8712 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8713 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8714 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8715 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8716 | 0 \ |
| 8717 | -s "Async decrypt callback: using key slot " \ |
| 8718 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8719 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8720 | # Tests for ECC extensions (rfc 4492) |
| 8721 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8722 | requires_config_enabled MBEDTLS_AES_C |
| 8723 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8724 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8725 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8727 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8728 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8729 | "$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] | 8730 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8731 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8732 | -C "client hello, adding supported_point_formats extension" \ |
| 8733 | -S "found supported elliptic curves extension" \ |
| 8734 | -S "found supported point formats extension" |
| 8735 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8736 | requires_config_enabled MBEDTLS_AES_C |
| 8737 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8738 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8739 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8741 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8742 | "$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] | 8743 | "$P_CLI debug_level=3" \ |
| 8744 | 0 \ |
| 8745 | -C "found supported_point_formats extension" \ |
| 8746 | -S "server hello, supported_point_formats extension" |
| 8747 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8748 | requires_config_enabled MBEDTLS_AES_C |
| 8749 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8750 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8751 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8753 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8754 | "$P_SRV debug_level=3" \ |
| 8755 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8756 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8757 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8758 | -c "client hello, adding supported_point_formats extension" \ |
| 8759 | -s "found supported elliptic curves extension" \ |
| 8760 | -s "found supported point formats extension" |
| 8761 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8762 | requires_config_enabled MBEDTLS_AES_C |
| 8763 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8764 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8765 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8767 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8768 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8769 | "$P_CLI debug_level=3" \ |
| 8770 | 0 \ |
| 8771 | -c "found supported_point_formats extension" \ |
| 8772 | -s "server hello, supported_point_formats extension" |
| 8773 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8774 | # Tests for DTLS HelloVerifyRequest |
| 8775 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8777 | run_test "DTLS cookie: enabled" \ |
| 8778 | "$P_SRV dtls=1 debug_level=2" \ |
| 8779 | "$P_CLI dtls=1 debug_level=2" \ |
| 8780 | 0 \ |
| 8781 | -s "cookie verification failed" \ |
| 8782 | -s "cookie verification passed" \ |
| 8783 | -S "cookie verification skipped" \ |
| 8784 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8785 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8786 | -S "SSL - The requested feature is not available" |
| 8787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8789 | run_test "DTLS cookie: disabled" \ |
| 8790 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8791 | "$P_CLI dtls=1 debug_level=2" \ |
| 8792 | 0 \ |
| 8793 | -S "cookie verification failed" \ |
| 8794 | -S "cookie verification passed" \ |
| 8795 | -s "cookie verification skipped" \ |
| 8796 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8797 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8798 | -S "SSL - The requested feature is not available" |
| 8799 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8801 | run_test "DTLS cookie: default (failing)" \ |
| 8802 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8803 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8804 | 1 \ |
| 8805 | -s "cookie verification failed" \ |
| 8806 | -S "cookie verification passed" \ |
| 8807 | -S "cookie verification skipped" \ |
| 8808 | -C "received hello verify request" \ |
| 8809 | -S "hello verification requested" \ |
| 8810 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8811 | |
| 8812 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8814 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8815 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8816 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8817 | 0 \ |
| 8818 | -s "cookie verification failed" \ |
| 8819 | -s "cookie verification passed" \ |
| 8820 | -S "cookie verification skipped" \ |
| 8821 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8822 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8823 | -S "SSL - The requested feature is not available" |
| 8824 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8825 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8826 | run_test "DTLS cookie: enabled, nbio" \ |
| 8827 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8828 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8829 | 0 \ |
| 8830 | -s "cookie verification failed" \ |
| 8831 | -s "cookie verification passed" \ |
| 8832 | -S "cookie verification skipped" \ |
| 8833 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8834 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8835 | -S "SSL - The requested feature is not available" |
| 8836 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8837 | # Tests for client reconnecting from the same port with DTLS |
| 8838 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8839 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8841 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8842 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8843 | "$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] | 8844 | 0 \ |
| 8845 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8846 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8847 | -S "Client initiated reconnection from same port" |
| 8848 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8849 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8851 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8852 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8853 | "$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] | 8854 | 0 \ |
| 8855 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8856 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8857 | -s "Client initiated reconnection from same port" |
| 8858 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8859 | 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] | 8860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8861 | 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] | 8862 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8863 | "$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] | 8864 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8865 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8866 | -s "Client initiated reconnection from same port" |
| 8867 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8868 | 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] | 8869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8870 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8871 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8872 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8873 | 0 \ |
| 8874 | -S "The operation timed out" \ |
| 8875 | -s "Client initiated reconnection from same port" |
| 8876 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8878 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8879 | "$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] | 8880 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8881 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8882 | -s "The operation timed out" \ |
| 8883 | -S "Client initiated reconnection from same port" |
| 8884 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8886 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8887 | -p "$P_PXY inject_clihlo=1" \ |
| 8888 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8889 | "$P_CLI dtls=1 exchanges=2" \ |
| 8890 | 0 \ |
| 8891 | -s "possible client reconnect from the same port" \ |
| 8892 | -S "Client initiated reconnection from same port" |
| 8893 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8894 | # Tests for various cases of client authentication with DTLS |
| 8895 | # (focused on handshake flows and message parsing) |
| 8896 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8898 | run_test "DTLS client auth: required" \ |
| 8899 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8900 | "$P_CLI dtls=1" \ |
| 8901 | 0 \ |
| 8902 | -s "Verifying peer X.509 certificate... ok" |
| 8903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8905 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8906 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8907 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8908 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8909 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8910 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8912 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8913 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8914 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8915 | 0 \ |
| 8916 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8917 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8920 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8921 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8922 | "$P_CLI dtls=1 psk=abc124" \ |
| 8923 | 1 \ |
| 8924 | -s "SSL - Verification of the message MAC failed" \ |
| 8925 | -c "SSL - A fatal alert message was received from our peer" |
| 8926 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8927 | # Tests for receiving fragmented handshake messages with DTLS |
| 8928 | |
| 8929 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8931 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8932 | "$G_SRV -u --mtu 2048 -a" \ |
| 8933 | "$P_CLI dtls=1 debug_level=2" \ |
| 8934 | 0 \ |
| 8935 | -C "found fragmented DTLS handshake message" \ |
| 8936 | -C "error" |
| 8937 | |
| 8938 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8940 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8941 | "$G_SRV -u --mtu 512" \ |
| 8942 | "$P_CLI dtls=1 debug_level=2" \ |
| 8943 | 0 \ |
| 8944 | -c "found fragmented DTLS handshake message" \ |
| 8945 | -C "error" |
| 8946 | |
| 8947 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8949 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8950 | "$G_SRV -u --mtu 128" \ |
| 8951 | "$P_CLI dtls=1 debug_level=2" \ |
| 8952 | 0 \ |
| 8953 | -c "found fragmented DTLS handshake message" \ |
| 8954 | -C "error" |
| 8955 | |
| 8956 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8958 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8959 | "$G_SRV -u --mtu 128" \ |
| 8960 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8961 | 0 \ |
| 8962 | -c "found fragmented DTLS handshake message" \ |
| 8963 | -C "error" |
| 8964 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8965 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8966 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8968 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8969 | "$G_SRV -u --mtu 256" \ |
| 8970 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8971 | 0 \ |
| 8972 | -c "found fragmented DTLS handshake message" \ |
| 8973 | -c "client hello, adding renegotiation extension" \ |
| 8974 | -c "found renegotiation extension" \ |
| 8975 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8976 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8977 | -C "error" \ |
| 8978 | -s "Extra-header:" |
| 8979 | |
| 8980 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8981 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
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 | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8983 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8984 | "$G_SRV -u --mtu 256" \ |
| 8985 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8986 | 0 \ |
| 8987 | -c "found fragmented DTLS handshake message" \ |
| 8988 | -c "client hello, adding renegotiation extension" \ |
| 8989 | -c "found renegotiation extension" \ |
| 8990 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8991 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8992 | -C "error" \ |
| 8993 | -s "Extra-header:" |
| 8994 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8996 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8997 | "$O_SRV -dtls -mtu 2048" \ |
| 8998 | "$P_CLI dtls=1 debug_level=2" \ |
| 8999 | 0 \ |
| 9000 | -C "found fragmented DTLS handshake message" \ |
| 9001 | -C "error" |
| 9002 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9004 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9005 | "$O_SRV -dtls -mtu 768" \ |
| 9006 | "$P_CLI dtls=1 debug_level=2" \ |
| 9007 | 0 \ |
| 9008 | -c "found fragmented DTLS handshake message" \ |
| 9009 | -C "error" |
| 9010 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9012 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9013 | "$O_SRV -dtls -mtu 256" \ |
| 9014 | "$P_CLI dtls=1 debug_level=2" \ |
| 9015 | 0 \ |
| 9016 | -c "found fragmented DTLS handshake message" \ |
| 9017 | -C "error" |
| 9018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9020 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9021 | "$O_SRV -dtls -mtu 256" \ |
| 9022 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9023 | 0 \ |
| 9024 | -c "found fragmented DTLS handshake message" \ |
| 9025 | -C "error" |
| 9026 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9027 | # Tests for sending fragmented handshake messages with DTLS |
| 9028 | # |
| 9029 | # Use client auth when we need the client to send large messages, |
| 9030 | # and use large cert chains on both sides too (the long chains we have all use |
| 9031 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9032 | # Sizes reached (UDP payload): |
| 9033 | # - 2037B for server certificate |
| 9034 | # - 1542B for client certificate |
| 9035 | # - 1013B for newsessionticket |
| 9036 | # - all others below 512B |
| 9037 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9038 | |
| 9039 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9040 | requires_config_enabled MBEDTLS_RSA_C |
| 9041 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9042 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9043 | requires_max_content_len 4096 |
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 | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9045 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9046 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9047 | crt_file=data_files/server7_int-ca.crt \ |
| 9048 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9049 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9050 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9051 | "$P_CLI dtls=1 debug_level=2 \ |
| 9052 | crt_file=data_files/server8_int-ca2.crt \ |
| 9053 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9054 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9055 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9056 | 0 \ |
| 9057 | -S "found fragmented DTLS handshake message" \ |
| 9058 | -C "found fragmented DTLS handshake message" \ |
| 9059 | -C "error" |
| 9060 | |
| 9061 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9062 | requires_config_enabled MBEDTLS_RSA_C |
| 9063 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9064 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9065 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9067 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9068 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9069 | crt_file=data_files/server7_int-ca.crt \ |
| 9070 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9071 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9072 | max_frag_len=1024" \ |
| 9073 | "$P_CLI dtls=1 debug_level=2 \ |
| 9074 | crt_file=data_files/server8_int-ca2.crt \ |
| 9075 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9076 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9077 | max_frag_len=2048" \ |
| 9078 | 0 \ |
| 9079 | -S "found fragmented DTLS handshake message" \ |
| 9080 | -c "found fragmented DTLS handshake message" \ |
| 9081 | -C "error" |
| 9082 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9083 | # With the MFL extension, the server has no way of forcing |
| 9084 | # the client to not exceed a certain MTU; hence, the following |
| 9085 | # test can't be replicated with an MTU proxy such as the one |
| 9086 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9087 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9088 | requires_config_enabled MBEDTLS_RSA_C |
| 9089 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9090 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9091 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9093 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9094 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9095 | crt_file=data_files/server7_int-ca.crt \ |
| 9096 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9097 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9098 | max_frag_len=512" \ |
| 9099 | "$P_CLI dtls=1 debug_level=2 \ |
| 9100 | crt_file=data_files/server8_int-ca2.crt \ |
| 9101 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9102 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9103 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9104 | 0 \ |
| 9105 | -S "found fragmented DTLS handshake message" \ |
| 9106 | -c "found fragmented DTLS handshake message" \ |
| 9107 | -C "error" |
| 9108 | |
| 9109 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9110 | requires_config_enabled MBEDTLS_RSA_C |
| 9111 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9112 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9113 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9115 | 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] | 9116 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9117 | crt_file=data_files/server7_int-ca.crt \ |
| 9118 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9119 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9120 | max_frag_len=2048" \ |
| 9121 | "$P_CLI dtls=1 debug_level=2 \ |
| 9122 | crt_file=data_files/server8_int-ca2.crt \ |
| 9123 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9124 | hs_timeout=2500-60000 \ |
| 9125 | max_frag_len=1024" \ |
| 9126 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9127 | -S "found fragmented DTLS handshake message" \ |
| 9128 | -c "found fragmented DTLS handshake message" \ |
| 9129 | -C "error" |
| 9130 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9131 | # While not required by the standard defining the MFL extension |
| 9132 | # (according to which it only applies to records, not to datagrams), |
| 9133 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9134 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9135 | # to the peer. |
| 9136 | # The next test checks that no datagrams significantly larger than the |
| 9137 | # negotiated MFL are sent. |
| 9138 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9139 | requires_config_enabled MBEDTLS_RSA_C |
| 9140 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9141 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9142 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9144 | 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] | 9145 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9146 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9147 | crt_file=data_files/server7_int-ca.crt \ |
| 9148 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9149 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9150 | max_frag_len=2048" \ |
| 9151 | "$P_CLI dtls=1 debug_level=2 \ |
| 9152 | crt_file=data_files/server8_int-ca2.crt \ |
| 9153 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9154 | hs_timeout=2500-60000 \ |
| 9155 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9156 | 0 \ |
| 9157 | -S "found fragmented DTLS handshake message" \ |
| 9158 | -c "found fragmented DTLS handshake message" \ |
| 9159 | -C "error" |
| 9160 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9161 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9162 | requires_config_enabled MBEDTLS_RSA_C |
| 9163 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9164 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9165 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9167 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9168 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9169 | crt_file=data_files/server7_int-ca.crt \ |
| 9170 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9171 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9172 | max_frag_len=2048" \ |
| 9173 | "$P_CLI dtls=1 debug_level=2 \ |
| 9174 | crt_file=data_files/server8_int-ca2.crt \ |
| 9175 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9176 | hs_timeout=2500-60000 \ |
| 9177 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9178 | 0 \ |
| 9179 | -s "found fragmented DTLS handshake message" \ |
| 9180 | -c "found fragmented DTLS handshake message" \ |
| 9181 | -C "error" |
| 9182 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9183 | # While not required by the standard defining the MFL extension |
| 9184 | # (according to which it only applies to records, not to datagrams), |
| 9185 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9186 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9187 | # to the peer. |
| 9188 | # The next test checks that no datagrams significantly larger than the |
| 9189 | # negotiated MFL are sent. |
| 9190 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9191 | requires_config_enabled MBEDTLS_RSA_C |
| 9192 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9193 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9194 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9196 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9197 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9198 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9199 | crt_file=data_files/server7_int-ca.crt \ |
| 9200 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9201 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9202 | max_frag_len=2048" \ |
| 9203 | "$P_CLI dtls=1 debug_level=2 \ |
| 9204 | crt_file=data_files/server8_int-ca2.crt \ |
| 9205 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9206 | hs_timeout=2500-60000 \ |
| 9207 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9208 | 0 \ |
| 9209 | -s "found fragmented DTLS handshake message" \ |
| 9210 | -c "found fragmented DTLS handshake message" \ |
| 9211 | -C "error" |
| 9212 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9213 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9214 | requires_config_enabled MBEDTLS_RSA_C |
| 9215 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9216 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9218 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9219 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9220 | crt_file=data_files/server7_int-ca.crt \ |
| 9221 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9222 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9223 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9224 | "$P_CLI dtls=1 debug_level=2 \ |
| 9225 | crt_file=data_files/server8_int-ca2.crt \ |
| 9226 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9227 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9228 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9229 | 0 \ |
| 9230 | -S "found fragmented DTLS handshake message" \ |
| 9231 | -C "found fragmented DTLS handshake message" \ |
| 9232 | -C "error" |
| 9233 | |
| 9234 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9235 | requires_config_enabled MBEDTLS_RSA_C |
| 9236 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9237 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9239 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9240 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9241 | crt_file=data_files/server7_int-ca.crt \ |
| 9242 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9243 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9244 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9245 | "$P_CLI dtls=1 debug_level=2 \ |
| 9246 | crt_file=data_files/server8_int-ca2.crt \ |
| 9247 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9248 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9249 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9250 | 0 \ |
| 9251 | -s "found fragmented DTLS handshake message" \ |
| 9252 | -C "found fragmented DTLS handshake message" \ |
| 9253 | -C "error" |
| 9254 | |
| 9255 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9256 | requires_config_enabled MBEDTLS_RSA_C |
| 9257 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9258 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9260 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9261 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9262 | crt_file=data_files/server7_int-ca.crt \ |
| 9263 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9264 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9265 | mtu=512" \ |
| 9266 | "$P_CLI dtls=1 debug_level=2 \ |
| 9267 | crt_file=data_files/server8_int-ca2.crt \ |
| 9268 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9269 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9270 | mtu=2048" \ |
| 9271 | 0 \ |
| 9272 | -S "found fragmented DTLS handshake message" \ |
| 9273 | -c "found fragmented DTLS handshake message" \ |
| 9274 | -C "error" |
| 9275 | |
| 9276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9277 | requires_config_enabled MBEDTLS_RSA_C |
| 9278 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9279 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9280 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9281 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9282 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9283 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9284 | crt_file=data_files/server7_int-ca.crt \ |
| 9285 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9286 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9287 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9288 | "$P_CLI dtls=1 debug_level=2 \ |
| 9289 | crt_file=data_files/server8_int-ca2.crt \ |
| 9290 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9291 | hs_timeout=2500-60000 \ |
| 9292 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9293 | 0 \ |
| 9294 | -s "found fragmented DTLS handshake message" \ |
| 9295 | -c "found fragmented DTLS handshake message" \ |
| 9296 | -C "error" |
| 9297 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9298 | # 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] | 9299 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9300 | requires_config_enabled MBEDTLS_RSA_C |
| 9301 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9302 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9303 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9304 | requires_config_enabled MBEDTLS_AES_C |
| 9305 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9306 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9308 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9309 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9310 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9311 | crt_file=data_files/server7_int-ca.crt \ |
| 9312 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9313 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9314 | mtu=512" \ |
| 9315 | "$P_CLI dtls=1 debug_level=2 \ |
| 9316 | crt_file=data_files/server8_int-ca2.crt \ |
| 9317 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9318 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9319 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9320 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9321 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9322 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9323 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9324 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9325 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9326 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9327 | # 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] | 9328 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9329 | # retransmissions, but in some cases (like both the server and client using |
| 9330 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9331 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9332 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9333 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9334 | requires_config_enabled MBEDTLS_RSA_C |
| 9335 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9336 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9337 | requires_config_enabled MBEDTLS_AES_C |
| 9338 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9339 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9341 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9342 | -p "$P_PXY mtu=508" \ |
| 9343 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9344 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9345 | key_file=data_files/server7.key \ |
| 9346 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9347 | "$P_CLI dtls=1 debug_level=2 \ |
| 9348 | crt_file=data_files/server8_int-ca2.crt \ |
| 9349 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9350 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9351 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9352 | 0 \ |
| 9353 | -s "found fragmented DTLS handshake message" \ |
| 9354 | -c "found fragmented DTLS handshake message" \ |
| 9355 | -C "error" |
| 9356 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9357 | # 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] | 9358 | only_with_valgrind |
| 9359 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9360 | requires_config_enabled MBEDTLS_RSA_C |
| 9361 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9362 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9363 | requires_config_enabled MBEDTLS_AES_C |
| 9364 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9365 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9367 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9368 | -p "$P_PXY mtu=508" \ |
| 9369 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9370 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9371 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9372 | hs_timeout=250-10000" \ |
| 9373 | "$P_CLI dtls=1 debug_level=2 \ |
| 9374 | crt_file=data_files/server8_int-ca2.crt \ |
| 9375 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9376 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9377 | hs_timeout=250-10000" \ |
| 9378 | 0 \ |
| 9379 | -s "found fragmented DTLS handshake message" \ |
| 9380 | -c "found fragmented DTLS handshake message" \ |
| 9381 | -C "error" |
| 9382 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9383 | # 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] | 9384 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9385 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9386 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9388 | requires_config_enabled MBEDTLS_RSA_C |
| 9389 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9390 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9392 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9393 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9394 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9395 | crt_file=data_files/server7_int-ca.crt \ |
| 9396 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9397 | hs_timeout=10000-60000 \ |
| 9398 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9399 | "$P_CLI dtls=1 debug_level=2 \ |
| 9400 | crt_file=data_files/server8_int-ca2.crt \ |
| 9401 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9402 | hs_timeout=10000-60000 \ |
| 9403 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9404 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9405 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9406 | -s "found fragmented DTLS handshake message" \ |
| 9407 | -c "found fragmented DTLS handshake message" \ |
| 9408 | -C "error" |
| 9409 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9410 | # 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] | 9411 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9412 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9413 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9414 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9415 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9416 | requires_config_enabled MBEDTLS_RSA_C |
| 9417 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9418 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9419 | requires_config_enabled MBEDTLS_AES_C |
| 9420 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9421 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9423 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9424 | -p "$P_PXY mtu=512" \ |
| 9425 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9426 | crt_file=data_files/server7_int-ca.crt \ |
| 9427 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9428 | hs_timeout=10000-60000 \ |
| 9429 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9430 | "$P_CLI dtls=1 debug_level=2 \ |
| 9431 | crt_file=data_files/server8_int-ca2.crt \ |
| 9432 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9433 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9434 | hs_timeout=10000-60000 \ |
| 9435 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9436 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9437 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9438 | -s "found fragmented DTLS handshake message" \ |
| 9439 | -c "found fragmented DTLS handshake message" \ |
| 9440 | -C "error" |
| 9441 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9442 | not_with_valgrind # spurious autoreduction due to timeout |
| 9443 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9444 | requires_config_enabled MBEDTLS_RSA_C |
| 9445 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9446 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9448 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9449 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9450 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9451 | crt_file=data_files/server7_int-ca.crt \ |
| 9452 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9453 | hs_timeout=10000-60000 \ |
| 9454 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9455 | "$P_CLI dtls=1 debug_level=2 \ |
| 9456 | crt_file=data_files/server8_int-ca2.crt \ |
| 9457 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9458 | hs_timeout=10000-60000 \ |
| 9459 | mtu=1024 nbio=2" \ |
| 9460 | 0 \ |
| 9461 | -S "autoreduction" \ |
| 9462 | -s "found fragmented DTLS handshake message" \ |
| 9463 | -c "found fragmented DTLS handshake message" \ |
| 9464 | -C "error" |
| 9465 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9466 | # 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] | 9467 | not_with_valgrind # spurious autoreduction due to timeout |
| 9468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9469 | requires_config_enabled MBEDTLS_RSA_C |
| 9470 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9471 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9472 | requires_config_enabled MBEDTLS_AES_C |
| 9473 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9474 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9476 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9477 | -p "$P_PXY mtu=512" \ |
| 9478 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9479 | crt_file=data_files/server7_int-ca.crt \ |
| 9480 | key_file=data_files/server7.key \ |
| 9481 | hs_timeout=10000-60000 \ |
| 9482 | mtu=512 nbio=2" \ |
| 9483 | "$P_CLI dtls=1 debug_level=2 \ |
| 9484 | crt_file=data_files/server8_int-ca2.crt \ |
| 9485 | key_file=data_files/server8.key \ |
| 9486 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9487 | hs_timeout=10000-60000 \ |
| 9488 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9489 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9490 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9491 | -s "found fragmented DTLS handshake message" \ |
| 9492 | -c "found fragmented DTLS handshake message" \ |
| 9493 | -C "error" |
| 9494 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9495 | # 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] | 9496 | # This ensures things still work after session_reset(). |
| 9497 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9498 | # Since we don't support reading fragmented ClientHello yet, |
| 9499 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9500 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9501 | # An autoreduction on the client-side might happen if the server is |
| 9502 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9503 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9504 | # resumed listening, which would result in a spurious autoreduction. |
| 9505 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9506 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9507 | requires_config_enabled MBEDTLS_RSA_C |
| 9508 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9509 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9510 | requires_config_enabled MBEDTLS_AES_C |
| 9511 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9512 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9514 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9515 | -p "$P_PXY mtu=1450" \ |
| 9516 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9517 | crt_file=data_files/server7_int-ca.crt \ |
| 9518 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9519 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9520 | mtu=1450" \ |
| 9521 | "$P_CLI dtls=1 debug_level=2 \ |
| 9522 | crt_file=data_files/server8_int-ca2.crt \ |
| 9523 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9524 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9525 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9526 | 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] | 9527 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9528 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9529 | -s "found fragmented DTLS handshake message" \ |
| 9530 | -c "found fragmented DTLS handshake message" \ |
| 9531 | -C "error" |
| 9532 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9533 | # An autoreduction on the client-side might happen if the server is |
| 9534 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9535 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9537 | requires_config_enabled MBEDTLS_RSA_C |
| 9538 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9539 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9540 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9542 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9543 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9545 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9546 | -p "$P_PXY mtu=512" \ |
| 9547 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9548 | crt_file=data_files/server7_int-ca.crt \ |
| 9549 | key_file=data_files/server7.key \ |
| 9550 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9551 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9552 | mtu=512" \ |
| 9553 | "$P_CLI dtls=1 debug_level=2 \ |
| 9554 | crt_file=data_files/server8_int-ca2.crt \ |
| 9555 | key_file=data_files/server8.key \ |
| 9556 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9557 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9558 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9559 | mtu=512" \ |
| 9560 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9561 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9562 | -s "found fragmented DTLS handshake message" \ |
| 9563 | -c "found fragmented DTLS handshake message" \ |
| 9564 | -C "error" |
| 9565 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9566 | # An autoreduction on the client-side might happen if the server is |
| 9567 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9568 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9569 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9570 | requires_config_enabled MBEDTLS_RSA_C |
| 9571 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9572 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9573 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9574 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9575 | requires_config_enabled MBEDTLS_AES_C |
| 9576 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9577 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9579 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9580 | -p "$P_PXY mtu=512" \ |
| 9581 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9582 | crt_file=data_files/server7_int-ca.crt \ |
| 9583 | key_file=data_files/server7.key \ |
| 9584 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9585 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9586 | mtu=512" \ |
| 9587 | "$P_CLI dtls=1 debug_level=2 \ |
| 9588 | crt_file=data_files/server8_int-ca2.crt \ |
| 9589 | key_file=data_files/server8.key \ |
| 9590 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9591 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9592 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9593 | mtu=512" \ |
| 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 | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9600 | # An autoreduction on the client-side might happen if the server is |
| 9601 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9602 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9604 | requires_config_enabled MBEDTLS_RSA_C |
| 9605 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9606 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9608 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9609 | requires_config_enabled MBEDTLS_AES_C |
| 9610 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9611 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9613 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9614 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9615 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9616 | crt_file=data_files/server7_int-ca.crt \ |
| 9617 | key_file=data_files/server7.key \ |
| 9618 | exchanges=2 renegotiation=1 \ |
| 9619 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9620 | hs_timeout=10000-60000 \ |
| 9621 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9622 | "$P_CLI dtls=1 debug_level=2 \ |
| 9623 | crt_file=data_files/server8_int-ca2.crt \ |
| 9624 | key_file=data_files/server8.key \ |
| 9625 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9626 | hs_timeout=10000-60000 \ |
| 9627 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9628 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9629 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9630 | -s "found fragmented DTLS handshake message" \ |
| 9631 | -c "found fragmented DTLS handshake message" \ |
| 9632 | -C "error" |
| 9633 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9634 | # An autoreduction on the client-side might happen if the server is |
| 9635 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9636 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9638 | requires_config_enabled MBEDTLS_RSA_C |
| 9639 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9640 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9641 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9643 | requires_config_enabled MBEDTLS_AES_C |
| 9644 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9645 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9646 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9648 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9649 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9650 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9651 | crt_file=data_files/server7_int-ca.crt \ |
| 9652 | key_file=data_files/server7.key \ |
| 9653 | exchanges=2 renegotiation=1 \ |
| 9654 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9655 | hs_timeout=10000-60000 \ |
| 9656 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9657 | "$P_CLI dtls=1 debug_level=2 \ |
| 9658 | crt_file=data_files/server8_int-ca2.crt \ |
| 9659 | key_file=data_files/server8.key \ |
| 9660 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9661 | hs_timeout=10000-60000 \ |
| 9662 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9663 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9664 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9665 | -s "found fragmented DTLS handshake message" \ |
| 9666 | -c "found fragmented DTLS handshake message" \ |
| 9667 | -C "error" |
| 9668 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9669 | # An autoreduction on the client-side might happen if the server is |
| 9670 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9671 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9672 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9673 | requires_config_enabled MBEDTLS_RSA_C |
| 9674 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9675 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9676 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9677 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9678 | requires_config_enabled MBEDTLS_AES_C |
| 9679 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9680 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9682 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9683 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9684 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9685 | crt_file=data_files/server7_int-ca.crt \ |
| 9686 | key_file=data_files/server7.key \ |
| 9687 | exchanges=2 renegotiation=1 \ |
| 9688 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9689 | hs_timeout=10000-60000 \ |
| 9690 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9691 | "$P_CLI dtls=1 debug_level=2 \ |
| 9692 | crt_file=data_files/server8_int-ca2.crt \ |
| 9693 | key_file=data_files/server8.key \ |
| 9694 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9695 | hs_timeout=10000-60000 \ |
| 9696 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9697 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9698 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9699 | -s "found fragmented DTLS handshake message" \ |
| 9700 | -c "found fragmented DTLS handshake message" \ |
| 9701 | -C "error" |
| 9702 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9703 | # 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] | 9704 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9705 | requires_config_enabled MBEDTLS_RSA_C |
| 9706 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9707 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9708 | requires_config_enabled MBEDTLS_AES_C |
| 9709 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9710 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9711 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9713 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9714 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9715 | "$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] | 9716 | crt_file=data_files/server7_int-ca.crt \ |
| 9717 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9718 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9719 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9720 | crt_file=data_files/server8_int-ca2.crt \ |
| 9721 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9722 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9723 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9724 | 0 \ |
| 9725 | -s "found fragmented DTLS handshake message" \ |
| 9726 | -c "found fragmented DTLS handshake message" \ |
| 9727 | -C "error" |
| 9728 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9729 | # 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] | 9730 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9731 | requires_config_enabled MBEDTLS_RSA_C |
| 9732 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9733 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9734 | requires_config_enabled MBEDTLS_AES_C |
| 9735 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9736 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9737 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9739 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9740 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9741 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9742 | crt_file=data_files/server7_int-ca.crt \ |
| 9743 | key_file=data_files/server7.key \ |
| 9744 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9745 | "$P_CLI dtls=1 debug_level=2 \ |
| 9746 | crt_file=data_files/server8_int-ca2.crt \ |
| 9747 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9748 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9749 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9750 | 0 \ |
| 9751 | -s "found fragmented DTLS handshake message" \ |
| 9752 | -c "found fragmented DTLS handshake message" \ |
| 9753 | -C "error" |
| 9754 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9755 | # interop tests for DTLS fragmentating with reliable connection |
| 9756 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9757 | # here and below we just want to test that the we fragment in a way that |
| 9758 | # pleases other implementations, so we don't need the peer to fragment |
| 9759 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9760 | requires_config_enabled MBEDTLS_RSA_C |
| 9761 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9762 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9763 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9764 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9765 | "$G_SRV -u" \ |
| 9766 | "$P_CLI dtls=1 debug_level=2 \ |
| 9767 | crt_file=data_files/server8_int-ca2.crt \ |
| 9768 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9769 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9770 | 0 \ |
| 9771 | -c "fragmenting handshake message" \ |
| 9772 | -C "error" |
| 9773 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9774 | # We use --insecure for the GnuTLS client because it expects |
| 9775 | # the hostname / IP it connects to to be the name used in the |
| 9776 | # certificate obtained from the server. Here, however, it |
| 9777 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9778 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9779 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9780 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9781 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9782 | requires_config_enabled MBEDTLS_RSA_C |
| 9783 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9784 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9785 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9786 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9787 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9788 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9789 | crt_file=data_files/server7_int-ca.crt \ |
| 9790 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9791 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9792 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9793 | 0 \ |
| 9794 | -s "fragmenting handshake message" |
| 9795 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9796 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9797 | requires_config_enabled MBEDTLS_RSA_C |
| 9798 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9799 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9800 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9801 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9802 | "$P_CLI dtls=1 debug_level=2 \ |
| 9803 | crt_file=data_files/server8_int-ca2.crt \ |
| 9804 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9805 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9806 | 0 \ |
| 9807 | -c "fragmenting handshake message" \ |
| 9808 | -C "error" |
| 9809 | |
| 9810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9811 | requires_config_enabled MBEDTLS_RSA_C |
| 9812 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9813 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9814 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9815 | "$P_SRV dtls=1 debug_level=2 \ |
| 9816 | crt_file=data_files/server7_int-ca.crt \ |
| 9817 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9818 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9819 | "$O_CLI -dtls1_2" \ |
| 9820 | 0 \ |
| 9821 | -s "fragmenting handshake message" |
| 9822 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9823 | # interop tests for DTLS fragmentating with unreliable connection |
| 9824 | # |
| 9825 | # again we just want to test that the we fragment in a way that |
| 9826 | # pleases other implementations, so we don't need the peer to fragment |
| 9827 | requires_gnutls_next |
| 9828 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9829 | requires_config_enabled MBEDTLS_RSA_C |
| 9830 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9831 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9832 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9833 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9834 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9835 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9836 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9837 | crt_file=data_files/server8_int-ca2.crt \ |
| 9838 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9839 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9840 | 0 \ |
| 9841 | -c "fragmenting handshake message" \ |
| 9842 | -C "error" |
| 9843 | |
| 9844 | requires_gnutls_next |
| 9845 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9846 | requires_config_enabled MBEDTLS_RSA_C |
| 9847 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9848 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9849 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9850 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9851 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9852 | "$P_SRV dtls=1 debug_level=2 \ |
| 9853 | crt_file=data_files/server7_int-ca.crt \ |
| 9854 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9855 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9856 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9857 | 0 \ |
| 9858 | -s "fragmenting handshake message" |
| 9859 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 9860 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 9861 | ## 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] | 9862 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9864 | requires_config_enabled MBEDTLS_RSA_C |
| 9865 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9866 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9867 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9868 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9869 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 9870 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 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 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9875 | 0 \ |
| 9876 | -c "fragmenting handshake message" \ |
| 9877 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9878 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 9879 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 9880 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 9881 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9882 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9883 | requires_config_enabled MBEDTLS_RSA_C |
| 9884 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9885 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9886 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9887 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9888 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9889 | "$P_SRV dtls=1 debug_level=2 \ |
| 9890 | crt_file=data_files/server7_int-ca.crt \ |
| 9891 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9892 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9893 | "$O_CLI -dtls1_2" \ |
| 9894 | 0 \ |
| 9895 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9896 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9897 | # Tests for DTLS-SRTP (RFC 5764) |
| 9898 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9900 | run_test "DTLS-SRTP all profiles supported" \ |
| 9901 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9902 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9903 | 0 \ |
| 9904 | -s "found use_srtp extension" \ |
| 9905 | -s "found srtp profile" \ |
| 9906 | -s "selected srtp profile" \ |
| 9907 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9908 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9909 | -c "client hello, adding use_srtp extension" \ |
| 9910 | -c "found use_srtp extension" \ |
| 9911 | -c "found srtp profile" \ |
| 9912 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9913 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9914 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9915 | -C "error" |
| 9916 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9917 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9918 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9920 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9921 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9922 | "$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] | 9923 | 0 \ |
| 9924 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9925 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9926 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9927 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9928 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9929 | -c "client hello, adding use_srtp extension" \ |
| 9930 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9931 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9932 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9933 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9934 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9935 | -C "error" |
| 9936 | |
| 9937 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9938 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9939 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9940 | "$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] | 9941 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9942 | 0 \ |
| 9943 | -s "found use_srtp extension" \ |
| 9944 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9945 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9946 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9947 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9948 | -c "client hello, adding use_srtp extension" \ |
| 9949 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9950 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9951 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9952 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9953 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9954 | -C "error" |
| 9955 | |
| 9956 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9958 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9959 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9960 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9961 | 0 \ |
| 9962 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9963 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9964 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9965 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9966 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9967 | -c "client hello, adding use_srtp extension" \ |
| 9968 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9969 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9970 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9971 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9972 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9973 | -C "error" |
| 9974 | |
| 9975 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9977 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9978 | "$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] | 9979 | "$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] | 9980 | 0 \ |
| 9981 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9982 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9983 | -S "selected srtp profile" \ |
| 9984 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9985 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9986 | -c "client hello, adding use_srtp extension" \ |
| 9987 | -C "found use_srtp extension" \ |
| 9988 | -C "found srtp profile" \ |
| 9989 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9990 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9991 | -C "error" |
| 9992 | |
| 9993 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9995 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9996 | "$P_SRV dtls=1 debug_level=3" \ |
| 9997 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9998 | 0 \ |
| 9999 | -s "found use_srtp extension" \ |
| 10000 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10001 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10002 | -c "client hello, adding use_srtp extension" \ |
| 10003 | -C "found use_srtp extension" \ |
| 10004 | -C "found srtp profile" \ |
| 10005 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10006 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10007 | -C "error" |
| 10008 | |
| 10009 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10011 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10012 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10013 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10014 | 0 \ |
| 10015 | -s "found use_srtp extension" \ |
| 10016 | -s "found srtp profile" \ |
| 10017 | -s "selected srtp profile" \ |
| 10018 | -s "server hello, adding use_srtp extension" \ |
| 10019 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10020 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10021 | -c "client hello, adding use_srtp extension" \ |
| 10022 | -c "found use_srtp extension" \ |
| 10023 | -c "found srtp profile" \ |
| 10024 | -c "selected srtp profile" \ |
| 10025 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10026 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10027 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10028 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10029 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10030 | -C "error" |
| 10031 | |
| 10032 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10033 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10034 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10035 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10036 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10037 | 0 \ |
| 10038 | -s "found use_srtp extension" \ |
| 10039 | -s "found srtp profile" \ |
| 10040 | -s "selected srtp profile" \ |
| 10041 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10042 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10043 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10044 | -S "dumping 'using mki' (8 bytes)" \ |
| 10045 | -c "client hello, adding use_srtp extension" \ |
| 10046 | -c "found use_srtp extension" \ |
| 10047 | -c "found srtp profile" \ |
| 10048 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10049 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10050 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10051 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10052 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10053 | -C "dumping 'received mki' (8 bytes)" \ |
| 10054 | -C "error" |
| 10055 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10056 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10058 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10059 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10060 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10061 | 0 \ |
| 10062 | -s "found use_srtp extension" \ |
| 10063 | -s "found srtp profile" \ |
| 10064 | -s "selected srtp profile" \ |
| 10065 | -s "server hello, adding use_srtp extension" \ |
| 10066 | -s "DTLS-SRTP key material is"\ |
| 10067 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10068 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10069 | |
| 10070 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10072 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10073 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10074 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10075 | 0 \ |
| 10076 | -s "found use_srtp extension" \ |
| 10077 | -s "found srtp profile" \ |
| 10078 | -s "selected srtp profile" \ |
| 10079 | -s "server hello, adding use_srtp extension" \ |
| 10080 | -s "DTLS-SRTP key material is"\ |
| 10081 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10082 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10083 | |
| 10084 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10086 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10087 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10088 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10089 | 0 \ |
| 10090 | -s "found use_srtp extension" \ |
| 10091 | -s "found srtp profile" \ |
| 10092 | -s "selected srtp profile" \ |
| 10093 | -s "server hello, adding use_srtp extension" \ |
| 10094 | -s "DTLS-SRTP key material is"\ |
| 10095 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10096 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 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 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10100 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10101 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10102 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10103 | 0 \ |
| 10104 | -s "found use_srtp extension" \ |
| 10105 | -s "found srtp profile" \ |
| 10106 | -s "selected srtp profile" \ |
| 10107 | -s "server hello, adding use_srtp extension" \ |
| 10108 | -s "DTLS-SRTP key material is"\ |
| 10109 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10110 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10111 | |
| 10112 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10114 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10115 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10116 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10117 | 0 \ |
| 10118 | -s "found use_srtp extension" \ |
| 10119 | -s "found srtp profile" \ |
| 10120 | -s "selected srtp profile" \ |
| 10121 | -s "server hello, adding use_srtp extension" \ |
| 10122 | -s "DTLS-SRTP key material is"\ |
| 10123 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10124 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10125 | |
| 10126 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10128 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10129 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10130 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10131 | 0 \ |
| 10132 | -s "found use_srtp extension" \ |
| 10133 | -s "found srtp profile" \ |
| 10134 | -S "selected srtp profile" \ |
| 10135 | -S "server hello, adding use_srtp extension" \ |
| 10136 | -S "DTLS-SRTP key material is"\ |
| 10137 | -C "SRTP Extension negotiated, profile" |
| 10138 | |
| 10139 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10141 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10142 | "$P_SRV dtls=1 debug_level=3" \ |
| 10143 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10144 | 0 \ |
| 10145 | -s "found use_srtp extension" \ |
| 10146 | -S "server hello, adding use_srtp extension" \ |
| 10147 | -S "DTLS-SRTP key material is"\ |
| 10148 | -C "SRTP Extension negotiated, profile" |
| 10149 | |
| 10150 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10152 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10153 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10154 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10155 | 0 \ |
| 10156 | -c "client hello, adding use_srtp extension" \ |
| 10157 | -c "found use_srtp extension" \ |
| 10158 | -c "found srtp profile" \ |
| 10159 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10160 | -c "DTLS-SRTP key material is"\ |
| 10161 | -C "error" |
| 10162 | |
| 10163 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10165 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10166 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10167 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10168 | 0 \ |
| 10169 | -c "client hello, adding use_srtp extension" \ |
| 10170 | -c "found use_srtp extension" \ |
| 10171 | -c "found srtp profile" \ |
| 10172 | -c "selected srtp profile" \ |
| 10173 | -c "DTLS-SRTP key material is"\ |
| 10174 | -C "error" |
| 10175 | |
| 10176 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10178 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10179 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10180 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10181 | 0 \ |
| 10182 | -c "client hello, adding use_srtp extension" \ |
| 10183 | -c "found use_srtp extension" \ |
| 10184 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10185 | -c "selected srtp profile" \ |
| 10186 | -c "DTLS-SRTP key material is"\ |
| 10187 | -C "error" |
| 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 one profile. Client supports all profiles. openssl server." \ |
| 10192 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10193 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10194 | 0 \ |
| 10195 | -c "client hello, adding use_srtp extension" \ |
| 10196 | -c "found use_srtp extension" \ |
| 10197 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10198 | -c "selected srtp profile" \ |
| 10199 | -c "DTLS-SRTP key material is"\ |
| 10200 | -C "error" |
| 10201 | |
| 10202 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10203 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10204 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10205 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10206 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10207 | 0 \ |
| 10208 | -c "client hello, adding use_srtp extension" \ |
| 10209 | -c "found use_srtp extension" \ |
| 10210 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10211 | -c "selected srtp profile" \ |
| 10212 | -c "DTLS-SRTP key material is"\ |
| 10213 | -C "error" |
| 10214 | |
| 10215 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10217 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10218 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10219 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10220 | 0 \ |
| 10221 | -c "client hello, adding use_srtp extension" \ |
| 10222 | -C "found use_srtp extension" \ |
| 10223 | -C "found srtp profile" \ |
| 10224 | -C "selected srtp profile" \ |
| 10225 | -C "DTLS-SRTP key material is"\ |
| 10226 | -C "error" |
| 10227 | |
| 10228 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10230 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10231 | "$O_SRV -dtls" \ |
| 10232 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10233 | 0 \ |
| 10234 | -c "client hello, adding use_srtp extension" \ |
| 10235 | -C "found use_srtp extension" \ |
| 10236 | -C "found srtp profile" \ |
| 10237 | -C "selected srtp profile" \ |
| 10238 | -C "DTLS-SRTP key material is"\ |
| 10239 | -C "error" |
| 10240 | |
| 10241 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10243 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10244 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10245 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10246 | 0 \ |
| 10247 | -c "client hello, adding use_srtp extension" \ |
| 10248 | -c "found use_srtp extension" \ |
| 10249 | -c "found srtp profile" \ |
| 10250 | -c "selected srtp profile" \ |
| 10251 | -c "DTLS-SRTP key material is"\ |
| 10252 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10253 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10254 | -C "dumping 'received mki' (8 bytes)" \ |
| 10255 | -C "error" |
| 10256 | |
| 10257 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10258 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10260 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10261 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10262 | "$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] | 10263 | 0 \ |
| 10264 | -s "found use_srtp extension" \ |
| 10265 | -s "found srtp profile" \ |
| 10266 | -s "selected srtp profile" \ |
| 10267 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10268 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10269 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10270 | |
| 10271 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10272 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10274 | 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] | 10275 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10276 | "$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] | 10277 | 0 \ |
| 10278 | -s "found use_srtp extension" \ |
| 10279 | -s "found srtp profile" \ |
| 10280 | -s "selected srtp profile" \ |
| 10281 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10282 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10283 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10284 | |
| 10285 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10286 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10288 | 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] | 10289 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10290 | "$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] | 10291 | 0 \ |
| 10292 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10293 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10294 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10295 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10296 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10297 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10298 | |
| 10299 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10300 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10302 | 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] | 10303 | "$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] | 10304 | "$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] | 10305 | 0 \ |
| 10306 | -s "found use_srtp extension" \ |
| 10307 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10308 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10309 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10310 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10311 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10312 | |
| 10313 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10314 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10316 | 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] | 10317 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10318 | "$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] | 10319 | 0 \ |
| 10320 | -s "found use_srtp extension" \ |
| 10321 | -s "found srtp profile" \ |
| 10322 | -s "selected srtp profile" \ |
| 10323 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10324 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10325 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10326 | |
| 10327 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10328 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10330 | 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] | 10331 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10332 | "$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] | 10333 | 0 \ |
| 10334 | -s "found use_srtp extension" \ |
| 10335 | -s "found srtp profile" \ |
| 10336 | -S "selected srtp profile" \ |
| 10337 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10338 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10339 | -C "SRTP profile:" |
| 10340 | |
| 10341 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10342 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10344 | 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] | 10345 | "$P_SRV dtls=1 debug_level=3" \ |
| 10346 | "$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] | 10347 | 0 \ |
| 10348 | -s "found use_srtp extension" \ |
| 10349 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10350 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10351 | -C "SRTP profile:" |
| 10352 | |
| 10353 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10354 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10356 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10357 | "$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" \ |
| 10358 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10359 | 0 \ |
| 10360 | -c "client hello, adding use_srtp extension" \ |
| 10361 | -c "found use_srtp extension" \ |
| 10362 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10363 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10364 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10365 | -C "error" |
| 10366 | |
| 10367 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10368 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10370 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10371 | "$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" \ |
| 10372 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10373 | 0 \ |
| 10374 | -c "client hello, adding use_srtp extension" \ |
| 10375 | -c "found use_srtp extension" \ |
| 10376 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10377 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10378 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10379 | -C "error" |
| 10380 | |
| 10381 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10382 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10383 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10384 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10385 | "$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" \ |
| 10386 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10387 | 0 \ |
| 10388 | -c "client hello, adding use_srtp extension" \ |
| 10389 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10390 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10391 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10392 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10393 | -C "error" |
| 10394 | |
| 10395 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10396 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10398 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10399 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10400 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10401 | 0 \ |
| 10402 | -c "client hello, adding use_srtp extension" \ |
| 10403 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10404 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10405 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10406 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10407 | -C "error" |
| 10408 | |
| 10409 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10410 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10412 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10413 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10414 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10415 | 0 \ |
| 10416 | -c "client hello, adding use_srtp extension" \ |
| 10417 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10418 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10419 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10420 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10421 | -C "error" |
| 10422 | |
| 10423 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10424 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10426 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10427 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10428 | "$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] | 10429 | 0 \ |
| 10430 | -c "client hello, adding use_srtp extension" \ |
| 10431 | -C "found use_srtp extension" \ |
| 10432 | -C "found srtp profile" \ |
| 10433 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10434 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10435 | -C "error" |
| 10436 | |
| 10437 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10438 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10440 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10441 | "$G_SRV -u" \ |
| 10442 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10443 | 0 \ |
| 10444 | -c "client hello, adding use_srtp extension" \ |
| 10445 | -C "found use_srtp extension" \ |
| 10446 | -C "found srtp profile" \ |
| 10447 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10448 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10449 | -C "error" |
| 10450 | |
| 10451 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10452 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10454 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10455 | "$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" \ |
| 10456 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10457 | 0 \ |
| 10458 | -c "client hello, adding use_srtp extension" \ |
| 10459 | -c "found use_srtp extension" \ |
| 10460 | -c "found srtp profile" \ |
| 10461 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10462 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10463 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10464 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10465 | -c "dumping 'received mki' (8 bytes)" \ |
| 10466 | -C "error" |
| 10467 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10468 | # Tests for specific things with "unreliable" UDP connection |
| 10469 | |
| 10470 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10472 | run_test "DTLS proxy: reference" \ |
| 10473 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10474 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10475 | "$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] | 10476 | 0 \ |
| 10477 | -C "replayed record" \ |
| 10478 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10479 | -C "Buffer record from epoch" \ |
| 10480 | -S "Buffer record from epoch" \ |
| 10481 | -C "ssl_buffer_message" \ |
| 10482 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10483 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10484 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10485 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10486 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10487 | -c "HTTP/1.0 200 OK" |
| 10488 | |
| 10489 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10491 | run_test "DTLS proxy: duplicate every packet" \ |
| 10492 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10493 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10494 | "$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] | 10495 | 0 \ |
| 10496 | -c "replayed record" \ |
| 10497 | -s "replayed record" \ |
| 10498 | -c "record from another epoch" \ |
| 10499 | -s "record from another epoch" \ |
| 10500 | -S "resend" \ |
| 10501 | -s "Extra-header:" \ |
| 10502 | -c "HTTP/1.0 200 OK" |
| 10503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10505 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10506 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10507 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10508 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10509 | 0 \ |
| 10510 | -c "replayed record" \ |
| 10511 | -S "replayed record" \ |
| 10512 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10513 | -s "record from another epoch" \ |
| 10514 | -c "resend" \ |
| 10515 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10516 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10517 | -c "HTTP/1.0 200 OK" |
| 10518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10520 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10521 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10522 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10523 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10524 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10525 | -c "next record in same datagram" \ |
| 10526 | -s "next record in same datagram" |
| 10527 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10529 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10530 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10531 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10532 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10533 | 0 \ |
| 10534 | -c "next record in same datagram" \ |
| 10535 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10536 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10537 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10538 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10539 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10540 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10541 | "$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] | 10542 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10543 | -c "discarding invalid record (mac)" \ |
| 10544 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10545 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10546 | -c "HTTP/1.0 200 OK" \ |
| 10547 | -S "too many records with bad MAC" \ |
| 10548 | -S "Verification of the message MAC failed" |
| 10549 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10551 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10552 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10553 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10554 | "$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] | 10555 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10556 | -C "discarding invalid record (mac)" \ |
| 10557 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10558 | -S "Extra-header:" \ |
| 10559 | -C "HTTP/1.0 200 OK" \ |
| 10560 | -s "too many records with bad MAC" \ |
| 10561 | -s "Verification of the message MAC failed" |
| 10562 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10564 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10565 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10566 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10567 | "$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] | 10568 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10569 | -c "discarding invalid record (mac)" \ |
| 10570 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10571 | -s "Extra-header:" \ |
| 10572 | -c "HTTP/1.0 200 OK" \ |
| 10573 | -S "too many records with bad MAC" \ |
| 10574 | -S "Verification of the message MAC failed" |
| 10575 | |
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 | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10577 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10578 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10579 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10580 | "$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] | 10581 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10582 | -c "discarding invalid record (mac)" \ |
| 10583 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10584 | -s "Extra-header:" \ |
| 10585 | -c "HTTP/1.0 200 OK" \ |
| 10586 | -s "too many records with bad MAC" \ |
| 10587 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10588 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10590 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10591 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10592 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10593 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10594 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10595 | -c "record from another epoch" \ |
| 10596 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10597 | -s "Extra-header:" \ |
| 10598 | -c "HTTP/1.0 200 OK" |
| 10599 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10600 | # Tests for reordering support with DTLS |
| 10601 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10602 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10604 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10605 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10606 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10607 | hs_timeout=2500-60000" \ |
| 10608 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10609 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10610 | 0 \ |
| 10611 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10612 | -c "Next handshake message has been buffered - load"\ |
| 10613 | -S "Buffering HS message" \ |
| 10614 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10615 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10616 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10617 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10618 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10619 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10620 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10622 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10623 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10624 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10625 | hs_timeout=2500-60000" \ |
| 10626 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10627 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10628 | 0 \ |
| 10629 | -c "Buffering HS message" \ |
| 10630 | -c "found fragmented DTLS handshake message"\ |
| 10631 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10632 | -c "Next handshake message has been buffered - load"\ |
| 10633 | -S "Buffering HS message" \ |
| 10634 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10635 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10636 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10637 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10638 | -S "Remember CCS message" |
| 10639 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10640 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10641 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10642 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10643 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10644 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10645 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10647 | 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] | 10648 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10649 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10650 | hs_timeout=2500-60000" \ |
| 10651 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10652 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10653 | 0 \ |
| 10654 | -c "Buffering HS message" \ |
| 10655 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10656 | -C "attempt to make space by freeing buffered messages" \ |
| 10657 | -S "Buffering HS message" \ |
| 10658 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10659 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10660 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10661 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10662 | -S "Remember CCS message" |
| 10663 | |
| 10664 | # The size constraints ensure that the delayed certificate message can't |
| 10665 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10666 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10667 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10668 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10669 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10671 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10672 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10673 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10674 | hs_timeout=2500-60000" \ |
| 10675 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10676 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10677 | 0 \ |
| 10678 | -c "Buffering HS message" \ |
| 10679 | -c "attempt to make space by freeing buffered future messages" \ |
| 10680 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10681 | -S "Buffering HS message" \ |
| 10682 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10683 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10684 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10685 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10686 | -S "Remember CCS message" |
| 10687 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10688 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10690 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10691 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10692 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10693 | hs_timeout=2500-60000" \ |
| 10694 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10695 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10696 | 0 \ |
| 10697 | -C "Buffering HS message" \ |
| 10698 | -C "Next handshake message has been buffered - load"\ |
| 10699 | -s "Buffering HS message" \ |
| 10700 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10701 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10702 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10703 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10704 | -S "Remember CCS message" |
| 10705 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10706 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10708 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10709 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10710 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10711 | hs_timeout=2500-60000" \ |
| 10712 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10713 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10714 | 0 \ |
| 10715 | -C "Buffering HS message" \ |
| 10716 | -C "Next handshake message has been buffered - load"\ |
| 10717 | -S "Buffering HS message" \ |
| 10718 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10719 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10720 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10721 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10722 | -S "Remember CCS message" |
| 10723 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10724 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10726 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10727 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10728 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10729 | hs_timeout=2500-60000" \ |
| 10730 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10731 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10732 | 0 \ |
| 10733 | -C "Buffering HS message" \ |
| 10734 | -C "Next handshake message has been buffered - load"\ |
| 10735 | -S "Buffering HS message" \ |
| 10736 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10737 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10738 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10739 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10740 | -s "Remember CCS message" |
| 10741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10743 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10744 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10745 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10746 | hs_timeout=2500-60000" \ |
| 10747 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10748 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10749 | 0 \ |
| 10750 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10751 | -s "Found buffered record from current epoch - load" \ |
| 10752 | -c "Buffer record from epoch 1" \ |
| 10753 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10754 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10755 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10756 | # from the server are delayed, so that the encrypted Finished message |
| 10757 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10758 | # in afterwards, the encrypted Finished message must be freed in order |
| 10759 | # to make space for the NewSessionTicket to be reassembled. |
| 10760 | # This works only in very particular circumstances: |
| 10761 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10762 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10763 | # the encrypted Finished message. |
| 10764 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10765 | # needs to be fragmented. |
| 10766 | # - All messages sent by the server must be small enough to be either sent |
| 10767 | # without fragmentation or be reassembled within the bounds of |
| 10768 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10769 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10770 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10771 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10773 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10774 | -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] | 10775 | "$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] | 10776 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10777 | 0 \ |
| 10778 | -s "Buffer record from epoch 1" \ |
| 10779 | -s "Found buffered record from current epoch - load" \ |
| 10780 | -c "Buffer record from epoch 1" \ |
| 10781 | -C "Found buffered record from current epoch - load" \ |
| 10782 | -c "Enough space available after freeing future epoch record" |
| 10783 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10784 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10785 | |
| 10786 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10788 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10789 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10790 | "$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] | 10791 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10792 | "$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] | 10793 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10794 | 0 \ |
| 10795 | -s "Extra-header:" \ |
| 10796 | -c "HTTP/1.0 200 OK" |
| 10797 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10798 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10800 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10801 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10802 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10803 | "$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] | 10804 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10805 | 0 \ |
| 10806 | -s "Extra-header:" \ |
| 10807 | -c "HTTP/1.0 200 OK" |
| 10808 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10809 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10811 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10812 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10813 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10814 | "$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] | 10815 | 0 \ |
| 10816 | -s "Extra-header:" \ |
| 10817 | -c "HTTP/1.0 200 OK" |
| 10818 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10819 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10821 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10822 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10823 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10824 | "$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] | 10825 | 0 \ |
| 10826 | -s "Extra-header:" \ |
| 10827 | -c "HTTP/1.0 200 OK" |
| 10828 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10829 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10831 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10832 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10833 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10834 | "$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] | 10835 | 0 \ |
| 10836 | -s "Extra-header:" \ |
| 10837 | -c "HTTP/1.0 200 OK" |
| 10838 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10839 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10841 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10842 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10843 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10844 | "$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] | 10845 | 0 \ |
| 10846 | -s "Extra-header:" \ |
| 10847 | -c "HTTP/1.0 200 OK" |
| 10848 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10849 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10851 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10852 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10853 | "$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] | 10854 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10855 | "$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] | 10856 | 0 \ |
| 10857 | -s "Extra-header:" \ |
| 10858 | -c "HTTP/1.0 200 OK" |
| 10859 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10860 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10861 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10862 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10863 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10864 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10865 | "$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] | 10866 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10867 | "$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] | 10868 | 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] | 10869 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10870 | 0 \ |
| 10871 | -s "a session has been resumed" \ |
| 10872 | -c "a session has been resumed" \ |
| 10873 | -s "Extra-header:" \ |
| 10874 | -c "HTTP/1.0 200 OK" |
| 10875 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10876 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10877 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10878 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10879 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10880 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10881 | "$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] | 10882 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10883 | "$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] | 10884 | 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] | 10885 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10886 | 0 \ |
| 10887 | -s "a session has been resumed" \ |
| 10888 | -c "a session has been resumed" \ |
| 10889 | -s "Extra-header:" \ |
| 10890 | -c "HTTP/1.0 200 OK" |
| 10891 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10892 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10893 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10895 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10896 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10897 | "$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] | 10898 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10899 | "$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] | 10900 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10901 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10902 | 0 \ |
| 10903 | -c "=> renegotiate" \ |
| 10904 | -s "=> renegotiate" \ |
| 10905 | -s "Extra-header:" \ |
| 10906 | -c "HTTP/1.0 200 OK" |
| 10907 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10908 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10909 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10911 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10912 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10913 | "$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] | 10914 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10915 | "$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] | 10916 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10917 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10918 | 0 \ |
| 10919 | -c "=> renegotiate" \ |
| 10920 | -s "=> renegotiate" \ |
| 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 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10925 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10927 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10928 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10929 | "$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] | 10930 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10931 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10932 | "$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] | 10933 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10934 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10935 | 0 \ |
| 10936 | -c "=> renegotiate" \ |
| 10937 | -s "=> renegotiate" \ |
| 10938 | -s "Extra-header:" \ |
| 10939 | -c "HTTP/1.0 200 OK" |
| 10940 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10941 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10942 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10943 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10944 | 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] | 10945 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10946 | "$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] | 10947 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10948 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10949 | "$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] | 10950 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10951 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10952 | 0 \ |
| 10953 | -c "=> renegotiate" \ |
| 10954 | -s "=> renegotiate" \ |
| 10955 | -s "Extra-header:" \ |
| 10956 | -c "HTTP/1.0 200 OK" |
| 10957 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10958 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 10959 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 10960 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 10961 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10962 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10963 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10965 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10966 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10967 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10968 | "$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] | 10969 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10970 | -c "HTTP/1.0 200 OK" |
| 10971 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10972 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10973 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10974 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10976 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10977 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10978 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10979 | "$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] | 10980 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10981 | -c "HTTP/1.0 200 OK" |
| 10982 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10983 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10984 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10985 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10987 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10988 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10989 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10990 | "$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] | 10991 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10992 | -c "HTTP/1.0 200 OK" |
| 10993 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10994 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10995 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10996 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10998 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10999 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11000 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11001 | "$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] | 11002 | 0 \ |
| 11003 | -s "Extra-header:" \ |
| 11004 | -c "Extra-header:" |
| 11005 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11006 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11007 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11008 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11010 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11011 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11012 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11013 | "$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] | 11014 | 0 \ |
| 11015 | -s "Extra-header:" \ |
| 11016 | -c "Extra-header:" |
| 11017 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11018 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11019 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11020 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11022 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11023 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11024 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11025 | "$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] | 11026 | 0 \ |
| 11027 | -s "Extra-header:" \ |
| 11028 | -c "Extra-header:" |
| 11029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11031 | run_test "export keys functionality" \ |
| 11032 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11033 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11034 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11035 | -c "EAP-TLS key material is:"\ |
| 11036 | -s "EAP-TLS key material is:"\ |
| 11037 | -c "EAP-TLS IV is:" \ |
| 11038 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11039 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11040 | # openssl feature tests: check if tls1.3 exists. |
| 11041 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11042 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11043 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11044 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11045 | 0 \ |
| 11046 | -c "TLS 1.3" \ |
| 11047 | -s "TLS 1.3" |
| 11048 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11049 | # 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] | 11050 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11051 | requires_gnutls_next_no_ticket |
| 11052 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11053 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11054 | "$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] | 11055 | "$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] | 11056 | 0 \ |
| 11057 | -s "Version: TLS1.3" \ |
| 11058 | -c "Version: TLS1.3" |
| 11059 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11060 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11061 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11065 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11066 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11067 | "$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] | 11068 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11069 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11070 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11071 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11072 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11073 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11074 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11075 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11076 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11077 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11078 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11079 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11080 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11081 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11082 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11083 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11084 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11085 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11086 | -c "=> parse certificate verify" \ |
| 11087 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11088 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11089 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11090 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11091 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11092 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11093 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11094 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11096 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11097 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11098 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11099 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11100 | "$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] | 11101 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11102 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11103 | -s "SERVER HELLO was queued" \ |
| 11104 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11105 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11106 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11107 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11108 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11109 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11110 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11111 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11112 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11113 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11114 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11115 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11116 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11117 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11118 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11119 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11120 | -c "=> parse certificate verify" \ |
| 11121 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11122 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11123 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11124 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11125 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11126 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11127 | requires_openssl_tls1_3 |
| 11128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11129 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11130 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11131 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11132 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11133 | run_test "TLS 1.3: alpn - openssl" \ |
| 11134 | "$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] | 11135 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11136 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11137 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11138 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11139 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11140 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11141 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11142 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11143 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11144 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11145 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11146 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11147 | -c "<= ssl_tls13_process_server_hello" \ |
| 11148 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11149 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11150 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11151 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11152 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11153 | -c "=> parse certificate verify" \ |
| 11154 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11155 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11156 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11157 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11158 | -c "HTTP/1.0 200 ok" \ |
| 11159 | -c "Application Layer Protocol is h2" |
| 11160 | |
| 11161 | requires_gnutls_tls1_3 |
| 11162 | requires_gnutls_next_no_ticket |
| 11163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11164 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11165 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11167 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11168 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11169 | "$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] | 11170 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11171 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11172 | -s "SERVER HELLO was queued" \ |
| 11173 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11174 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11175 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11176 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11177 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11178 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11179 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11180 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11181 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11182 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11183 | -c "<= ssl_tls13_process_server_hello" \ |
| 11184 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11185 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11186 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11187 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11188 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11189 | -c "=> parse certificate verify" \ |
| 11190 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11191 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11192 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11193 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11194 | -c "HTTP/1.0 200 OK" \ |
| 11195 | -c "Application Layer Protocol is h2" |
| 11196 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11197 | requires_openssl_tls1_3 |
| 11198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11199 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11200 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11201 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 11202 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11203 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11204 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11205 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11206 | -s "found alpn extension" \ |
| 11207 | -s "server side, adding alpn extension" \ |
| 11208 | -s "Protocol is TLSv1.3" \ |
| 11209 | -s "HTTP/1.0 200 OK" \ |
| 11210 | -s "Application Layer Protocol is h2" |
| 11211 | |
| 11212 | requires_gnutls_tls1_3 |
| 11213 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11214 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11215 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11216 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 11217 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11218 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11219 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11220 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11221 | -s "found alpn extension" \ |
| 11222 | -s "server side, adding alpn extension" \ |
| 11223 | -s "Protocol is TLSv1.3" \ |
| 11224 | -s "HTTP/1.0 200 OK" \ |
| 11225 | -s "Application Layer Protocol is h2" |
| 11226 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11228 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11229 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11230 | skip_handshake_stage_check |
| 11231 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11232 | 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] | 11233 | "$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] | 11234 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11235 | 1 \ |
| 11236 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11237 | -S "Version: TLS1.0" \ |
| 11238 | -C "Protocol is TLSv1.0" |
| 11239 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11241 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11242 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11243 | skip_handshake_stage_check |
| 11244 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11245 | 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] | 11246 | "$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] | 11247 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11248 | 1 \ |
| 11249 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11250 | -S "Version: TLS1.1" \ |
| 11251 | -C "Protocol is TLSv1.1" |
| 11252 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11254 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11255 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11256 | skip_handshake_stage_check |
| 11257 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11258 | 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] | 11259 | "$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] | 11260 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11261 | 1 \ |
| 11262 | -s "Client's version: 3.3" \ |
| 11263 | -c "is a fatal alert message (msg 40)" \ |
| 11264 | -S "Version: TLS1.2" \ |
| 11265 | -C "Protocol is TLSv1.2" |
| 11266 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11268 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11269 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11270 | skip_handshake_stage_check |
| 11271 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11272 | 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] | 11273 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11274 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11275 | 1 \ |
| 11276 | -s "fatal protocol_version" \ |
| 11277 | -c "is a fatal alert message (msg 70)" \ |
| 11278 | -S "Version: TLS1.0" \ |
| 11279 | -C "Protocol : TLSv1.0" |
| 11280 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11284 | skip_handshake_stage_check |
| 11285 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11286 | 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] | 11287 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11288 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11289 | 1 \ |
| 11290 | -s "fatal protocol_version" \ |
| 11291 | -c "is a fatal alert message (msg 70)" \ |
| 11292 | -S "Version: TLS1.1" \ |
| 11293 | -C "Protocol : TLSv1.1" |
| 11294 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11296 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11297 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11298 | skip_handshake_stage_check |
| 11299 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11300 | 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] | 11301 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11302 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11303 | 1 \ |
| 11304 | -s "fatal protocol_version" \ |
| 11305 | -c "is a fatal alert message (msg 70)" \ |
| 11306 | -S "Version: TLS1.2" \ |
| 11307 | -C "Protocol : TLSv1.2" |
| 11308 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11309 | requires_openssl_tls1_3 |
| 11310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11311 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11312 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11313 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11314 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11315 | "$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] | 11316 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11317 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11318 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11319 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11320 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11321 | -c "HTTP/1.0 200 ok" \ |
| 11322 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11323 | |
| 11324 | requires_gnutls_tls1_3 |
| 11325 | requires_gnutls_next_no_ticket |
| 11326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11327 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11328 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11329 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11330 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11331 | "$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] | 11332 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11333 | 0 \ |
| 11334 | -c "got a certificate request" \ |
| 11335 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11336 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11337 | -c "HTTP/1.0 200 OK" \ |
| 11338 | -c "Protocol is TLSv1.3" |
| 11339 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11340 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11341 | requires_openssl_tls1_3 |
| 11342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11343 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11344 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11345 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11346 | "$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] | 11347 | "$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] | 11348 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11349 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11350 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11351 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11352 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11353 | |
| 11354 | requires_gnutls_tls1_3 |
| 11355 | requires_gnutls_next_no_ticket |
| 11356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11357 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11358 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11359 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11360 | "$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] | 11361 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11362 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11363 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11364 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11365 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11366 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11367 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11368 | |
| 11369 | requires_openssl_tls1_3 |
| 11370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11371 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11372 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11373 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11374 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11375 | "$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] | 11376 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11377 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11378 | 0 \ |
| 11379 | -c "got a certificate request" \ |
| 11380 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11381 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11382 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11383 | |
| 11384 | requires_gnutls_tls1_3 |
| 11385 | requires_gnutls_next_no_ticket |
| 11386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11387 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11388 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11389 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11390 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11391 | "$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] | 11392 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11393 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11394 | 0 \ |
| 11395 | -c "got a certificate request" \ |
| 11396 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11397 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11398 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11399 | |
| 11400 | requires_openssl_tls1_3 |
| 11401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11402 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11403 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11404 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11405 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11406 | "$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] | 11407 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11408 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11409 | 0 \ |
| 11410 | -c "got a certificate request" \ |
| 11411 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11412 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11413 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11414 | |
| 11415 | requires_gnutls_tls1_3 |
| 11416 | requires_gnutls_next_no_ticket |
| 11417 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11418 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11419 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11420 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11421 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11422 | "$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] | 11423 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11424 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11425 | 0 \ |
| 11426 | -c "got a certificate request" \ |
| 11427 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11428 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11429 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11430 | |
| 11431 | requires_openssl_tls1_3 |
| 11432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11433 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11434 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11435 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11436 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11437 | "$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] | 11438 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11439 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11440 | 0 \ |
| 11441 | -c "got a certificate request" \ |
| 11442 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11443 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11444 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11445 | |
| 11446 | requires_gnutls_tls1_3 |
| 11447 | requires_gnutls_next_no_ticket |
| 11448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11449 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11450 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11451 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11452 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11453 | "$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] | 11454 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11455 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11456 | 0 \ |
| 11457 | -c "got a certificate request" \ |
| 11458 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11459 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11460 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11461 | |
| 11462 | requires_openssl_tls1_3 |
| 11463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11464 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11465 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11466 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11467 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11468 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11469 | "$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] | 11470 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11471 | 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] | 11472 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11473 | -c "got a certificate request" \ |
| 11474 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11475 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11476 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11477 | |
| 11478 | requires_gnutls_tls1_3 |
| 11479 | requires_gnutls_next_no_ticket |
| 11480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11481 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11482 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11483 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11484 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11485 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11486 | "$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] | 11487 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11488 | 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] | 11489 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11490 | -c "got a certificate request" \ |
| 11491 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11492 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11493 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11494 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11495 | requires_openssl_tls1_3 |
| 11496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11497 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11498 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11499 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11500 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11501 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11502 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11503 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11504 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11505 | 0 \ |
| 11506 | -c "got a certificate request" \ |
| 11507 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11508 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11509 | -c "Protocol is TLSv1.3" |
| 11510 | |
| 11511 | requires_gnutls_tls1_3 |
| 11512 | requires_gnutls_next_no_ticket |
| 11513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11514 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11515 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11516 | requires_config_enabled MBEDTLS_RSA_C |
| 11517 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11518 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11519 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11520 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11521 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11522 | 0 \ |
| 11523 | -c "got a certificate request" \ |
| 11524 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11525 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11526 | -c "Protocol is TLSv1.3" |
| 11527 | |
| 11528 | requires_openssl_tls1_3 |
| 11529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11530 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11531 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11532 | requires_config_enabled MBEDTLS_RSA_C |
| 11533 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11534 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11535 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11536 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11537 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11538 | 0 \ |
| 11539 | -c "got a certificate request" \ |
| 11540 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11541 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11542 | -c "Protocol is TLSv1.3" |
| 11543 | |
| 11544 | requires_gnutls_tls1_3 |
| 11545 | requires_gnutls_next_no_ticket |
| 11546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11548 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11549 | requires_config_enabled MBEDTLS_RSA_C |
| 11550 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11551 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11552 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11553 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11554 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11555 | 0 \ |
| 11556 | -c "got a certificate request" \ |
| 11557 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11558 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11559 | -c "Protocol is TLSv1.3" |
| 11560 | |
| 11561 | requires_openssl_tls1_3 |
| 11562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11563 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11564 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11565 | requires_config_enabled MBEDTLS_RSA_C |
| 11566 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11567 | 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] | 11568 | "$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] | 11569 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11570 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11571 | 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] | 11572 | 1 \ |
| 11573 | -c "got a certificate request" \ |
| 11574 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11575 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11576 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11577 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11578 | |
| 11579 | requires_gnutls_tls1_3 |
| 11580 | requires_gnutls_next_no_ticket |
| 11581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11582 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11583 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11584 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11585 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11586 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11587 | "$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] | 11588 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11589 | 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] | 11590 | 1 \ |
| 11591 | -c "got a certificate request" \ |
| 11592 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11593 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11594 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11595 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11596 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11597 | # Test using an opaque private key for client authentication |
| 11598 | requires_openssl_tls1_3 |
| 11599 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11600 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11601 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11602 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11603 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11604 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11605 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11606 | 0 \ |
| 11607 | -c "got a certificate request" \ |
| 11608 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11609 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11610 | -c "Protocol is TLSv1.3" |
| 11611 | |
| 11612 | requires_gnutls_tls1_3 |
| 11613 | requires_gnutls_next_no_ticket |
| 11614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11615 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11616 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11617 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11618 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11619 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11620 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11621 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11622 | 0 \ |
| 11623 | -c "got a certificate request" \ |
| 11624 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11625 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11626 | -c "Protocol is TLSv1.3" |
| 11627 | |
| 11628 | requires_openssl_tls1_3 |
| 11629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11630 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11631 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11632 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11633 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11634 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11635 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11636 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11637 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11638 | 0 \ |
| 11639 | -c "got a certificate request" \ |
| 11640 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11641 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11642 | -c "Protocol is TLSv1.3" |
| 11643 | |
| 11644 | requires_gnutls_tls1_3 |
| 11645 | requires_gnutls_next_no_ticket |
| 11646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11647 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11648 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11649 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11650 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11651 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11652 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11653 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11654 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11655 | 0 \ |
| 11656 | -c "got a certificate request" \ |
| 11657 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11658 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11659 | -c "Protocol is TLSv1.3" |
| 11660 | |
| 11661 | requires_openssl_tls1_3 |
| 11662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11663 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11664 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11665 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11666 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11667 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11668 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11669 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11670 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11671 | 0 \ |
| 11672 | -c "got a certificate request" \ |
| 11673 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11674 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11675 | -c "Protocol is TLSv1.3" |
| 11676 | |
| 11677 | requires_gnutls_tls1_3 |
| 11678 | requires_gnutls_next_no_ticket |
| 11679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11680 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11681 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11682 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11683 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11684 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11685 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11686 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11687 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11688 | 0 \ |
| 11689 | -c "got a certificate request" \ |
| 11690 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11691 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11692 | -c "Protocol is TLSv1.3" |
| 11693 | |
| 11694 | requires_openssl_tls1_3 |
| 11695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11696 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11697 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11698 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11700 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11701 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11702 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11703 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11704 | 0 \ |
| 11705 | -c "got a certificate request" \ |
| 11706 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11707 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11708 | -c "Protocol is TLSv1.3" |
| 11709 | |
| 11710 | requires_gnutls_tls1_3 |
| 11711 | requires_gnutls_next_no_ticket |
| 11712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11713 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11714 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11715 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11717 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11718 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11719 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11720 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11721 | 0 \ |
| 11722 | -c "got a certificate request" \ |
| 11723 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11724 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11725 | -c "Protocol is TLSv1.3" |
| 11726 | |
| 11727 | requires_openssl_tls1_3 |
| 11728 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11729 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11730 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11731 | requires_config_enabled MBEDTLS_RSA_C |
| 11732 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11733 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11734 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11735 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11736 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11737 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11738 | 0 \ |
| 11739 | -c "got a certificate request" \ |
| 11740 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11741 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11742 | -c "Protocol is TLSv1.3" |
| 11743 | |
| 11744 | requires_gnutls_tls1_3 |
| 11745 | requires_gnutls_next_no_ticket |
| 11746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11747 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11748 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11749 | requires_config_enabled MBEDTLS_RSA_C |
| 11750 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11751 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11752 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11753 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11754 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11755 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11756 | 0 \ |
| 11757 | -c "got a certificate request" \ |
| 11758 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11759 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11760 | -c "Protocol is TLSv1.3" |
| 11761 | |
| 11762 | requires_openssl_tls1_3 |
| 11763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11764 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11765 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11766 | requires_config_enabled MBEDTLS_RSA_C |
| 11767 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11768 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11769 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11770 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11771 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11772 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11773 | 0 \ |
| 11774 | -c "got a certificate request" \ |
| 11775 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11776 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11777 | -c "Protocol is TLSv1.3" |
| 11778 | |
| 11779 | requires_gnutls_tls1_3 |
| 11780 | requires_gnutls_next_no_ticket |
| 11781 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11782 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11783 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11784 | requires_config_enabled MBEDTLS_RSA_C |
| 11785 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11787 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11788 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11789 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11790 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11791 | 0 \ |
| 11792 | -c "got a certificate request" \ |
| 11793 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11794 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11795 | -c "Protocol is TLSv1.3" |
| 11796 | |
| 11797 | requires_openssl_tls1_3 |
| 11798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11799 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11800 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11801 | requires_config_enabled MBEDTLS_RSA_C |
| 11802 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11803 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11804 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11805 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11806 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11807 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11808 | 0 \ |
| 11809 | -c "got a certificate request" \ |
| 11810 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11811 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11812 | -c "Protocol is TLSv1.3" |
| 11813 | |
| 11814 | requires_gnutls_tls1_3 |
| 11815 | requires_gnutls_next_no_ticket |
| 11816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11817 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11818 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11819 | requires_config_enabled MBEDTLS_RSA_C |
| 11820 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11821 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11822 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_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 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11825 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 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 |
| 11833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11836 | requires_config_enabled MBEDTLS_RSA_C |
| 11837 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11838 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11839 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 11840 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11841 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11842 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11843 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11844 | 1 \ |
| 11845 | -c "got a certificate request" \ |
| 11846 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11847 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11848 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11849 | -C "unkown pk type" |
| 11850 | |
| 11851 | requires_gnutls_tls1_3 |
| 11852 | requires_gnutls_next_no_ticket |
| 11853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11854 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11855 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11856 | requires_config_enabled MBEDTLS_RSA_C |
| 11857 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11858 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11859 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11860 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11861 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11862 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11863 | 1 \ |
| 11864 | -c "got a certificate request" \ |
| 11865 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11866 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11867 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11868 | -C "unkown pk type" |
| 11869 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11871 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11872 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11873 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11874 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11875 | 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] | 11876 | "$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] | 11877 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11878 | 0 \ |
| 11879 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11880 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11881 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11882 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11883 | -c "HTTP/1.0 200 ok" |
| 11884 | |
| 11885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11886 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11887 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11888 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11889 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11890 | 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] | 11891 | "$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] | 11892 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11893 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11894 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11895 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11896 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11897 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11898 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11899 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11901 | requires_gnutls_tls1_3 |
| 11902 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11903 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11905 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11906 | 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] | 11907 | "$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] | 11908 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11909 | 0 \ |
| 11910 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11911 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11912 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11913 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11914 | -c "HTTP/1.0 200 OK" |
| 11915 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11916 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11917 | requires_gnutls_tls1_3 |
| 11918 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11919 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11922 | 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] | 11923 | "$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] | 11924 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11925 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11926 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11927 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11928 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11929 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11930 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11931 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11932 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11934 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11935 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11936 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11937 | "$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] | 11938 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 11939 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11940 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11941 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11942 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11943 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11944 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11945 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11946 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11947 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11948 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11950 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11951 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11952 | requires_openssl_tls1_3 |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11953 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11954 | "$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] | 11955 | "$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] | 11956 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11957 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11958 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11959 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11960 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11961 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11962 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11963 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11964 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11965 | -s "=> parse client hello" \ |
| 11966 | -s "<= parse client hello" |
| 11967 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11968 | requires_gnutls_tls1_3 |
| 11969 | requires_gnutls_next_no_ticket |
| 11970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11971 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11972 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11973 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11974 | "$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] | 11975 | "$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] | 11976 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11977 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11978 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11979 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11980 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11981 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11982 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11983 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11984 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11985 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11986 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11987 | requires_gnutls_tls1_3 |
| 11988 | requires_gnutls_next_no_ticket |
| 11989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11990 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11991 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11992 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11993 | "$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" \ |
| 11994 | "$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] | 11995 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11996 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11997 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11998 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11999 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12000 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12001 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12002 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12003 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12004 | -s "=> parse client hello" \ |
| 12005 | -s "<= parse client hello" |
| 12006 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12008 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12009 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12010 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12011 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12012 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12013 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12014 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12015 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12016 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12017 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12018 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12019 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12020 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12021 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12022 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12023 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12024 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12025 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12027 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12028 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12029 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12030 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12031 | "$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" \ |
| 12032 | "$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] | 12033 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12034 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12035 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12036 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12037 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12038 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12039 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12040 | -s "=> parse client hello" \ |
| 12041 | -s "<= parse client hello" |
| 12042 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12044 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12045 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12046 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12047 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12048 | "$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" \ |
| 12049 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12050 | 1 \ |
| 12051 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12052 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12053 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12054 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12055 | -s "=> write certificate request" \ |
| 12056 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12057 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12058 | -s "=> parse client hello" \ |
| 12059 | -s "<= parse client hello" |
| 12060 | |
| 12061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12062 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12063 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12064 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12065 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12066 | "$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" \ |
| 12067 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12068 | 0 \ |
| 12069 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12070 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12071 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12072 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12073 | -s "=> write certificate request" \ |
| 12074 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12075 | -s "=> parse client hello" \ |
| 12076 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12077 | |
| 12078 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12079 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12080 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12082 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12083 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12084 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12085 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12086 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12087 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12088 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12089 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12090 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12091 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12092 | -s "=> write hello retry request" \ |
| 12093 | -s "<= write hello retry request" |
| 12094 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12096 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12097 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12098 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12099 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12100 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12101 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12102 | 1 \ |
| 12103 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12104 | -s "No certificate available." |
| 12105 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12106 | requires_openssl_tls1_3 |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12108 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12109 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12110 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12111 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12112 | "$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] | 12113 | 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] | 12114 | "$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" \ |
| 12115 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12116 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12117 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12118 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12119 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12121 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12122 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12123 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12124 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12125 | "$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] | 12126 | 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] | 12127 | "$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" \ |
| 12128 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12129 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12130 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12131 | |
| 12132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12133 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12134 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12135 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12136 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12137 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12138 | "$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 \ |
| 12139 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12140 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12141 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12142 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12143 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12144 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12145 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12146 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12147 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12148 | TEST_SUITE_NAME=${i##*/} |
| 12149 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12150 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12151 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12152 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12153 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12154 | # Test 1.3 compatibility mode |
| 12155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12156 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12157 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12158 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12159 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12160 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12161 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12162 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12163 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12164 | -s "Protocol is TLSv1.3" \ |
| 12165 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12166 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12167 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12168 | |
| 12169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12170 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12171 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12172 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12173 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12174 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12175 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12176 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12177 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12178 | -s "Protocol is TLSv1.3" \ |
| 12179 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12180 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12181 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12182 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12183 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12185 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12186 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12187 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12188 | 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] | 12189 | "$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] | 12190 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12191 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12192 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12193 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12194 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12195 | |
| 12196 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12198 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12199 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12200 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12201 | 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] | 12202 | "$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] | 12203 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12204 | 1 \ |
| 12205 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12206 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12207 | requires_openssl_tls1_3 |
| 12208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12209 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12210 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12211 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12212 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12213 | "$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] | 12214 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12215 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12216 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12217 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12218 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12219 | requires_gnutls_tls1_3 |
| 12220 | requires_gnutls_next_no_ticket |
| 12221 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12223 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12224 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12225 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12226 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12227 | "$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] | 12228 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12229 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12230 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12231 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12232 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12233 | |
| 12234 | requires_gnutls_tls1_3 |
| 12235 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12237 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12238 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12239 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12240 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12241 | "$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] | 12242 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12243 | 1 \ |
| 12244 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12245 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12246 | requires_gnutls_tls1_3 |
| 12247 | requires_gnutls_next_no_ticket |
| 12248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12249 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12250 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12251 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12252 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12253 | "$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] | 12254 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12255 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12256 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12257 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12258 | |
| 12259 | requires_openssl_tls1_3 |
| 12260 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12261 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12262 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12263 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12264 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12265 | "$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] | 12266 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12267 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12268 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12269 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12270 | -C "14 03 03 00 01" |
| 12271 | |
| 12272 | requires_openssl_tls1_3 |
| 12273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12274 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12275 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12276 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12277 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12278 | "$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] | 12279 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12280 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12281 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12282 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12283 | |
| 12284 | requires_openssl_tls1_3 |
| 12285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12286 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12287 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12288 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12289 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12290 | "$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] | 12291 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12292 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12293 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12294 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12295 | -c "14 03 03 00 01" |
| 12296 | |
| 12297 | requires_gnutls_tls1_3 |
| 12298 | requires_gnutls_next_no_ticket |
| 12299 | requires_gnutls_next_disable_tls13_compat |
| 12300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12301 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12302 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12303 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12304 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12305 | "$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] | 12306 | "$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] | 12307 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12308 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12309 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12310 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12311 | |
| 12312 | requires_gnutls_tls1_3 |
| 12313 | requires_gnutls_next_no_ticket |
| 12314 | requires_gnutls_next_disable_tls13_compat |
| 12315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12316 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12317 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12318 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12319 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12320 | "$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] | 12321 | "$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] | 12322 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12323 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12324 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12325 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12326 | -c "discarding change cipher spec in TLS1.3" |
| 12327 | |
| 12328 | requires_gnutls_tls1_3 |
| 12329 | requires_gnutls_next_no_ticket |
| 12330 | requires_gnutls_next_disable_tls13_compat |
| 12331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12332 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12333 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12334 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12335 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12336 | "$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] | 12337 | "$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] | 12338 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12339 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12340 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12341 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12342 | |
| 12343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12344 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12345 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12346 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12347 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12348 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12349 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12350 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12351 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12352 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12353 | -c "Protocol is TLSv1.3" \ |
| 12354 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12355 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12356 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12357 | |
| 12358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12359 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12360 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12361 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12362 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12363 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12364 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12365 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12366 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12367 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12368 | -c "Protocol is TLSv1.3" \ |
| 12369 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12370 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12371 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12372 | |
| 12373 | requires_openssl_tls1_3 |
| 12374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12375 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12376 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12377 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12378 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12379 | "$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] | 12380 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12381 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12382 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12383 | -c "received HelloRetryRequest message" \ |
| 12384 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12385 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12386 | |
| 12387 | requires_openssl_tls1_3 |
| 12388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12389 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12390 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12391 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12392 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12393 | "$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] | 12394 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12395 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12396 | -c "received HelloRetryRequest message" \ |
| 12397 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12398 | |
| 12399 | requires_openssl_tls1_3 |
| 12400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12402 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12403 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12404 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12405 | "$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] | 12406 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12407 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12408 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12409 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12410 | |
| 12411 | requires_gnutls_tls1_3 |
| 12412 | requires_gnutls_next_no_ticket |
| 12413 | requires_gnutls_next_disable_tls13_compat |
| 12414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12415 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12416 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12417 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12418 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12419 | "$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] | 12420 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12421 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12422 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12423 | -c "received HelloRetryRequest message" \ |
| 12424 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12425 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12426 | |
| 12427 | requires_gnutls_tls1_3 |
| 12428 | requires_gnutls_next_no_ticket |
| 12429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12430 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12431 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12433 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12434 | "$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] | 12435 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12436 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12437 | -c "received HelloRetryRequest message" \ |
| 12438 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12439 | |
| 12440 | requires_gnutls_tls1_3 |
| 12441 | requires_gnutls_next_no_ticket |
| 12442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12443 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12444 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12445 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12446 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12447 | "$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] | 12448 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12449 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12450 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12451 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12452 | |
| 12453 | requires_openssl_tls1_3 |
| 12454 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12455 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12456 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12457 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12458 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12459 | "$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] | 12460 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12461 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12462 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12463 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12464 | -C "14 03 03 00 01" |
| 12465 | |
| 12466 | requires_openssl_tls1_3 |
| 12467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12468 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12469 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12470 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12471 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12472 | "$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] | 12473 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12474 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12475 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12476 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12477 | |
| 12478 | requires_openssl_tls1_3 |
| 12479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12480 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12481 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12482 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12483 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12484 | "$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] | 12485 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
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 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12488 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12489 | -c "14 03 03 00 01" |
| 12490 | |
| 12491 | requires_gnutls_tls1_3 |
| 12492 | requires_gnutls_next_no_ticket |
| 12493 | requires_gnutls_next_disable_tls13_compat |
| 12494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12495 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12496 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12497 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12498 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12499 | "$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] | 12500 | "$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] | 12501 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12502 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12503 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12504 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12505 | |
| 12506 | requires_gnutls_tls1_3 |
| 12507 | requires_gnutls_next_no_ticket |
| 12508 | requires_gnutls_next_disable_tls13_compat |
| 12509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12510 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12511 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12512 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12513 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12514 | "$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] | 12515 | "$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] | 12516 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12517 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12518 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12519 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12520 | -c "discarding change cipher spec in TLS1.3" |
| 12521 | |
| 12522 | requires_gnutls_tls1_3 |
| 12523 | requires_gnutls_next_no_ticket |
| 12524 | requires_gnutls_next_disable_tls13_compat |
| 12525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12526 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12527 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12528 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12529 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12530 | "$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] | 12531 | "$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] | 12532 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12533 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12534 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12535 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12536 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12537 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12539 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12540 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12541 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12542 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12543 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12544 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12545 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12546 | "$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] | 12547 | 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] | 12548 | 0 \ |
| 12549 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12550 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12551 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12552 | |
| 12553 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12555 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12556 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12557 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12558 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12559 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12560 | -d 4 |
| 12561 | --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 " \ |
| 12562 | "$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] | 12563 | 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] | 12564 | 0 \ |
| 12565 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12566 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12567 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12568 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12570 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12571 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12572 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12573 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12574 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12575 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12576 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12577 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12578 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12579 | "$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] | 12580 | 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] | 12581 | 0 \ |
| 12582 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12583 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12584 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12585 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12586 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12587 | |
| 12588 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12590 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12591 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12592 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12593 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12594 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12595 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12596 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12597 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12598 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12599 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12600 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12601 | 0 \ |
| 12602 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12603 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12604 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12605 | |
| 12606 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12608 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12609 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12610 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12611 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12612 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12613 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12614 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12615 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12616 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12617 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12618 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12619 | 0 \ |
| 12620 | -c "Negotiated version: 3.4" \ |
| 12621 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12622 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12623 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12624 | |
| 12625 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12627 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12628 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12629 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12630 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12631 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12632 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12633 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12634 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12635 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12636 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12637 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12638 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12639 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12640 | |
| 12641 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12643 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12644 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12645 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12646 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12647 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12648 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12649 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12650 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12651 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12652 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12653 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12654 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12655 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12656 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12658 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12659 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12660 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12661 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12662 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12663 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12664 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12665 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12666 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12667 | "$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] | 12668 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12669 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12670 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12671 | |
| 12672 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12674 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12675 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12676 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12677 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 12678 | "$P_SRV debug_level=4 force_version=tls13 |
| 12679 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12680 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12681 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12682 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12683 | 1 \ |
| 12684 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12685 | |
| 12686 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12688 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12689 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12690 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12691 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12692 | "$P_SRV debug_level=4 force_version=tls13 |
| 12693 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12694 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12695 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12696 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12697 | 1 \ |
| 12698 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12699 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12701 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12702 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12703 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12704 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12705 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12706 | "$P_SRV debug_level=4 force_version=tls13 |
| 12707 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12708 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12709 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12710 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12711 | 1 \ |
| 12712 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12713 | |
| 12714 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12716 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12717 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12718 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12719 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12720 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12721 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12722 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12723 | "$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] | 12724 | 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] | 12725 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12726 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12727 | |
| 12728 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12730 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12732 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12733 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12734 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12735 | -d 4 |
| 12736 | --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 " \ |
| 12737 | "$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] | 12738 | 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] | 12739 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12740 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12741 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12743 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12744 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12745 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12746 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12747 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12748 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12749 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12750 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12751 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12752 | "$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] | 12753 | 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] | 12754 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12755 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12756 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12757 | requires_openssl_tls1_3 |
| 12758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12759 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12760 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12761 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12762 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12763 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12764 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12765 | 0 \ |
| 12766 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12767 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12768 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12769 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12770 | -c "HTTP/1.0 200 ok" |
| 12771 | |
| 12772 | requires_gnutls_tls1_3 |
| 12773 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12774 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12775 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12776 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12777 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12778 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:+PSK --disable-client-cert" \ |
| 12779 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12780 | 0 \ |
| 12781 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12782 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12783 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12784 | -c "Reconnecting with saved session" \ |
| 12785 | -c "HTTP/1.0 200 OK" \ |
| 12786 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12787 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12788 | requires_openssl_tls1_3 |
| 12789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12790 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12791 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12792 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12793 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12794 | # https://github.com/openssl/openssl/issues/10714 |
| 12795 | # Until now, OpenSSL client does not support reconnect. |
| 12796 | skip_next_test |
| 12797 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12798 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12799 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 12800 | 0 \ |
| 12801 | -s "=> write NewSessionTicket msg" \ |
| 12802 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12803 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 12804 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12805 | requires_gnutls_tls1_3 |
| 12806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12807 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12808 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12809 | requires_config_enabled MBEDTLS_DEBUG_C |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12810 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12811 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12812 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12813 | "$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] | 12814 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12815 | -c "Connecting again- trying to resume previous session" \ |
| 12816 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12817 | -s "=> write NewSessionTicket msg" \ |
| 12818 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12819 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12820 | -s "key exchange mode: ephemeral" \ |
| 12821 | -s "key exchange mode: psk_ephemeral" \ |
| 12822 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12823 | |
| 12824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12825 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12826 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12827 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12828 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12829 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12830 | "$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] | 12831 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12832 | 0 \ |
| 12833 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12834 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12835 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12836 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12837 | -c "HTTP/1.0 200 OK" \ |
| 12838 | -s "=> write NewSessionTicket msg" \ |
| 12839 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12840 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
| 12841 | -s "key exchange mode: ephemeral" \ |
| 12842 | -s "key exchange mode: psk_ephemeral" \ |
| 12843 | -s "found pre_shared_key extension" |
| 12844 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 12845 | requires_openssl_tls1_3 |
| 12846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12847 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12848 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12849 | 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] | 12850 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12851 | -msg -tls1_2 |
| 12852 | -Verify 10 " \ |
| 12853 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12854 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12855 | min_version=tls12 max_version=tls13 " \ |
| 12856 | 0 \ |
| 12857 | -c "Protocol is TLSv1.2" \ |
| 12858 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12859 | |
| 12860 | |
| 12861 | requires_gnutls_tls1_3 |
| 12862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12863 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12864 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12865 | 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] | 12866 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12867 | -d 4 |
| 12868 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 12869 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12870 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12871 | min_version=tls12 max_version=tls13 " \ |
| 12872 | 0 \ |
| 12873 | -c "Protocol is TLSv1.2" \ |
| 12874 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12875 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 12876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12877 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12878 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12879 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12880 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12881 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame^] | 12882 | "$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] | 12883 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12884 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 12885 | 0 \ |
| 12886 | -c "Protocol is TLSv1.3" \ |
| 12887 | -c "got new session ticket." \ |
| 12888 | -c "Saving session for reuse... ok" \ |
| 12889 | -c "Reconnecting with saved session" \ |
| 12890 | -c "HTTP/1.0 200 OK" \ |
| 12891 | -s "=> write NewSessionTicket msg" \ |
| 12892 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12893 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
| 12894 | -s "key exchange mode: ephemeral" \ |
| 12895 | -s "key exchange mode: psk_ephemeral" \ |
| 12896 | -s "found pre_shared_key extension" |
| 12897 | |
| 12898 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12899 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12900 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12901 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12902 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12903 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame^] | 12904 | "$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] | 12905 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12906 | "$P_CLI debug_level=4 server_name=localhost rec_server_name=remote reco_mode=1 reconnect=1" \ |
| 12907 | 1 \ |
| 12908 | -c "Protocol is TLSv1.3" \ |
| 12909 | -c "got new session ticket." \ |
| 12910 | -c "Saving session for reuse... ok" \ |
| 12911 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | adf84a4 | 2022-10-09 09:21:22 +0000 | [diff] [blame] | 12912 | -c "hostname mismatch the session ticket, should not resume" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 12913 | -s "=> write NewSessionTicket msg" \ |
| 12914 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12915 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 12916 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12917 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12919 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 12920 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 12922 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12923 | run_tests_memory_after_hanshake |
| 12924 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 12925 | # Final report |
| 12926 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12927 | echo "------------------------------------------------------------------------" |
| 12928 | |
| 12929 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 12930 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12931 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 12932 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12933 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 12934 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 12935 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12936 | |
| 12937 | exit $FAILS |