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 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2045 | # Test using a RSA opaque private key for server authentication |
| 2046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2047 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2048 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2049 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2050 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2051 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2052 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2053 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2054 | 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] | 2055 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2056 | 0 \ |
| 2057 | -c "Verifying peer X.509 certificate... ok" \ |
| 2058 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2059 | -s "key types: Opaque, none" \ |
| 2060 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2061 | -S "error" \ |
| 2062 | -C "error" |
| 2063 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2065 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2066 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2067 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2068 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2069 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2070 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2071 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2072 | 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] | 2073 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2074 | 0 \ |
| 2075 | -c "Verifying peer X.509 certificate... ok" \ |
| 2076 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2077 | -s "key types: Opaque, none" \ |
| 2078 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2079 | -S "error" \ |
| 2080 | -C "error" |
| 2081 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2083 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2084 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2086 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2087 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2088 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2089 | psk=abc123 psk_identity=foo" \ |
| 2090 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2091 | psk=abc123 psk_identity=foo" \ |
| 2092 | 0 \ |
| 2093 | -c "Verifying peer X.509 certificate... ok" \ |
| 2094 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2095 | -s "key types: Opaque, Opaque" \ |
| 2096 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2097 | -S "error" \ |
| 2098 | -C "error" |
| 2099 | |
| 2100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2101 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2102 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_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: RSA-" \ |
| 2106 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2107 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2108 | 0 \ |
| 2109 | -c "Verifying peer X.509 certificate... ok" \ |
| 2110 | -c "Ciphersuite is TLS-RSA-" \ |
| 2111 | -s "key types: Opaque, Opaque" \ |
| 2112 | -s "Ciphersuite is TLS-RSA-" \ |
| 2113 | -S "error" \ |
| 2114 | -C "error" |
| 2115 | |
| 2116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2117 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2118 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2119 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2120 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2121 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2122 | 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] | 2123 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2124 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2125 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2126 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2127 | 1 \ |
| 2128 | -s "key types: Opaque, none" \ |
| 2129 | -s "got ciphersuites in common, but none of them usable" \ |
| 2130 | -s "error" \ |
| 2131 | -c "error" |
| 2132 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2134 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2135 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2136 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2137 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2138 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2139 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2140 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2141 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2142 | 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] | 2143 | crt_file2=data_files/server4.crt \ |
| 2144 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2145 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2146 | 0 \ |
| 2147 | -c "Verifying peer X.509 certificate... ok" \ |
| 2148 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2149 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2150 | -s "key types: Opaque, Opaque" \ |
| 2151 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2152 | -S "error" \ |
| 2153 | -C "error" |
| 2154 | |
| 2155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2156 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2157 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2158 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2159 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2160 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2161 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2162 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2163 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2164 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2165 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2166 | crt_file2=data_files/server4.crt \ |
| 2167 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2168 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2169 | 0 \ |
| 2170 | -c "Verifying peer X.509 certificate... ok" \ |
| 2171 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2172 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2173 | -s "key types: Opaque, Opaque" \ |
| 2174 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2175 | -S "error" \ |
| 2176 | -C "error" |
| 2177 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2178 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2181 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2182 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2183 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2184 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2185 | "$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] | 2186 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2187 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2188 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2189 | 0 \ |
| 2190 | -c "key type: Opaque" \ |
| 2191 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2192 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2193 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2194 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2195 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2196 | -S "error" \ |
| 2197 | -C "error" |
| 2198 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2199 | # Test using a RSA opaque private key for client/server authentication |
| 2200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2201 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2202 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2203 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2204 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2205 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2206 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2207 | "$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] | 2208 | 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] | 2209 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2210 | 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] | 2211 | 0 \ |
| 2212 | -c "key type: Opaque" \ |
| 2213 | -c "Verifying peer X.509 certificate... ok" \ |
| 2214 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2215 | -s "key types: Opaque, none" \ |
| 2216 | -s "Verifying peer X.509 certificate... ok" \ |
| 2217 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2218 | -S "error" \ |
| 2219 | -C "error" |
| 2220 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2222 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2223 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2224 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2225 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2226 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2227 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2228 | "$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] | 2229 | 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] | 2230 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2231 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2232 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2233 | 0 \ |
| 2234 | -c "key type: Opaque" \ |
| 2235 | -c "Verifying peer X.509 certificate... ok" \ |
| 2236 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2237 | -s "key types: Opaque, none" \ |
| 2238 | -s "Verifying peer X.509 certificate... ok" \ |
| 2239 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2240 | -S "error" \ |
| 2241 | -C "error" |
| 2242 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2243 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2244 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2245 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2246 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2247 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2248 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2249 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2250 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2251 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2252 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2253 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2254 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2255 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2257 | run_test_psa_force_curve "secp521r1" |
| 2258 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2259 | run_test_psa_force_curve "brainpoolP512r1" |
| 2260 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2261 | run_test_psa_force_curve "secp384r1" |
| 2262 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2263 | run_test_psa_force_curve "brainpoolP384r1" |
| 2264 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2265 | run_test_psa_force_curve "secp256r1" |
| 2266 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2267 | run_test_psa_force_curve "secp256k1" |
| 2268 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2269 | run_test_psa_force_curve "brainpoolP256r1" |
| 2270 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2271 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2272 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2273 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2274 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2275 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2276 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2277 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2278 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2280 | run_test_psa_force_curve "secp192r1" |
| 2281 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2282 | run_test_psa_force_curve "secp192k1" |
| 2283 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2284 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2286 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2287 | run_test "ServerHello contains gmt_unix_time" \ |
| 2288 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2289 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2290 | 0 \ |
| 2291 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2292 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2293 | |
| 2294 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2296 | run_test "Unique IV in GCM" \ |
| 2297 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2298 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2299 | 0 \ |
| 2300 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2301 | -U "IV used" |
| 2302 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2303 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2305 | run_test "Configuration-specific CRT verification callback" \ |
| 2306 | "$P_SRV debug_level=3" \ |
| 2307 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2308 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2309 | -S "error" \ |
| 2310 | -c "Verify requested for " \ |
| 2311 | -c "Use configuration-specific verification callback" \ |
| 2312 | -C "Use context-specific verification callback" \ |
| 2313 | -C "error" |
| 2314 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2316 | run_test "Context-specific CRT verification callback" \ |
| 2317 | "$P_SRV debug_level=3" \ |
| 2318 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2319 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2320 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2321 | -c "Verify requested for " \ |
| 2322 | -c "Use context-specific verification callback" \ |
| 2323 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2324 | -C "error" |
| 2325 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2326 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2328 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2329 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2330 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2331 | 1 \ |
| 2332 | -c "The certificate is signed with an unacceptable hash" |
| 2333 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2335 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2336 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2337 | "$P_CLI allow_sha1=1" \ |
| 2338 | 0 |
| 2339 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2341 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2342 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2343 | "$P_CLI allow_sha1=0" \ |
| 2344 | 0 |
| 2345 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2347 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2348 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2349 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2350 | 1 \ |
| 2351 | -s "The certificate is signed with an unacceptable hash" |
| 2352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2354 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2355 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2356 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2357 | 0 |
| 2358 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2360 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2361 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2362 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2363 | 0 |
| 2364 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2365 | # Dummy TLS 1.3 test |
| 2366 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2367 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2371 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2372 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2373 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2374 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2375 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2376 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2379 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2380 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2381 | 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] | 2382 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2383 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2384 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2385 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2389 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2390 | 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] | 2391 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2392 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2393 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2394 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2397 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2398 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2399 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2400 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2401 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2402 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2403 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2407 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2408 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2409 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2410 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2411 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2412 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2417 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2418 | "$P_SRV tls13_kex_modes=all" \ |
| 2419 | "$P_CLI tls13_kex_modes=all" \ |
| 2420 | 0 |
| 2421 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2422 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2424 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2425 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2426 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2427 | 0 \ |
| 2428 | -c "next record in same datagram" \ |
| 2429 | -s "next record in same datagram" |
| 2430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2432 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2433 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2434 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2435 | 0 \ |
| 2436 | -s "next record in same datagram" \ |
| 2437 | -C "next record in same datagram" |
| 2438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2440 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2441 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2442 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2443 | 0 \ |
| 2444 | -S "next record in same datagram" \ |
| 2445 | -c "next record in same datagram" |
| 2446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2448 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2449 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2450 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2451 | 0 \ |
| 2452 | -S "next record in same datagram" \ |
| 2453 | -C "next record in same datagram" |
| 2454 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2455 | # Tests for Context serialization |
| 2456 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2459 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2460 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2461 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2462 | 0 \ |
| 2463 | -c "Deserializing connection..." \ |
| 2464 | -S "Deserializing connection..." |
| 2465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2468 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2469 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2470 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2471 | 0 \ |
| 2472 | -c "Deserializing connection..." \ |
| 2473 | -S "Deserializing connection..." |
| 2474 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2477 | run_test "Context serialization, client serializes, GCM" \ |
| 2478 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2479 | "$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] | 2480 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2481 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2482 | -S "Deserializing connection..." |
| 2483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2486 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2487 | run_test "Context serialization, client serializes, with CID" \ |
| 2488 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2489 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2490 | 0 \ |
| 2491 | -c "Deserializing connection..." \ |
| 2492 | -S "Deserializing connection..." |
| 2493 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2495 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2496 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2497 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2498 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2499 | 0 \ |
| 2500 | -C "Deserializing connection..." \ |
| 2501 | -s "Deserializing connection..." |
| 2502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2505 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2506 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2507 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2508 | 0 \ |
| 2509 | -C "Deserializing connection..." \ |
| 2510 | -s "Deserializing connection..." |
| 2511 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2514 | run_test "Context serialization, server serializes, GCM" \ |
| 2515 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2516 | "$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] | 2517 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2518 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2519 | -s "Deserializing connection..." |
| 2520 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2524 | run_test "Context serialization, server serializes, with CID" \ |
| 2525 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2526 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2527 | 0 \ |
| 2528 | -C "Deserializing connection..." \ |
| 2529 | -s "Deserializing connection..." |
| 2530 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2533 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2534 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2535 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2536 | 0 \ |
| 2537 | -c "Deserializing connection..." \ |
| 2538 | -s "Deserializing connection..." |
| 2539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2542 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2543 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2544 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2545 | 0 \ |
| 2546 | -c "Deserializing connection..." \ |
| 2547 | -s "Deserializing connection..." |
| 2548 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2550 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2551 | run_test "Context serialization, both serialize, GCM" \ |
| 2552 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2553 | "$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] | 2554 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2555 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2556 | -s "Deserializing connection..." |
| 2557 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2560 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2561 | run_test "Context serialization, both serialize, with CID" \ |
| 2562 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2563 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2564 | 0 \ |
| 2565 | -c "Deserializing connection..." \ |
| 2566 | -s "Deserializing connection..." |
| 2567 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2569 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2570 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2571 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2572 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2573 | 0 \ |
| 2574 | -c "Deserializing connection..." \ |
| 2575 | -S "Deserializing connection..." |
| 2576 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2578 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2579 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2580 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2581 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2582 | 0 \ |
| 2583 | -c "Deserializing connection..." \ |
| 2584 | -S "Deserializing connection..." |
| 2585 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2587 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2588 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2589 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2590 | "$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] | 2591 | 0 \ |
| 2592 | -c "Deserializing connection..." \ |
| 2593 | -S "Deserializing connection..." |
| 2594 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2596 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2598 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2599 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2600 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2601 | 0 \ |
| 2602 | -c "Deserializing connection..." \ |
| 2603 | -S "Deserializing connection..." |
| 2604 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2607 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2608 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2609 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2610 | 0 \ |
| 2611 | -C "Deserializing connection..." \ |
| 2612 | -s "Deserializing connection..." |
| 2613 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2616 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2617 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2618 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2619 | 0 \ |
| 2620 | -C "Deserializing connection..." \ |
| 2621 | -s "Deserializing connection..." |
| 2622 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2625 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2626 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2627 | "$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] | 2628 | 0 \ |
| 2629 | -C "Deserializing connection..." \ |
| 2630 | -s "Deserializing connection..." |
| 2631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2633 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2634 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2635 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2636 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2637 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2638 | 0 \ |
| 2639 | -C "Deserializing connection..." \ |
| 2640 | -s "Deserializing connection..." |
| 2641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2643 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2644 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2645 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2646 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2647 | 0 \ |
| 2648 | -c "Deserializing connection..." \ |
| 2649 | -s "Deserializing connection..." |
| 2650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2652 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2653 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2654 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2655 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2656 | 0 \ |
| 2657 | -c "Deserializing connection..." \ |
| 2658 | -s "Deserializing connection..." |
| 2659 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2661 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2662 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2663 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2664 | "$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] | 2665 | 0 \ |
| 2666 | -c "Deserializing connection..." \ |
| 2667 | -s "Deserializing connection..." |
| 2668 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2671 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2672 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2673 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2674 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2675 | 0 \ |
| 2676 | -c "Deserializing connection..." \ |
| 2677 | -s "Deserializing connection..." |
| 2678 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2680 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2681 | run_test "Saving the serialized context to a file" \ |
| 2682 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2683 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2684 | 0 \ |
| 2685 | -s "Save serialized context to a file... ok" \ |
| 2686 | -c "Save serialized context to a file... ok" |
| 2687 | rm -f context_srv.txt |
| 2688 | rm -f context_cli.txt |
| 2689 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2690 | # Tests for DTLS Connection ID extension |
| 2691 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2692 | # So far, the CID API isn't implemented, so we can't |
| 2693 | # grep for output witnessing its use. This needs to be |
| 2694 | # changed once the CID extension is implemented. |
| 2695 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2697 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2698 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2699 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2700 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2701 | 0 \ |
| 2702 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2703 | -s "found CID extension" \ |
| 2704 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2705 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2706 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2707 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2708 | -C "found CID extension" \ |
| 2709 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2710 | -C "Copy CIDs into SSL transform" \ |
| 2711 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2714 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2715 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2716 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2717 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2718 | 0 \ |
| 2719 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2720 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2721 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2722 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2723 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2724 | -C "found CID extension" \ |
| 2725 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2726 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2727 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2728 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2729 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2730 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2731 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2732 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2733 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2734 | 0 \ |
| 2735 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2736 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2737 | -c "client hello, adding CID extension" \ |
| 2738 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2739 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2740 | -s "server hello, adding CID extension" \ |
| 2741 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2742 | -c "Use of CID extension negotiated" \ |
| 2743 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2744 | -c "Copy CIDs into SSL transform" \ |
| 2745 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2746 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2747 | -s "Use of Connection ID has been negotiated" \ |
| 2748 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2751 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2752 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2753 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2754 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2755 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2756 | 0 \ |
| 2757 | -c "Enable use of CID extension." \ |
| 2758 | -s "Enable use of CID extension." \ |
| 2759 | -c "client hello, adding CID extension" \ |
| 2760 | -s "found CID extension" \ |
| 2761 | -s "Use of CID extension negotiated" \ |
| 2762 | -s "server hello, adding CID extension" \ |
| 2763 | -c "found CID extension" \ |
| 2764 | -c "Use of CID extension negotiated" \ |
| 2765 | -s "Copy CIDs into SSL transform" \ |
| 2766 | -c "Copy CIDs into SSL transform" \ |
| 2767 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2768 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2769 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2770 | -c "Use of Connection ID has been negotiated" \ |
| 2771 | -c "ignoring unexpected CID" \ |
| 2772 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2775 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2776 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2777 | -p "$P_PXY mtu=800" \ |
| 2778 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2779 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2780 | 0 \ |
| 2781 | -c "Enable use of CID extension." \ |
| 2782 | -s "Enable use of CID extension." \ |
| 2783 | -c "client hello, adding CID extension" \ |
| 2784 | -s "found CID extension" \ |
| 2785 | -s "Use of CID extension negotiated" \ |
| 2786 | -s "server hello, adding CID extension" \ |
| 2787 | -c "found CID extension" \ |
| 2788 | -c "Use of CID extension negotiated" \ |
| 2789 | -s "Copy CIDs into SSL transform" \ |
| 2790 | -c "Copy CIDs into SSL transform" \ |
| 2791 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2792 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2793 | -s "Use of Connection ID has been negotiated" \ |
| 2794 | -c "Use of Connection ID has been negotiated" |
| 2795 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2796 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2797 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2798 | 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] | 2799 | -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] | 2800 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2801 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2802 | 0 \ |
| 2803 | -c "Enable use of CID extension." \ |
| 2804 | -s "Enable use of CID extension." \ |
| 2805 | -c "client hello, adding CID extension" \ |
| 2806 | -s "found CID extension" \ |
| 2807 | -s "Use of CID extension negotiated" \ |
| 2808 | -s "server hello, adding CID extension" \ |
| 2809 | -c "found CID extension" \ |
| 2810 | -c "Use of CID extension negotiated" \ |
| 2811 | -s "Copy CIDs into SSL transform" \ |
| 2812 | -c "Copy CIDs into SSL transform" \ |
| 2813 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2814 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2815 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2816 | -c "Use of Connection ID has been negotiated" \ |
| 2817 | -c "ignoring unexpected CID" \ |
| 2818 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2821 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2822 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2823 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2824 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2825 | 0 \ |
| 2826 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2827 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2828 | -c "client hello, adding CID extension" \ |
| 2829 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2830 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2831 | -s "server hello, adding CID extension" \ |
| 2832 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2833 | -c "Use of CID extension negotiated" \ |
| 2834 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2835 | -c "Copy CIDs into SSL transform" \ |
| 2836 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2837 | -s "Peer CID (length 0 Bytes):" \ |
| 2838 | -s "Use of Connection ID has been negotiated" \ |
| 2839 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2840 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2842 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2843 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2844 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2845 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2846 | 0 \ |
| 2847 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2848 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2849 | -c "client hello, adding CID extension" \ |
| 2850 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2851 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2852 | -s "server hello, adding CID extension" \ |
| 2853 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2854 | -c "Use of CID extension negotiated" \ |
| 2855 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2856 | -c "Copy CIDs into SSL transform" \ |
| 2857 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2858 | -c "Peer CID (length 0 Bytes):" \ |
| 2859 | -s "Use of Connection ID has been negotiated" \ |
| 2860 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2863 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2864 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2865 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2866 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2867 | 0 \ |
| 2868 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2869 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2870 | -c "client hello, adding CID extension" \ |
| 2871 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2872 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2873 | -s "server hello, adding CID extension" \ |
| 2874 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2875 | -c "Use of CID extension negotiated" \ |
| 2876 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2877 | -c "Copy CIDs into SSL transform" \ |
| 2878 | -S "Use of Connection ID has been negotiated" \ |
| 2879 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2880 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2882 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2883 | 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] | 2884 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2885 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2886 | 0 \ |
| 2887 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2888 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2889 | -c "client hello, adding CID extension" \ |
| 2890 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2891 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2892 | -s "server hello, adding CID extension" \ |
| 2893 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2894 | -c "Use of CID extension negotiated" \ |
| 2895 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2896 | -c "Copy CIDs into SSL transform" \ |
| 2897 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2898 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2899 | -s "Use of Connection ID has been negotiated" \ |
| 2900 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2901 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2903 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2904 | 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] | 2905 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2906 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2907 | 0 \ |
| 2908 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2909 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2910 | -c "client hello, adding CID extension" \ |
| 2911 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2912 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2913 | -s "server hello, adding CID extension" \ |
| 2914 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2915 | -c "Use of CID extension negotiated" \ |
| 2916 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2917 | -c "Copy CIDs into SSL transform" \ |
| 2918 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2919 | -s "Peer CID (length 0 Bytes):" \ |
| 2920 | -s "Use of Connection ID has been negotiated" \ |
| 2921 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2922 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2924 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2925 | 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] | 2926 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2927 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2928 | 0 \ |
| 2929 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2930 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2931 | -c "client hello, adding CID extension" \ |
| 2932 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2933 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2934 | -s "server hello, adding CID extension" \ |
| 2935 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2936 | -c "Use of CID extension negotiated" \ |
| 2937 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2938 | -c "Copy CIDs into SSL transform" \ |
| 2939 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2940 | -c "Peer CID (length 0 Bytes):" \ |
| 2941 | -s "Use of Connection ID has been negotiated" \ |
| 2942 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2943 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2945 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2946 | 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] | 2947 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2948 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2949 | 0 \ |
| 2950 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2951 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2952 | -c "client hello, adding CID extension" \ |
| 2953 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2954 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2955 | -s "server hello, adding CID extension" \ |
| 2956 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2957 | -c "Use of CID extension negotiated" \ |
| 2958 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2959 | -c "Copy CIDs into SSL transform" \ |
| 2960 | -S "Use of Connection ID has been negotiated" \ |
| 2961 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2962 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2963 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2964 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2965 | 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] | 2966 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2967 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2968 | 0 \ |
| 2969 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2970 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2971 | -c "client hello, adding CID extension" \ |
| 2972 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2973 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2974 | -s "server hello, adding CID extension" \ |
| 2975 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2976 | -c "Use of CID extension negotiated" \ |
| 2977 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2978 | -c "Copy CIDs into SSL transform" \ |
| 2979 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2980 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2981 | -s "Use of Connection ID has been negotiated" \ |
| 2982 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2985 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2986 | 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] | 2987 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2988 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2989 | 0 \ |
| 2990 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2991 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2992 | -c "client hello, adding CID extension" \ |
| 2993 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2994 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2995 | -s "server hello, adding CID extension" \ |
| 2996 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2997 | -c "Use of CID extension negotiated" \ |
| 2998 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2999 | -c "Copy CIDs into SSL transform" \ |
| 3000 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3001 | -s "Peer CID (length 0 Bytes):" \ |
| 3002 | -s "Use of Connection ID has been negotiated" \ |
| 3003 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3004 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3006 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3007 | 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] | 3008 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3009 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3010 | 0 \ |
| 3011 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3012 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3013 | -c "client hello, adding CID extension" \ |
| 3014 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3015 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3016 | -s "server hello, adding CID extension" \ |
| 3017 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3018 | -c "Use of CID extension negotiated" \ |
| 3019 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3020 | -c "Copy CIDs into SSL transform" \ |
| 3021 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3022 | -c "Peer CID (length 0 Bytes):" \ |
| 3023 | -s "Use of Connection ID has been negotiated" \ |
| 3024 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3025 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3027 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3028 | 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] | 3029 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3030 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3031 | 0 \ |
| 3032 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3033 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3034 | -c "client hello, adding CID extension" \ |
| 3035 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3036 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3037 | -s "server hello, adding CID extension" \ |
| 3038 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3039 | -c "Use of CID extension negotiated" \ |
| 3040 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3041 | -c "Copy CIDs into SSL transform" \ |
| 3042 | -S "Use of Connection ID has been negotiated" \ |
| 3043 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3044 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3046 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3048 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3049 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3050 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3051 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3052 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3053 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3054 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3055 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3056 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3057 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3058 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3059 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3060 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3062 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3064 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3065 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3066 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3067 | 0 \ |
| 3068 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3069 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3070 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3071 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3072 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3073 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3074 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3075 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3076 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3080 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3081 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3082 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3083 | 0 \ |
| 3084 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3085 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3086 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3087 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3088 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3089 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3090 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3091 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3092 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3094 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3095 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3096 | 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] | 3097 | -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] | 3098 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3099 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3100 | 0 \ |
| 3101 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3102 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3103 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3104 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3105 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3106 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3107 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3108 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3109 | -c "ignoring unexpected CID" \ |
| 3110 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3115 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3116 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3117 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3118 | 0 \ |
| 3119 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3120 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3121 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3122 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3123 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3124 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3125 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3126 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3127 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3130 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3131 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3132 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3133 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3134 | 0 \ |
| 3135 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3136 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3137 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3138 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3139 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3140 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3141 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3142 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3145 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3146 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3147 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3148 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3149 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3150 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3151 | 0 \ |
| 3152 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3153 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3154 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3155 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3156 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3157 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3158 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3159 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3160 | -c "ignoring unexpected CID" \ |
| 3161 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3164 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3166 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3167 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3168 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3169 | 0 \ |
| 3170 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3171 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3172 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3173 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3174 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3175 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3180 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3181 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3182 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3183 | 0 \ |
| 3184 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3185 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3186 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3187 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3188 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3189 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3192 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3193 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3194 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3195 | -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] | 3196 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3197 | "$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" \ |
| 3198 | 0 \ |
| 3199 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3200 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3201 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3202 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3203 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3204 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3205 | -c "ignoring unexpected CID" \ |
| 3206 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3207 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3210 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3211 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3212 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3213 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3214 | 0 \ |
| 3215 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3216 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3217 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3218 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3219 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3220 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3221 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3222 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3223 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3224 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3226 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3227 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3228 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3229 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3232 | 0 \ |
| 3233 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3234 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3235 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3236 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3237 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3238 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3239 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3240 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3241 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3242 | -c "ignoring unexpected CID" \ |
| 3243 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3244 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3246 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3247 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3248 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3249 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3250 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3251 | 0 \ |
| 3252 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3253 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3254 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3255 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3256 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3257 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3258 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3259 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3260 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3263 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3264 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3265 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3266 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3267 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3268 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3269 | 0 \ |
| 3270 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3271 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3272 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3273 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3274 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3275 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3276 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3277 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3278 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3279 | -c "ignoring unexpected CID" \ |
| 3280 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3281 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3282 | # 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] | 3283 | # tests check that the buffer contents are reallocated when the message is |
| 3284 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3287 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3288 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3289 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3290 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3291 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3292 | 0 \ |
| 3293 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3294 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3295 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3296 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3297 | -s "Reallocating in_buf" \ |
| 3298 | -s "Reallocating out_buf" |
| 3299 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3302 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3303 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3304 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3305 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3306 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3307 | 0 \ |
| 3308 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3309 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3310 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3311 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3312 | -s "Reallocating in_buf" \ |
| 3313 | -s "Reallocating out_buf" |
| 3314 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3315 | # Tests for Encrypt-then-MAC extension |
| 3316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3318 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3319 | "$P_SRV debug_level=3 \ |
| 3320 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3321 | "$P_CLI debug_level=3" \ |
| 3322 | 0 \ |
| 3323 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3324 | -s "found encrypt then mac extension" \ |
| 3325 | -s "server hello, adding encrypt then mac extension" \ |
| 3326 | -c "found encrypt_then_mac extension" \ |
| 3327 | -c "using encrypt then mac" \ |
| 3328 | -s "using encrypt then mac" |
| 3329 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3331 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3332 | "$P_SRV debug_level=3 etm=0 \ |
| 3333 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3334 | "$P_CLI debug_level=3 etm=1" \ |
| 3335 | 0 \ |
| 3336 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3337 | -s "found encrypt then mac extension" \ |
| 3338 | -S "server hello, adding encrypt then mac extension" \ |
| 3339 | -C "found encrypt_then_mac extension" \ |
| 3340 | -C "using encrypt then mac" \ |
| 3341 | -S "using encrypt then mac" |
| 3342 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3344 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3345 | "$P_SRV debug_level=3 etm=1 \ |
| 3346 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3347 | "$P_CLI debug_level=3 etm=1" \ |
| 3348 | 0 \ |
| 3349 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3350 | -s "found encrypt then mac extension" \ |
| 3351 | -S "server hello, adding encrypt then mac extension" \ |
| 3352 | -C "found encrypt_then_mac extension" \ |
| 3353 | -C "using encrypt then mac" \ |
| 3354 | -S "using encrypt then mac" |
| 3355 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3357 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 etm=1 \ |
| 3359 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3360 | "$P_CLI debug_level=3 etm=0" \ |
| 3361 | 0 \ |
| 3362 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3363 | -S "found encrypt then mac extension" \ |
| 3364 | -S "server hello, adding encrypt then mac extension" \ |
| 3365 | -C "found encrypt_then_mac extension" \ |
| 3366 | -C "using encrypt then mac" \ |
| 3367 | -S "using encrypt then mac" |
| 3368 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3369 | # Tests for Extended Master Secret extension |
| 3370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3373 | run_test "Extended Master Secret: default" \ |
| 3374 | "$P_SRV debug_level=3" \ |
| 3375 | "$P_CLI debug_level=3" \ |
| 3376 | 0 \ |
| 3377 | -c "client hello, adding extended_master_secret extension" \ |
| 3378 | -s "found extended master secret extension" \ |
| 3379 | -s "server hello, adding extended master secret extension" \ |
| 3380 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3381 | -c "session hash for extended master secret" \ |
| 3382 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3386 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3387 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3388 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3389 | 0 \ |
| 3390 | -c "client hello, adding extended_master_secret extension" \ |
| 3391 | -s "found extended master secret extension" \ |
| 3392 | -S "server hello, adding extended master secret extension" \ |
| 3393 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3394 | -C "session hash for extended master secret" \ |
| 3395 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3398 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3399 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3400 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3401 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3402 | 0 \ |
| 3403 | -C "client hello, adding extended_master_secret extension" \ |
| 3404 | -S "found extended master secret extension" \ |
| 3405 | -S "server hello, adding extended master secret extension" \ |
| 3406 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3407 | -C "session hash for extended master secret" \ |
| 3408 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3409 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3410 | # Test sending and receiving empty application data records |
| 3411 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3413 | run_test "Encrypt then MAC: empty application data record" \ |
| 3414 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3415 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3416 | 0 \ |
| 3417 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3418 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3419 | -c "0 bytes written in 1 fragments" |
| 3420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3422 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3423 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3424 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3425 | 0 \ |
| 3426 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3427 | -c "0 bytes written in 1 fragments" |
| 3428 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3430 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3431 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3432 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3433 | 0 \ |
| 3434 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3435 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3436 | -c "0 bytes written in 1 fragments" |
| 3437 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3439 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3440 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3441 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3442 | 0 \ |
| 3443 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3444 | -c "0 bytes written in 1 fragments" |
| 3445 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3446 | # Tests for CBC 1/n-1 record splitting |
| 3447 | |
| 3448 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3449 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3450 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3451 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3452 | 0 \ |
| 3453 | -s "Read from client: 123 bytes read" \ |
| 3454 | -S "Read from client: 1 bytes read" \ |
| 3455 | -S "122 bytes read" |
| 3456 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3457 | # Tests for Session Tickets |
| 3458 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3460 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3461 | "$P_SRV debug_level=3 tickets=1" \ |
| 3462 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3463 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3464 | -c "client hello, adding session ticket extension" \ |
| 3465 | -s "found session ticket extension" \ |
| 3466 | -s "server hello, adding session ticket extension" \ |
| 3467 | -c "found session_ticket extension" \ |
| 3468 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3469 | -S "session successfully restored from cache" \ |
| 3470 | -s "session successfully restored from ticket" \ |
| 3471 | -s "a session has been resumed" \ |
| 3472 | -c "a session has been resumed" |
| 3473 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3475 | run_test "Session resume using tickets: manual rotation" \ |
| 3476 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3477 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3478 | 0 \ |
| 3479 | -c "client hello, adding session ticket extension" \ |
| 3480 | -s "found session ticket extension" \ |
| 3481 | -s "server hello, adding session ticket extension" \ |
| 3482 | -c "found session_ticket extension" \ |
| 3483 | -c "parse new session ticket" \ |
| 3484 | -S "session successfully restored from cache" \ |
| 3485 | -s "session successfully restored from ticket" \ |
| 3486 | -s "a session has been resumed" \ |
| 3487 | -c "a session has been resumed" |
| 3488 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3490 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3491 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3492 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3493 | 0 \ |
| 3494 | -c "client hello, adding session ticket extension" \ |
| 3495 | -s "found session ticket extension" \ |
| 3496 | -s "server hello, adding session ticket extension" \ |
| 3497 | -c "found session_ticket extension" \ |
| 3498 | -c "parse new session ticket" \ |
| 3499 | -S "session successfully restored from cache" \ |
| 3500 | -s "session successfully restored from ticket" \ |
| 3501 | -s "a session has been resumed" \ |
| 3502 | -c "a session has been resumed" |
| 3503 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3505 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3506 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3507 | "$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] | 3508 | 0 \ |
| 3509 | -c "client hello, adding session ticket extension" \ |
| 3510 | -s "found session ticket extension" \ |
| 3511 | -s "server hello, adding session ticket extension" \ |
| 3512 | -c "found session_ticket extension" \ |
| 3513 | -c "parse new session ticket" \ |
| 3514 | -S "session successfully restored from cache" \ |
| 3515 | -S "session successfully restored from ticket" \ |
| 3516 | -S "a session has been resumed" \ |
| 3517 | -C "a session has been resumed" |
| 3518 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3520 | run_test "Session resume using tickets: session copy" \ |
| 3521 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3522 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3523 | 0 \ |
| 3524 | -c "client hello, adding session ticket extension" \ |
| 3525 | -s "found session ticket extension" \ |
| 3526 | -s "server hello, adding session ticket extension" \ |
| 3527 | -c "found session_ticket extension" \ |
| 3528 | -c "parse new session ticket" \ |
| 3529 | -S "session successfully restored from cache" \ |
| 3530 | -s "session successfully restored from ticket" \ |
| 3531 | -s "a session has been resumed" \ |
| 3532 | -c "a session has been resumed" |
| 3533 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3535 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3536 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3537 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3538 | 0 \ |
| 3539 | -c "client hello, adding session ticket extension" \ |
| 3540 | -c "found session_ticket extension" \ |
| 3541 | -c "parse new session ticket" \ |
| 3542 | -c "a session has been resumed" |
| 3543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3545 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3546 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3547 | "( $O_CLI -sess_out $SESSION; \ |
| 3548 | $O_CLI -sess_in $SESSION; \ |
| 3549 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3550 | 0 \ |
| 3551 | -s "found session ticket extension" \ |
| 3552 | -s "server hello, adding session ticket extension" \ |
| 3553 | -S "session successfully restored from cache" \ |
| 3554 | -s "session successfully restored from ticket" \ |
| 3555 | -s "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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3558 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3559 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3560 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3573 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3574 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3575 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 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 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3588 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3589 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3590 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3591 | 0 \ |
| 3592 | -c "client hello, adding session ticket extension" \ |
| 3593 | -s "found session ticket extension" \ |
| 3594 | -s "server hello, adding session ticket extension" \ |
| 3595 | -c "found session_ticket extension" \ |
| 3596 | -c "parse new session ticket" \ |
| 3597 | -S "session successfully restored from cache" \ |
| 3598 | -s "session successfully restored from ticket" \ |
| 3599 | -s "a session has been resumed" \ |
| 3600 | -c "a session has been resumed" |
| 3601 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3603 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3604 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3605 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3606 | 0 \ |
| 3607 | -c "client hello, adding session ticket extension" \ |
| 3608 | -s "found session ticket extension" \ |
| 3609 | -s "server hello, adding session ticket extension" \ |
| 3610 | -c "found session_ticket extension" \ |
| 3611 | -c "parse new session ticket" \ |
| 3612 | -S "session successfully restored from cache" \ |
| 3613 | -s "session successfully restored from ticket" \ |
| 3614 | -s "a session has been resumed" \ |
| 3615 | -c "a session has been resumed" |
| 3616 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3618 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3619 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3620 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3621 | 0 \ |
| 3622 | -c "client hello, adding session ticket extension" \ |
| 3623 | -s "found session ticket extension" \ |
| 3624 | -s "server hello, adding session ticket extension" \ |
| 3625 | -c "found session_ticket extension" \ |
| 3626 | -c "parse new session ticket" \ |
| 3627 | -S "session successfully restored from cache" \ |
| 3628 | -s "session successfully restored from ticket" \ |
| 3629 | -s "a session has been resumed" \ |
| 3630 | -c "a session has been resumed" |
| 3631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3633 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3634 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3635 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3636 | 0 \ |
| 3637 | -c "client hello, adding session ticket extension" \ |
| 3638 | -s "found session ticket extension" \ |
| 3639 | -s "server hello, adding session ticket extension" \ |
| 3640 | -c "found session_ticket extension" \ |
| 3641 | -c "parse new session ticket" \ |
| 3642 | -S "session successfully restored from cache" \ |
| 3643 | -s "session successfully restored from ticket" \ |
| 3644 | -s "a session has been resumed" \ |
| 3645 | -c "a session has been resumed" |
| 3646 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3648 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3649 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3650 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3651 | 0 \ |
| 3652 | -c "client hello, adding session ticket extension" \ |
| 3653 | -s "found session ticket extension" \ |
| 3654 | -s "server hello, adding session ticket extension" \ |
| 3655 | -c "found session_ticket extension" \ |
| 3656 | -c "parse new session ticket" \ |
| 3657 | -S "session successfully restored from cache" \ |
| 3658 | -s "session successfully restored from ticket" \ |
| 3659 | -s "a session has been resumed" \ |
| 3660 | -c "a session has been resumed" |
| 3661 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3663 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3664 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3665 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3666 | 0 \ |
| 3667 | -c "client hello, adding session ticket extension" \ |
| 3668 | -s "found session ticket extension" \ |
| 3669 | -s "server hello, adding session ticket extension" \ |
| 3670 | -c "found session_ticket extension" \ |
| 3671 | -c "parse new session ticket" \ |
| 3672 | -S "session successfully restored from cache" \ |
| 3673 | -s "session successfully restored from ticket" \ |
| 3674 | -s "a session has been resumed" \ |
| 3675 | -c "a session has been resumed" |
| 3676 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3678 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3679 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3680 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3681 | 0 \ |
| 3682 | -c "client hello, adding session ticket extension" \ |
| 3683 | -s "found session ticket extension" \ |
| 3684 | -s "server hello, adding session ticket extension" \ |
| 3685 | -c "found session_ticket extension" \ |
| 3686 | -c "parse new session ticket" \ |
| 3687 | -S "session successfully restored from cache" \ |
| 3688 | -s "session successfully restored from ticket" \ |
| 3689 | -s "a session has been resumed" \ |
| 3690 | -c "a session has been resumed" |
| 3691 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3693 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3694 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3695 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3696 | 0 \ |
| 3697 | -c "client hello, adding session ticket extension" \ |
| 3698 | -s "found session ticket extension" \ |
| 3699 | -s "server hello, adding session ticket extension" \ |
| 3700 | -c "found session_ticket extension" \ |
| 3701 | -c "parse new session ticket" \ |
| 3702 | -S "session successfully restored from cache" \ |
| 3703 | -s "session successfully restored from ticket" \ |
| 3704 | -s "a session has been resumed" \ |
| 3705 | -c "a session has been resumed" |
| 3706 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3708 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3709 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3710 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3711 | 0 \ |
| 3712 | -c "client hello, adding session ticket extension" \ |
| 3713 | -s "found session ticket extension" \ |
| 3714 | -s "server hello, adding session ticket extension" \ |
| 3715 | -c "found session_ticket extension" \ |
| 3716 | -c "parse new session ticket" \ |
| 3717 | -S "session successfully restored from cache" \ |
| 3718 | -s "session successfully restored from ticket" \ |
| 3719 | -s "a session has been resumed" \ |
| 3720 | -c "a session has been resumed" |
| 3721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3723 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3724 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3725 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3726 | 0 \ |
| 3727 | -c "client hello, adding session ticket extension" \ |
| 3728 | -s "found session ticket extension" \ |
| 3729 | -s "server hello, adding session ticket extension" \ |
| 3730 | -c "found session_ticket extension" \ |
| 3731 | -c "parse new session ticket" \ |
| 3732 | -S "session successfully restored from cache" \ |
| 3733 | -s "session successfully restored from ticket" \ |
| 3734 | -s "a session has been resumed" \ |
| 3735 | -c "a session has been resumed" |
| 3736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3738 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3739 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3740 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3741 | 0 \ |
| 3742 | -c "client hello, adding session ticket extension" \ |
| 3743 | -s "found session ticket extension" \ |
| 3744 | -s "server hello, adding session ticket extension" \ |
| 3745 | -c "found session_ticket extension" \ |
| 3746 | -c "parse new session ticket" \ |
| 3747 | -S "session successfully restored from cache" \ |
| 3748 | -s "session successfully restored from ticket" \ |
| 3749 | -s "a session has been resumed" \ |
| 3750 | -c "a session has been resumed" |
| 3751 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3753 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3754 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3755 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3756 | 0 \ |
| 3757 | -c "client hello, adding session ticket extension" \ |
| 3758 | -s "found session ticket extension" \ |
| 3759 | -s "server hello, adding session ticket extension" \ |
| 3760 | -c "found session_ticket extension" \ |
| 3761 | -c "parse new session ticket" \ |
| 3762 | -S "session successfully restored from cache" \ |
| 3763 | -s "session successfully restored from ticket" \ |
| 3764 | -s "a session has been resumed" \ |
| 3765 | -c "a session has been resumed" |
| 3766 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3768 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3769 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3770 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3771 | 0 \ |
| 3772 | -c "client hello, adding session ticket extension" \ |
| 3773 | -s "found session ticket extension" \ |
| 3774 | -s "server hello, adding session ticket extension" \ |
| 3775 | -c "found session_ticket extension" \ |
| 3776 | -c "parse new session ticket" \ |
| 3777 | -S "session successfully restored from cache" \ |
| 3778 | -s "session successfully restored from ticket" \ |
| 3779 | -s "a session has been resumed" \ |
| 3780 | -c "a session has been resumed" |
| 3781 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3782 | # Tests for Session Tickets with DTLS |
| 3783 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3785 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3786 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3787 | "$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] | 3788 | 0 \ |
| 3789 | -c "client hello, adding session ticket extension" \ |
| 3790 | -s "found session ticket extension" \ |
| 3791 | -s "server hello, adding session ticket extension" \ |
| 3792 | -c "found session_ticket extension" \ |
| 3793 | -c "parse new session ticket" \ |
| 3794 | -S "session successfully restored from cache" \ |
| 3795 | -s "session successfully restored from ticket" \ |
| 3796 | -s "a session has been resumed" \ |
| 3797 | -c "a session has been resumed" |
| 3798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3800 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3801 | "$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] | 3802 | "$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] | 3803 | 0 \ |
| 3804 | -c "client hello, adding session ticket extension" \ |
| 3805 | -s "found session ticket extension" \ |
| 3806 | -s "server hello, adding session ticket extension" \ |
| 3807 | -c "found session_ticket extension" \ |
| 3808 | -c "parse new session ticket" \ |
| 3809 | -S "session successfully restored from cache" \ |
| 3810 | -s "session successfully restored from ticket" \ |
| 3811 | -s "a session has been resumed" \ |
| 3812 | -c "a session has been resumed" |
| 3813 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3815 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3816 | "$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] | 3817 | "$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] | 3818 | 0 \ |
| 3819 | -c "client hello, adding session ticket extension" \ |
| 3820 | -s "found session ticket extension" \ |
| 3821 | -s "server hello, adding session ticket extension" \ |
| 3822 | -c "found session_ticket extension" \ |
| 3823 | -c "parse new session ticket" \ |
| 3824 | -S "session successfully restored from cache" \ |
| 3825 | -S "session successfully restored from ticket" \ |
| 3826 | -S "a session has been resumed" \ |
| 3827 | -C "a session has been resumed" |
| 3828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3830 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3831 | "$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] | 3832 | "$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] | 3833 | 0 \ |
| 3834 | -c "client hello, adding session ticket extension" \ |
| 3835 | -s "found session ticket extension" \ |
| 3836 | -s "server hello, adding session ticket extension" \ |
| 3837 | -c "found session_ticket extension" \ |
| 3838 | -c "parse new session ticket" \ |
| 3839 | -S "session successfully restored from cache" \ |
| 3840 | -s "session successfully restored from ticket" \ |
| 3841 | -s "a session has been resumed" \ |
| 3842 | -c "a session has been resumed" |
| 3843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3845 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3846 | "$O_SRV -dtls" \ |
| 3847 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3848 | 0 \ |
| 3849 | -c "client hello, adding session ticket extension" \ |
| 3850 | -c "found session_ticket extension" \ |
| 3851 | -c "parse new session ticket" \ |
| 3852 | -c "a session has been resumed" |
| 3853 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3854 | # 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] | 3855 | # 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] | 3856 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3858 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3859 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3860 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3861 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3862 | rm -f $SESSION )" \ |
| 3863 | 0 \ |
| 3864 | -s "found session ticket extension" \ |
| 3865 | -s "server hello, adding session ticket extension" \ |
| 3866 | -S "session successfully restored from cache" \ |
| 3867 | -s "session successfully restored from ticket" \ |
| 3868 | -s "a session has been resumed" |
| 3869 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3870 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3871 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3874 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3875 | "$P_SRV debug_level=3 tickets=0" \ |
| 3876 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3877 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3878 | -c "client hello, adding session ticket extension" \ |
| 3879 | -s "found session ticket extension" \ |
| 3880 | -S "server hello, adding session ticket extension" \ |
| 3881 | -C "found session_ticket extension" \ |
| 3882 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3883 | -s "session successfully restored from cache" \ |
| 3884 | -S "session successfully restored from ticket" \ |
| 3885 | -s "a session has been resumed" \ |
| 3886 | -c "a session has been resumed" |
| 3887 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3890 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3891 | "$P_SRV debug_level=3 tickets=1" \ |
| 3892 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3893 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3894 | -C "client hello, adding session ticket extension" \ |
| 3895 | -S "found session ticket extension" \ |
| 3896 | -S "server hello, adding session ticket extension" \ |
| 3897 | -C "found session_ticket extension" \ |
| 3898 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3899 | -s "session successfully restored from cache" \ |
| 3900 | -S "session successfully restored from ticket" \ |
| 3901 | -s "a session has been resumed" \ |
| 3902 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3905 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3906 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3907 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3908 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3909 | 0 \ |
| 3910 | -S "session successfully restored from cache" \ |
| 3911 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3912 | -S "a session has been resumed" \ |
| 3913 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3914 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3916 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3917 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3918 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3919 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3920 | 0 \ |
| 3921 | -s "session successfully restored from cache" \ |
| 3922 | -S "session successfully restored from ticket" \ |
| 3923 | -s "a session has been resumed" \ |
| 3924 | -c "a session has been resumed" |
| 3925 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3927 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3928 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3929 | "$P_SRV debug_level=3 tickets=0" \ |
| 3930 | "$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] | 3931 | 0 \ |
| 3932 | -s "session successfully restored from cache" \ |
| 3933 | -S "session successfully restored from ticket" \ |
| 3934 | -s "a session has been resumed" \ |
| 3935 | -c "a session has been resumed" |
| 3936 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3938 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3939 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3940 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3941 | "$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] | 3942 | 0 \ |
| 3943 | -S "session successfully restored from cache" \ |
| 3944 | -S "session successfully restored from ticket" \ |
| 3945 | -S "a session has been resumed" \ |
| 3946 | -C "a session has been resumed" |
| 3947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3949 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3950 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3951 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3952 | "$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] | 3953 | 0 \ |
| 3954 | -s "session successfully restored from cache" \ |
| 3955 | -S "session successfully restored from ticket" \ |
| 3956 | -s "a session has been resumed" \ |
| 3957 | -c "a session has been resumed" |
| 3958 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3959 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3960 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3961 | run_test "Session resume using cache: session copy" \ |
| 3962 | "$P_SRV debug_level=3 tickets=0" \ |
| 3963 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3964 | 0 \ |
| 3965 | -s "session successfully restored from cache" \ |
| 3966 | -S "session successfully restored from ticket" \ |
| 3967 | -s "a session has been resumed" \ |
| 3968 | -c "a session has been resumed" |
| 3969 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3970 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3971 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3972 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3973 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3974 | "( $O_CLI -sess_out $SESSION; \ |
| 3975 | $O_CLI -sess_in $SESSION; \ |
| 3976 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3977 | 0 \ |
| 3978 | -s "found session ticket extension" \ |
| 3979 | -S "server hello, adding session ticket extension" \ |
| 3980 | -s "session successfully restored from cache" \ |
| 3981 | -S "session successfully restored from ticket" \ |
| 3982 | -s "a session has been resumed" |
| 3983 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3986 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3987 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3988 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3989 | 0 \ |
| 3990 | -C "found session_ticket extension" \ |
| 3991 | -C "parse new session ticket" \ |
| 3992 | -c "a session has been resumed" |
| 3993 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 3994 | # Tests for Session resume and extensions |
| 3995 | |
| 3996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3997 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3998 | run_test "Session resume and connection ID" \ |
| 3999 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4000 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4001 | 0 \ |
| 4002 | -c "Enable use of CID extension." \ |
| 4003 | -s "Enable use of CID extension." \ |
| 4004 | -c "client hello, adding CID extension" \ |
| 4005 | -s "found CID extension" \ |
| 4006 | -s "Use of CID extension negotiated" \ |
| 4007 | -s "server hello, adding CID extension" \ |
| 4008 | -c "found CID extension" \ |
| 4009 | -c "Use of CID extension negotiated" \ |
| 4010 | -s "Copy CIDs into SSL transform" \ |
| 4011 | -c "Copy CIDs into SSL transform" \ |
| 4012 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4013 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4014 | -s "Use of Connection ID has been negotiated" \ |
| 4015 | -c "Use of Connection ID has been negotiated" |
| 4016 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4017 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4018 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4020 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4021 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4022 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4023 | "$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] | 4024 | 0 \ |
| 4025 | -c "client hello, adding session ticket extension" \ |
| 4026 | -s "found session ticket extension" \ |
| 4027 | -S "server hello, adding session ticket extension" \ |
| 4028 | -C "found session_ticket extension" \ |
| 4029 | -C "parse new session ticket" \ |
| 4030 | -s "session successfully restored from cache" \ |
| 4031 | -S "session successfully restored from ticket" \ |
| 4032 | -s "a session has been resumed" \ |
| 4033 | -c "a session has been resumed" |
| 4034 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4035 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4037 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4038 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4039 | "$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] | 4040 | 0 \ |
| 4041 | -C "client hello, adding session ticket extension" \ |
| 4042 | -S "found session ticket extension" \ |
| 4043 | -S "server hello, adding session ticket extension" \ |
| 4044 | -C "found session_ticket extension" \ |
| 4045 | -C "parse new session ticket" \ |
| 4046 | -s "session successfully restored from cache" \ |
| 4047 | -S "session successfully restored from ticket" \ |
| 4048 | -s "a session has been resumed" \ |
| 4049 | -c "a session has been resumed" |
| 4050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4053 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4054 | "$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] | 4055 | "$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] | 4056 | 0 \ |
| 4057 | -S "session successfully restored from cache" \ |
| 4058 | -S "session successfully restored from ticket" \ |
| 4059 | -S "a session has been resumed" \ |
| 4060 | -C "a session has been resumed" |
| 4061 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4063 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4064 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4065 | "$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] | 4066 | "$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] | 4067 | 0 \ |
| 4068 | -s "session successfully restored from cache" \ |
| 4069 | -S "session successfully restored from ticket" \ |
| 4070 | -s "a session has been resumed" \ |
| 4071 | -c "a session has been resumed" |
| 4072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4074 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4075 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4076 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4077 | "$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] | 4078 | 0 \ |
| 4079 | -s "session successfully restored from cache" \ |
| 4080 | -S "session successfully restored from ticket" \ |
| 4081 | -s "a session has been resumed" \ |
| 4082 | -c "a session has been resumed" |
| 4083 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4085 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4086 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4087 | "$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] | 4088 | "$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] | 4089 | 0 \ |
| 4090 | -S "session successfully restored from cache" \ |
| 4091 | -S "session successfully restored from ticket" \ |
| 4092 | -S "a session has been resumed" \ |
| 4093 | -C "a session has been resumed" |
| 4094 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4096 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4097 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4098 | "$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] | 4099 | "$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] | 4100 | 0 \ |
| 4101 | -s "session successfully restored from cache" \ |
| 4102 | -S "session successfully restored from ticket" \ |
| 4103 | -s "a session has been resumed" \ |
| 4104 | -c "a session has been resumed" |
| 4105 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4108 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4109 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4110 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4111 | 0 \ |
| 4112 | -s "session successfully restored from cache" \ |
| 4113 | -S "session successfully restored from ticket" \ |
| 4114 | -s "a session has been resumed" \ |
| 4115 | -c "a session has been resumed" |
| 4116 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4117 | # 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] | 4118 | # 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] | 4119 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4121 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4122 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4123 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4124 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4125 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4126 | rm -f $SESSION )" \ |
| 4127 | 0 \ |
| 4128 | -s "found session ticket extension" \ |
| 4129 | -S "server hello, adding session ticket extension" \ |
| 4130 | -s "session successfully restored from cache" \ |
| 4131 | -S "session successfully restored from ticket" \ |
| 4132 | -s "a session has been resumed" |
| 4133 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4135 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4136 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4137 | "$O_SRV -dtls" \ |
| 4138 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4139 | 0 \ |
| 4140 | -C "found session_ticket extension" \ |
| 4141 | -C "parse new session ticket" \ |
| 4142 | -c "a session has been resumed" |
| 4143 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4144 | # Tests for Max Fragment Length extension |
| 4145 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4148 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4149 | "$P_SRV debug_level=3" \ |
| 4150 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4151 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4152 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4153 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4154 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4155 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4156 | -C "client hello, adding max_fragment_length extension" \ |
| 4157 | -S "found max fragment length extension" \ |
| 4158 | -S "server hello, max_fragment_length extension" \ |
| 4159 | -C "found max_fragment_length extension" |
| 4160 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4163 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4164 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4165 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4166 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4167 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4168 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4169 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4170 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4171 | -C "client hello, adding max_fragment_length extension" \ |
| 4172 | -S "found max fragment length extension" \ |
| 4173 | -S "server hello, max_fragment_length extension" \ |
| 4174 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4175 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4176 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4177 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4178 | |
| 4179 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4181 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4182 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4183 | "$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] | 4184 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4185 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4186 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4187 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4188 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4189 | -C "client hello, adding max_fragment_length extension" \ |
| 4190 | -S "found max fragment length extension" \ |
| 4191 | -S "server hello, max_fragment_length extension" \ |
| 4192 | -C "found max_fragment_length extension" \ |
| 4193 | -c "fragment larger than.*maximum " |
| 4194 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4195 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4196 | # (session fragment length will be 16384 regardless of mbedtls |
| 4197 | # content length configuration.) |
| 4198 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4199 | requires_config_disabled 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: disabled, larger message" \ |
| 4202 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4203 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +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 16384" \ |
| 4206 | -C "Maximum outgoing record payload length is 16384" \ |
| 4207 | -S "Maximum incoming record payload length is 16384" \ |
| 4208 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4209 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4210 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4211 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4212 | |
| 4213 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4215 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4216 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4217 | "$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] | 4218 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4219 | -C "Maximum incoming record payload length is 16384" \ |
| 4220 | -C "Maximum outgoing record payload length is 16384" \ |
| 4221 | -S "Maximum incoming record payload length is 16384" \ |
| 4222 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4223 | -c "fragment larger than.*maximum " |
| 4224 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4225 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4226 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4228 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4229 | "$P_SRV debug_level=3" \ |
| 4230 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4231 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4232 | -c "Maximum incoming record payload length is 4096" \ |
| 4233 | -c "Maximum outgoing record payload length is 4096" \ |
| 4234 | -s "Maximum incoming record payload length is 4096" \ |
| 4235 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4236 | -c "client hello, adding max_fragment_length extension" \ |
| 4237 | -s "found max fragment length extension" \ |
| 4238 | -s "server hello, max_fragment_length extension" \ |
| 4239 | -c "found max_fragment_length extension" |
| 4240 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4241 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4244 | run_test "Max fragment length: client 512, server 1024" \ |
| 4245 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4246 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4247 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4248 | -c "Maximum incoming record payload length is 512" \ |
| 4249 | -c "Maximum outgoing record payload length is 512" \ |
| 4250 | -s "Maximum incoming record payload length is 512" \ |
| 4251 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4252 | -c "client hello, adding max_fragment_length extension" \ |
| 4253 | -s "found max fragment length extension" \ |
| 4254 | -s "server hello, max_fragment_length extension" \ |
| 4255 | -c "found max_fragment_length extension" |
| 4256 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4257 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4258 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4260 | run_test "Max fragment length: client 512, server 2048" \ |
| 4261 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4262 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4263 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4264 | -c "Maximum incoming record payload length is 512" \ |
| 4265 | -c "Maximum outgoing record payload length is 512" \ |
| 4266 | -s "Maximum incoming record payload length is 512" \ |
| 4267 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4268 | -c "client hello, adding max_fragment_length extension" \ |
| 4269 | -s "found max fragment length extension" \ |
| 4270 | -s "server hello, max_fragment_length extension" \ |
| 4271 | -c "found max_fragment_length extension" |
| 4272 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4273 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4274 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4276 | run_test "Max fragment length: client 512, server 4096" \ |
| 4277 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4278 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4279 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4280 | -c "Maximum incoming record payload length is 512" \ |
| 4281 | -c "Maximum outgoing record payload length is 512" \ |
| 4282 | -s "Maximum incoming record payload length is 512" \ |
| 4283 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4284 | -c "client hello, adding max_fragment_length extension" \ |
| 4285 | -s "found max fragment length extension" \ |
| 4286 | -s "server hello, max_fragment_length extension" \ |
| 4287 | -c "found max_fragment_length extension" |
| 4288 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4289 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4292 | run_test "Max fragment length: client 1024, server 512" \ |
| 4293 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4294 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4295 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4296 | -c "Maximum incoming record payload length is 1024" \ |
| 4297 | -c "Maximum outgoing record payload length is 1024" \ |
| 4298 | -s "Maximum incoming record payload length is 1024" \ |
| 4299 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4300 | -c "client hello, adding max_fragment_length extension" \ |
| 4301 | -s "found max fragment length extension" \ |
| 4302 | -s "server hello, max_fragment_length extension" \ |
| 4303 | -c "found max_fragment_length extension" |
| 4304 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4305 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4306 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4308 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4309 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4310 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4311 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4312 | -c "Maximum incoming record payload length is 1024" \ |
| 4313 | -c "Maximum outgoing record payload length is 1024" \ |
| 4314 | -s "Maximum incoming record payload length is 1024" \ |
| 4315 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4316 | -c "client hello, adding max_fragment_length extension" \ |
| 4317 | -s "found max fragment length extension" \ |
| 4318 | -s "server hello, max_fragment_length extension" \ |
| 4319 | -c "found max_fragment_length extension" |
| 4320 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4321 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4322 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4324 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4325 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4326 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4327 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4328 | -c "Maximum incoming record payload length is 1024" \ |
| 4329 | -c "Maximum outgoing record payload length is 1024" \ |
| 4330 | -s "Maximum incoming record payload length is 1024" \ |
| 4331 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4332 | -c "client hello, adding max_fragment_length extension" \ |
| 4333 | -s "found max fragment length extension" \ |
| 4334 | -s "server hello, max_fragment_length extension" \ |
| 4335 | -c "found max_fragment_length extension" |
| 4336 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4337 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4338 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4340 | run_test "Max fragment length: client 2048, server 512" \ |
| 4341 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4342 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4343 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4344 | -c "Maximum incoming record payload length is 2048" \ |
| 4345 | -c "Maximum outgoing record payload length is 2048" \ |
| 4346 | -s "Maximum incoming record payload length is 2048" \ |
| 4347 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4348 | -c "client hello, adding max_fragment_length extension" \ |
| 4349 | -s "found max fragment length extension" \ |
| 4350 | -s "server hello, max_fragment_length extension" \ |
| 4351 | -c "found max_fragment_length extension" |
| 4352 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4353 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4354 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4356 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4357 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4358 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4359 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4360 | -c "Maximum incoming record payload length is 2048" \ |
| 4361 | -c "Maximum outgoing record payload length is 2048" \ |
| 4362 | -s "Maximum incoming record payload length is 2048" \ |
| 4363 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4364 | -c "client hello, adding max_fragment_length extension" \ |
| 4365 | -s "found max fragment length extension" \ |
| 4366 | -s "server hello, max_fragment_length extension" \ |
| 4367 | -c "found max_fragment_length extension" |
| 4368 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4369 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4370 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4372 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4373 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4374 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4375 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4376 | -c "Maximum incoming record payload length is 2048" \ |
| 4377 | -c "Maximum outgoing record payload length is 2048" \ |
| 4378 | -s "Maximum incoming record payload length is 2048" \ |
| 4379 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4380 | -c "client hello, adding max_fragment_length extension" \ |
| 4381 | -s "found max fragment length extension" \ |
| 4382 | -s "server hello, max_fragment_length extension" \ |
| 4383 | -c "found max_fragment_length extension" |
| 4384 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4385 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4388 | run_test "Max fragment length: client 4096, server 512" \ |
| 4389 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4390 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4391 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4392 | -c "Maximum incoming record payload length is 4096" \ |
| 4393 | -c "Maximum outgoing record payload length is 4096" \ |
| 4394 | -s "Maximum incoming record payload length is 4096" \ |
| 4395 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4396 | -c "client hello, adding max_fragment_length extension" \ |
| 4397 | -s "found max fragment length extension" \ |
| 4398 | -s "server hello, max_fragment_length extension" \ |
| 4399 | -c "found max_fragment_length extension" |
| 4400 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4401 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4402 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4404 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4405 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4406 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4407 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4408 | -c "Maximum incoming record payload length is 4096" \ |
| 4409 | -c "Maximum outgoing record payload length is 4096" \ |
| 4410 | -s "Maximum incoming record payload length is 4096" \ |
| 4411 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4412 | -c "client hello, adding max_fragment_length extension" \ |
| 4413 | -s "found max fragment length extension" \ |
| 4414 | -s "server hello, max_fragment_length extension" \ |
| 4415 | -c "found max_fragment_length extension" |
| 4416 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4417 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4420 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4421 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4422 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4423 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4424 | -c "Maximum incoming record payload length is 4096" \ |
| 4425 | -c "Maximum outgoing record payload length is 4096" \ |
| 4426 | -s "Maximum incoming record payload length is 4096" \ |
| 4427 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4428 | -c "client hello, adding max_fragment_length extension" \ |
| 4429 | -s "found max fragment length extension" \ |
| 4430 | -s "server hello, max_fragment_length extension" \ |
| 4431 | -c "found max_fragment_length extension" |
| 4432 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4433 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4434 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4436 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4437 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4438 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4439 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4440 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4441 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4442 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4443 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4444 | -C "client hello, adding max_fragment_length extension" \ |
| 4445 | -S "found max fragment length extension" \ |
| 4446 | -S "server hello, max_fragment_length extension" \ |
| 4447 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4448 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4449 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4451 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4453 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4454 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4455 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4456 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4457 | -c "Maximum incoming record payload length is 4096" \ |
| 4458 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4459 | -c "client hello, adding max_fragment_length extension" \ |
| 4460 | -c "found max_fragment_length extension" |
| 4461 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4462 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4465 | run_test "Max fragment length: client, message just fits" \ |
| 4466 | "$P_SRV debug_level=3" \ |
| 4467 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4468 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4469 | -c "Maximum incoming record payload length is 2048" \ |
| 4470 | -c "Maximum outgoing record payload length is 2048" \ |
| 4471 | -s "Maximum incoming record payload length is 2048" \ |
| 4472 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4473 | -c "client hello, adding max_fragment_length extension" \ |
| 4474 | -s "found max fragment length extension" \ |
| 4475 | -s "server hello, max_fragment_length extension" \ |
| 4476 | -c "found max_fragment_length extension" \ |
| 4477 | -c "2048 bytes written in 1 fragments" \ |
| 4478 | -s "2048 bytes read" |
| 4479 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4480 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4481 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4483 | run_test "Max fragment length: client, larger message" \ |
| 4484 | "$P_SRV debug_level=3" \ |
| 4485 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4486 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4487 | -c "Maximum incoming record payload length is 2048" \ |
| 4488 | -c "Maximum outgoing record payload length is 2048" \ |
| 4489 | -s "Maximum incoming record payload length is 2048" \ |
| 4490 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4491 | -c "client hello, adding max_fragment_length extension" \ |
| 4492 | -s "found max fragment length extension" \ |
| 4493 | -s "server hello, max_fragment_length extension" \ |
| 4494 | -c "found max_fragment_length extension" \ |
| 4495 | -c "2345 bytes written in 2 fragments" \ |
| 4496 | -s "2048 bytes read" \ |
| 4497 | -s "297 bytes read" |
| 4498 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4499 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4500 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4502 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4503 | "$P_SRV debug_level=3 dtls=1" \ |
| 4504 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4505 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4506 | -c "Maximum incoming record payload length is 2048" \ |
| 4507 | -c "Maximum outgoing record payload length is 2048" \ |
| 4508 | -s "Maximum incoming record payload length is 2048" \ |
| 4509 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4510 | -c "client hello, adding max_fragment_length extension" \ |
| 4511 | -s "found max fragment length extension" \ |
| 4512 | -s "server hello, max_fragment_length extension" \ |
| 4513 | -c "found max_fragment_length extension" \ |
| 4514 | -c "fragment larger than.*maximum" |
| 4515 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4516 | # Tests for renegotiation |
| 4517 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4518 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4520 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4521 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4522 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4523 | 0 \ |
| 4524 | -C "client hello, adding renegotiation extension" \ |
| 4525 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4526 | -S "found renegotiation extension" \ |
| 4527 | -s "server hello, secure renegotiation extension" \ |
| 4528 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4529 | -C "=> renegotiate" \ |
| 4530 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4531 | -S "write hello request" |
| 4532 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4535 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4536 | "$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] | 4537 | "$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] | 4538 | 0 \ |
| 4539 | -c "client hello, adding renegotiation extension" \ |
| 4540 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4541 | -s "found renegotiation extension" \ |
| 4542 | -s "server hello, secure renegotiation extension" \ |
| 4543 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4544 | -c "=> renegotiate" \ |
| 4545 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4546 | -S "write hello request" |
| 4547 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4550 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4551 | "$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] | 4552 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4553 | 0 \ |
| 4554 | -c "client hello, adding renegotiation extension" \ |
| 4555 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4556 | -s "found renegotiation extension" \ |
| 4557 | -s "server hello, secure renegotiation extension" \ |
| 4558 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4559 | -c "=> renegotiate" \ |
| 4560 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4561 | -s "write hello request" |
| 4562 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4563 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4564 | # 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] | 4565 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4568 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4569 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4570 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4571 | 0 \ |
| 4572 | -c "client hello, adding renegotiation extension" \ |
| 4573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4574 | -s "found renegotiation extension" \ |
| 4575 | -s "server hello, secure renegotiation extension" \ |
| 4576 | -c "found renegotiation extension" \ |
| 4577 | -c "=> renegotiate" \ |
| 4578 | -s "=> renegotiate" \ |
| 4579 | -S "write hello request" \ |
| 4580 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4581 | |
| 4582 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4583 | # 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] | 4584 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4585 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4587 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4588 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4589 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4590 | 0 \ |
| 4591 | -c "client hello, adding renegotiation extension" \ |
| 4592 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4593 | -s "found renegotiation extension" \ |
| 4594 | -s "server hello, secure renegotiation extension" \ |
| 4595 | -c "found renegotiation extension" \ |
| 4596 | -c "=> renegotiate" \ |
| 4597 | -s "=> renegotiate" \ |
| 4598 | -s "write hello request" \ |
| 4599 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 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: double" \ |
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 renegotiate=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 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4616 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4617 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4618 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4620 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4621 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4622 | "$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" \ |
| 4623 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4624 | -c "Maximum incoming record payload length is 2048" \ |
| 4625 | -c "Maximum outgoing record payload length is 2048" \ |
| 4626 | -s "Maximum incoming record payload length is 2048" \ |
| 4627 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4628 | -c "client hello, adding max_fragment_length extension" \ |
| 4629 | -s "found max fragment length extension" \ |
| 4630 | -s "server hello, max_fragment_length extension" \ |
| 4631 | -c "found max_fragment_length extension" \ |
| 4632 | -c "client hello, adding renegotiation extension" \ |
| 4633 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4634 | -s "found renegotiation extension" \ |
| 4635 | -s "server hello, secure renegotiation extension" \ |
| 4636 | -c "found renegotiation extension" \ |
| 4637 | -c "=> renegotiate" \ |
| 4638 | -s "=> renegotiate" \ |
| 4639 | -s "write hello request" |
| 4640 | |
| 4641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4643 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4644 | "$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] | 4645 | "$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] | 4646 | 1 \ |
| 4647 | -c "client hello, adding renegotiation extension" \ |
| 4648 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4649 | -S "found renegotiation extension" \ |
| 4650 | -s "server hello, secure renegotiation extension" \ |
| 4651 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4652 | -c "=> renegotiate" \ |
| 4653 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4654 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4655 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4656 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4657 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4658 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4660 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4661 | "$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] | 4662 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4663 | 0 \ |
| 4664 | -C "client hello, adding renegotiation extension" \ |
| 4665 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4666 | -S "found renegotiation extension" \ |
| 4667 | -s "server hello, secure renegotiation extension" \ |
| 4668 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4669 | -C "=> renegotiate" \ |
| 4670 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4671 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4672 | -S "SSL - An unexpected message was received from our peer" \ |
| 4673 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4674 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4677 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4678 | "$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] | 4679 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4680 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4681 | 0 \ |
| 4682 | -C "client hello, adding renegotiation extension" \ |
| 4683 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4684 | -S "found renegotiation extension" \ |
| 4685 | -s "server hello, secure renegotiation extension" \ |
| 4686 | -c "found renegotiation extension" \ |
| 4687 | -C "=> renegotiate" \ |
| 4688 | -S "=> renegotiate" \ |
| 4689 | -s "write hello request" \ |
| 4690 | -S "SSL - An unexpected message was received from our peer" \ |
| 4691 | -S "failed" |
| 4692 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4693 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 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: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4697 | "$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] | 4698 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4699 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4700 | 0 \ |
| 4701 | -C "client hello, adding renegotiation extension" \ |
| 4702 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4703 | -S "found renegotiation extension" \ |
| 4704 | -s "server hello, secure renegotiation extension" \ |
| 4705 | -c "found renegotiation extension" \ |
| 4706 | -C "=> renegotiate" \ |
| 4707 | -S "=> renegotiate" \ |
| 4708 | -s "write hello request" \ |
| 4709 | -S "SSL - An unexpected message was received from our peer" \ |
| 4710 | -S "failed" |
| 4711 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4714 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4715 | "$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] | 4716 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4717 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4718 | 0 \ |
| 4719 | -C "client hello, adding renegotiation extension" \ |
| 4720 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4721 | -S "found renegotiation extension" \ |
| 4722 | -s "server hello, secure renegotiation extension" \ |
| 4723 | -c "found renegotiation extension" \ |
| 4724 | -C "=> renegotiate" \ |
| 4725 | -S "=> renegotiate" \ |
| 4726 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4727 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4728 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4731 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4732 | "$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] | 4733 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4734 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4735 | 0 \ |
| 4736 | -c "client hello, adding renegotiation extension" \ |
| 4737 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4738 | -s "found renegotiation extension" \ |
| 4739 | -s "server hello, secure renegotiation extension" \ |
| 4740 | -c "found renegotiation extension" \ |
| 4741 | -c "=> renegotiate" \ |
| 4742 | -s "=> renegotiate" \ |
| 4743 | -s "write hello request" \ |
| 4744 | -S "SSL - An unexpected message was received from our peer" \ |
| 4745 | -S "failed" |
| 4746 | |
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 | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4749 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4750 | "$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] | 4751 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4752 | 0 \ |
| 4753 | -C "client hello, adding renegotiation extension" \ |
| 4754 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4755 | -S "found renegotiation extension" \ |
| 4756 | -s "server hello, secure renegotiation extension" \ |
| 4757 | -c "found renegotiation extension" \ |
| 4758 | -S "record counter limit reached: renegotiate" \ |
| 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 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4765 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4766 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4768 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4769 | "$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] | 4770 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [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 | -s "record counter limit reached: renegotiate" \ |
| 4778 | -c "=> renegotiate" \ |
| 4779 | -s "=> renegotiate" \ |
| 4780 | -s "write hello request" \ |
| 4781 | -S "SSL - An unexpected message was received from our peer" \ |
| 4782 | -S "failed" |
| 4783 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4786 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4787 | "$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] | 4788 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4789 | 0 \ |
| 4790 | -c "client hello, adding renegotiation extension" \ |
| 4791 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4792 | -s "found renegotiation extension" \ |
| 4793 | -s "server hello, secure renegotiation extension" \ |
| 4794 | -c "found renegotiation extension" \ |
| 4795 | -s "record counter limit reached: renegotiate" \ |
| 4796 | -c "=> renegotiate" \ |
| 4797 | -s "=> renegotiate" \ |
| 4798 | -s "write hello request" \ |
| 4799 | -S "SSL - An unexpected message was received from our peer" \ |
| 4800 | -S "failed" |
| 4801 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4802 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4804 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4805 | "$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] | 4806 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4807 | 0 \ |
| 4808 | -C "client hello, adding renegotiation extension" \ |
| 4809 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4810 | -S "found renegotiation extension" \ |
| 4811 | -s "server hello, secure renegotiation extension" \ |
| 4812 | -c "found renegotiation extension" \ |
| 4813 | -S "record counter limit reached: renegotiate" \ |
| 4814 | -C "=> renegotiate" \ |
| 4815 | -S "=> renegotiate" \ |
| 4816 | -S "write hello request" \ |
| 4817 | -S "SSL - An unexpected message was received from our peer" \ |
| 4818 | -S "failed" |
| 4819 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4820 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4822 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4823 | "$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] | 4824 | "$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] | 4825 | 0 \ |
| 4826 | -c "client hello, adding renegotiation extension" \ |
| 4827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4828 | -s "found renegotiation extension" \ |
| 4829 | -s "server hello, secure renegotiation extension" \ |
| 4830 | -c "found renegotiation extension" \ |
| 4831 | -c "=> renegotiate" \ |
| 4832 | -s "=> renegotiate" \ |
| 4833 | -S "write hello request" |
| 4834 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4836 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4837 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4838 | "$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] | 4839 | "$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] | 4840 | 0 \ |
| 4841 | -c "client hello, adding renegotiation extension" \ |
| 4842 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4843 | -s "found renegotiation extension" \ |
| 4844 | -s "server hello, secure renegotiation extension" \ |
| 4845 | -c "found renegotiation extension" \ |
| 4846 | -c "=> renegotiate" \ |
| 4847 | -s "=> renegotiate" \ |
| 4848 | -s "write hello request" |
| 4849 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4850 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4852 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4853 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4854 | "$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] | 4855 | 0 \ |
| 4856 | -c "client hello, adding renegotiation extension" \ |
| 4857 | -c "found renegotiation extension" \ |
| 4858 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4859 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4860 | -C "error" \ |
| 4861 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4862 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4863 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4864 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4866 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4867 | "$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] | 4868 | "$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] | 4869 | 0 \ |
| 4870 | -c "client hello, adding renegotiation extension" \ |
| 4871 | -c "found renegotiation extension" \ |
| 4872 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4873 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4874 | -C "error" \ |
| 4875 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4876 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4877 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4878 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4880 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4881 | "$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] | 4882 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4883 | 1 \ |
| 4884 | -c "client hello, adding renegotiation extension" \ |
| 4885 | -C "found renegotiation extension" \ |
| 4886 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4887 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4888 | -c "error" \ |
| 4889 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4890 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4891 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4892 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4894 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4895 | "$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] | 4896 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4897 | allow_legacy=0" \ |
| 4898 | 1 \ |
| 4899 | -c "client hello, adding renegotiation extension" \ |
| 4900 | -C "found renegotiation extension" \ |
| 4901 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4902 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4903 | -c "error" \ |
| 4904 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4905 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4906 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4907 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4909 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4910 | "$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] | 4911 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4912 | allow_legacy=1" \ |
| 4913 | 0 \ |
| 4914 | -c "client hello, adding renegotiation extension" \ |
| 4915 | -C "found renegotiation extension" \ |
| 4916 | -c "=> renegotiate" \ |
| 4917 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4918 | -C "error" \ |
| 4919 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4920 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4921 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4923 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4924 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4925 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4926 | 0 \ |
| 4927 | -c "client hello, adding renegotiation extension" \ |
| 4928 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4929 | -s "found renegotiation extension" \ |
| 4930 | -s "server hello, secure renegotiation extension" \ |
| 4931 | -c "found renegotiation extension" \ |
| 4932 | -c "=> renegotiate" \ |
| 4933 | -s "=> renegotiate" \ |
| 4934 | -S "write hello request" |
| 4935 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4936 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4938 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4939 | "$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] | 4940 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4941 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4942 | 0 \ |
| 4943 | -c "client hello, adding renegotiation extension" \ |
| 4944 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4945 | -s "found renegotiation extension" \ |
| 4946 | -s "server hello, secure renegotiation extension" \ |
| 4947 | -c "found renegotiation extension" \ |
| 4948 | -c "=> renegotiate" \ |
| 4949 | -s "=> renegotiate" \ |
| 4950 | -s "write hello request" |
| 4951 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4952 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4954 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4955 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4956 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4957 | 0 \ |
| 4958 | -c "client hello, adding renegotiation extension" \ |
| 4959 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4960 | -s "found renegotiation extension" \ |
| 4961 | -s "server hello, secure renegotiation extension" \ |
| 4962 | -s "record counter limit reached: renegotiate" \ |
| 4963 | -c "=> renegotiate" \ |
| 4964 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4965 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4966 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4967 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4968 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4970 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4971 | "$G_SRV -u --mtu 4096" \ |
| 4972 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4973 | 0 \ |
| 4974 | -c "client hello, adding renegotiation extension" \ |
| 4975 | -c "found renegotiation extension" \ |
| 4976 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4977 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4978 | -C "error" \ |
| 4979 | -s "Extra-header:" |
| 4980 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4981 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4982 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4983 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4984 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4985 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4986 | "$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] | 4987 | "$P_CLI debug_level=3" \ |
| 4988 | 0 \ |
| 4989 | -c "found renegotiation extension" \ |
| 4990 | -C "error" \ |
| 4991 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4992 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4993 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4995 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4996 | "$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] | 4997 | "$P_CLI debug_level=3" \ |
| 4998 | 0 \ |
| 4999 | -C "found renegotiation extension" \ |
| 5000 | -C "error" \ |
| 5001 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5002 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5003 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5005 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5006 | "$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] | 5007 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5008 | 1 \ |
| 5009 | -C "found renegotiation extension" \ |
| 5010 | -c "error" \ |
| 5011 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5012 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5013 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5015 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5016 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5017 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5018 | 0 \ |
| 5019 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5020 | -s "server hello, secure renegotiation extension" |
| 5021 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5022 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5024 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5025 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5026 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5027 | 0 \ |
| 5028 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5029 | -S "server hello, secure renegotiation extension" |
| 5030 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5031 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5033 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5034 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5035 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5036 | 1 \ |
| 5037 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5038 | -S "server hello, secure renegotiation extension" |
| 5039 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5040 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5041 | |
| 5042 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5044 | run_test "DER format: no trailing bytes" \ |
| 5045 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5046 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5047 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5048 | 0 \ |
| 5049 | -c "Handshake was completed" \ |
| 5050 | |
| 5051 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5053 | run_test "DER format: with a trailing zero byte" \ |
| 5054 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5055 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5056 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5057 | 0 \ |
| 5058 | -c "Handshake was completed" \ |
| 5059 | |
| 5060 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5062 | run_test "DER format: with a trailing random byte" \ |
| 5063 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5064 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5065 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5066 | 0 \ |
| 5067 | -c "Handshake was completed" \ |
| 5068 | |
| 5069 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5071 | run_test "DER format: with 2 trailing random bytes" \ |
| 5072 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5073 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5074 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5075 | 0 \ |
| 5076 | -c "Handshake was completed" \ |
| 5077 | |
| 5078 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5080 | run_test "DER format: with 4 trailing random bytes" \ |
| 5081 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5082 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5083 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5084 | 0 \ |
| 5085 | -c "Handshake was completed" \ |
| 5086 | |
| 5087 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5089 | run_test "DER format: with 8 trailing random bytes" \ |
| 5090 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5091 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5092 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5093 | 0 \ |
| 5094 | -c "Handshake was completed" \ |
| 5095 | |
| 5096 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5098 | run_test "DER format: with 9 trailing random bytes" \ |
| 5099 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5100 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5101 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5102 | 0 \ |
| 5103 | -c "Handshake was completed" \ |
| 5104 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5105 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5106 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5108 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5109 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5110 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5111 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5112 | 1 \ |
| 5113 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5114 | -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] | 5115 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5116 | -c "X509 - Certificate verification failed" |
| 5117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5119 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5120 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5121 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5122 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5123 | 0 \ |
| 5124 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5125 | -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] | 5126 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5127 | -C "X509 - Certificate verification failed" |
| 5128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5130 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5131 | "$P_SRV" \ |
| 5132 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5133 | 0 \ |
| 5134 | -c "x509_verify_cert() returned" \ |
| 5135 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5136 | -c "! Certificate verification flags"\ |
| 5137 | -C "! mbedtls_ssl_handshake returned" \ |
| 5138 | -C "X509 - Certificate verification failed" \ |
| 5139 | -C "SSL - No CA Chain is set, but required to operate" |
| 5140 | |
| 5141 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5142 | "$P_SRV" \ |
| 5143 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5144 | 1 \ |
| 5145 | -c "x509_verify_cert() returned" \ |
| 5146 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5147 | -c "! Certificate verification flags"\ |
| 5148 | -c "! mbedtls_ssl_handshake returned" \ |
| 5149 | -c "SSL - No CA Chain is set, but required to operate" |
| 5150 | |
| 5151 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5152 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5153 | # the client informs the server about the supported curves - it does, though, in the |
| 5154 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5155 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5156 | # different means to have the server ignoring the client's supported curve list. |
| 5157 | |
| 5158 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5160 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5161 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5162 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5163 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5164 | 1 \ |
| 5165 | -c "bad certificate (EC key curve)"\ |
| 5166 | -c "! Certificate verification flags"\ |
| 5167 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5168 | |
| 5169 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5171 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5172 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5173 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5174 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5175 | 1 \ |
| 5176 | -c "bad certificate (EC key curve)"\ |
| 5177 | -c "! Certificate verification flags"\ |
| 5178 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5179 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5182 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5183 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5184 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5185 | 0 \ |
| 5186 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5187 | -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] | 5188 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5189 | -C "X509 - Certificate verification failed" |
| 5190 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5192 | run_test "Authentication: client SHA256, server required" \ |
| 5193 | "$P_SRV auth_mode=required" \ |
| 5194 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5195 | key_file=data_files/server6.key \ |
| 5196 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5197 | 0 \ |
| 5198 | -c "Supported Signature Algorithm found: 4," \ |
| 5199 | -c "Supported Signature Algorithm found: 5," |
| 5200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5202 | run_test "Authentication: client SHA384, server required" \ |
| 5203 | "$P_SRV auth_mode=required" \ |
| 5204 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5205 | key_file=data_files/server6.key \ |
| 5206 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5207 | 0 \ |
| 5208 | -c "Supported Signature Algorithm found: 4," \ |
| 5209 | -c "Supported Signature Algorithm found: 5," |
| 5210 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5211 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5212 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5213 | "$P_CLI debug_level=3 crt_file=none \ |
| 5214 | key_file=data_files/server5.key" \ |
| 5215 | 1 \ |
| 5216 | -S "skip write certificate request" \ |
| 5217 | -C "skip parse certificate request" \ |
| 5218 | -c "got a certificate request" \ |
| 5219 | -c "= write certificate$" \ |
| 5220 | -C "skip write certificate$" \ |
| 5221 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5222 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5223 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5224 | -s "No client certification received from the client, but required by the authentication mode" |
| 5225 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5226 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5227 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5228 | "$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] | 5229 | key_file=data_files/server5.key" \ |
| 5230 | 1 \ |
| 5231 | -S "skip write certificate request" \ |
| 5232 | -C "skip parse certificate request" \ |
| 5233 | -c "got a certificate request" \ |
| 5234 | -C "skip write certificate" \ |
| 5235 | -C "skip write certificate verify" \ |
| 5236 | -S "skip parse certificate verify" \ |
| 5237 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5238 | -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] | 5239 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5240 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5241 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5242 | # We don't check that the client receives the alert because it might |
| 5243 | # detect that its write end of the connection is closed and abort |
| 5244 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5245 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5246 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5247 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5248 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5249 | key_file=data_files/server5.key" \ |
| 5250 | 0 \ |
| 5251 | -S "skip write certificate request" \ |
| 5252 | -C "skip parse certificate request" \ |
| 5253 | -c "got a certificate request" \ |
| 5254 | -C "skip write certificate" \ |
| 5255 | -C "skip write certificate verify" \ |
| 5256 | -S "skip parse certificate verify" \ |
| 5257 | -S "x509_verify_cert() returned" \ |
| 5258 | -S "! The certificate is not correctly signed" \ |
| 5259 | -S "X509 - Certificate verification failed" |
| 5260 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5261 | run_test "Authentication: client cert not trusted, server required" \ |
| 5262 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5263 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5264 | key_file=data_files/server5.key" \ |
| 5265 | 1 \ |
| 5266 | -S "skip write certificate request" \ |
| 5267 | -C "skip parse certificate request" \ |
| 5268 | -c "got a certificate request" \ |
| 5269 | -C "skip write certificate" \ |
| 5270 | -C "skip write certificate verify" \ |
| 5271 | -S "skip parse certificate verify" \ |
| 5272 | -s "x509_verify_cert() returned" \ |
| 5273 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5274 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5275 | -s "X509 - Certificate verification failed" |
| 5276 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5277 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5278 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5279 | "$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] | 5280 | key_file=data_files/server5.key" \ |
| 5281 | 0 \ |
| 5282 | -S "skip write certificate request" \ |
| 5283 | -C "skip parse certificate request" \ |
| 5284 | -c "got a certificate request" \ |
| 5285 | -C "skip write certificate" \ |
| 5286 | -C "skip write certificate verify" \ |
| 5287 | -S "skip parse certificate verify" \ |
| 5288 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5289 | -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] | 5290 | -S "! mbedtls_ssl_handshake returned" \ |
| 5291 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5292 | -S "X509 - Certificate verification failed" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5295 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5296 | "$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] | 5297 | key_file=data_files/server5.key" \ |
| 5298 | 0 \ |
| 5299 | -s "skip write certificate request" \ |
| 5300 | -C "skip parse certificate request" \ |
| 5301 | -c "got no certificate request" \ |
| 5302 | -c "skip write certificate" \ |
| 5303 | -c "skip write certificate verify" \ |
| 5304 | -s "skip parse certificate verify" \ |
| 5305 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5306 | -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] | 5307 | -S "! mbedtls_ssl_handshake returned" \ |
| 5308 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5309 | -S "X509 - Certificate verification failed" |
| 5310 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5311 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5312 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5313 | "$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] | 5314 | 0 \ |
| 5315 | -S "skip write certificate request" \ |
| 5316 | -C "skip parse certificate request" \ |
| 5317 | -c "got a certificate request" \ |
| 5318 | -C "skip write certificate$" \ |
| 5319 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5320 | -c "skip write certificate verify" \ |
| 5321 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5322 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5323 | -S "! mbedtls_ssl_handshake returned" \ |
| 5324 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5325 | -S "X509 - Certificate verification failed" |
| 5326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5328 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5329 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5330 | "$O_CLI" \ |
| 5331 | 0 \ |
| 5332 | -S "skip write certificate request" \ |
| 5333 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5334 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5335 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5336 | -S "X509 - Certificate verification failed" |
| 5337 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5339 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5340 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5341 | "$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] | 5342 | 0 \ |
| 5343 | -C "skip parse certificate request" \ |
| 5344 | -c "got a certificate request" \ |
| 5345 | -C "skip write certificate$" \ |
| 5346 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5347 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5348 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5350 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5351 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5352 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5353 | 1 \ |
| 5354 | -C "skip parse certificate request" \ |
| 5355 | -c "got a certificate request" \ |
| 5356 | -C "skip write certificate$" \ |
| 5357 | -c "skip write certificate verify" \ |
| 5358 | -c "! mbedtls_ssl_handshake returned" |
| 5359 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5360 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5361 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5362 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5363 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5364 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5365 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5366 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5367 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5368 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5369 | # 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] | 5370 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5371 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5372 | run_test "Authentication: server max_int chain, client default" \ |
| 5373 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5374 | key_file=data_files/dir-maxpath/09.key" \ |
| 5375 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5376 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5377 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5378 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5379 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5380 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5381 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5382 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5383 | key_file=data_files/dir-maxpath/10.key" \ |
| 5384 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5385 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5386 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5387 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5388 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5389 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5391 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5392 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5393 | key_file=data_files/dir-maxpath/10.key" \ |
| 5394 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5395 | auth_mode=optional" \ |
| 5396 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5397 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5398 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5399 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5400 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5402 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5403 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5404 | key_file=data_files/dir-maxpath/10.key" \ |
| 5405 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5406 | auth_mode=none" \ |
| 5407 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5408 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5409 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5410 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5411 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5412 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5413 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5414 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5415 | key_file=data_files/dir-maxpath/10.key" \ |
| 5416 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5417 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5418 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5419 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5420 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5421 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5422 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5423 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5424 | key_file=data_files/dir-maxpath/10.key" \ |
| 5425 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5426 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5427 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5428 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5429 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5430 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5431 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5432 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5433 | key_file=data_files/dir-maxpath/10.key" \ |
| 5434 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5435 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5436 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5437 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5438 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5439 | run_test "Authentication: client max_int chain, server required" \ |
| 5440 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5441 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5442 | key_file=data_files/dir-maxpath/09.key" \ |
| 5443 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5444 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5445 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5446 | # Tests for CA list in CertificateRequest messages |
| 5447 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5449 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5450 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5451 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5452 | key_file=data_files/server6.key" \ |
| 5453 | 0 \ |
| 5454 | -s "requested DN" |
| 5455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5457 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5458 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5459 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5460 | key_file=data_files/server6.key" \ |
| 5461 | 0 \ |
| 5462 | -S "requested DN" |
| 5463 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5465 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5466 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5467 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5468 | key_file=data_files/server5.key" \ |
| 5469 | 1 \ |
| 5470 | -S "requested DN" \ |
| 5471 | -s "x509_verify_cert() returned" \ |
| 5472 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5473 | -s "! mbedtls_ssl_handshake returned" \ |
| 5474 | -c "! mbedtls_ssl_handshake returned" \ |
| 5475 | -s "X509 - Certificate verification failed" |
| 5476 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5478 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5479 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5480 | crt_file2=data_files/server1.crt \ |
| 5481 | key_file2=data_files/server1.key" \ |
| 5482 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5483 | crt_file=data_files/server6.crt \ |
| 5484 | key_file=data_files/server6.key" \ |
| 5485 | 0 \ |
| 5486 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5487 | |
| 5488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5489 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5490 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5491 | crt_file2=data_files/server2.crt \ |
| 5492 | key_file2=data_files/server2.key" \ |
| 5493 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5494 | crt_file=data_files/server6.crt \ |
| 5495 | key_file=data_files/server6.key" \ |
| 5496 | 0 \ |
| 5497 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5498 | |
| 5499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5500 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5501 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5502 | crt_file2=data_files/server1.crt \ |
| 5503 | key_file2=data_files/server1.key" \ |
| 5504 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5505 | crt_file=data_files/server6.crt \ |
| 5506 | key_file=data_files/server6.key" \ |
| 5507 | 0 \ |
| 5508 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5509 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5510 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5511 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5512 | |
| 5513 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5515 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5516 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5517 | key_file=data_files/server5.key" \ |
| 5518 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5519 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5520 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5521 | -c "x509_verify_cert() returned" \ |
| 5522 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5523 | -c "! mbedtls_ssl_handshake returned" \ |
| 5524 | -c "X509 - Certificate verification failed" |
| 5525 | |
| 5526 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5528 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5529 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5530 | key_file=data_files/server5.key" \ |
| 5531 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5532 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5533 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5534 | -c "x509_verify_cert() returned" \ |
| 5535 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5536 | -C "! mbedtls_ssl_handshake returned" \ |
| 5537 | -C "X509 - Certificate verification failed" |
| 5538 | |
| 5539 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5540 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5541 | # the client informs the server about the supported curves - it does, though, in the |
| 5542 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5543 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5544 | # different means to have the server ignoring the client's supported curve list. |
| 5545 | |
| 5546 | requires_config_enabled MBEDTLS_ECP_C |
| 5547 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5548 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5549 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5550 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5551 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5552 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5553 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5554 | -c "use CA callback for X.509 CRT verification" \ |
| 5555 | -c "bad certificate (EC key curve)" \ |
| 5556 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5557 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5558 | |
| 5559 | requires_config_enabled MBEDTLS_ECP_C |
| 5560 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5562 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5563 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5564 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5565 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5566 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5567 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5568 | -c "bad certificate (EC key curve)"\ |
| 5569 | -c "! Certificate verification flags"\ |
| 5570 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5571 | |
| 5572 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5574 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5575 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5576 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5577 | key_file=data_files/server6.key \ |
| 5578 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5579 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5580 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5581 | -c "Supported Signature Algorithm found: 4," \ |
| 5582 | -c "Supported Signature Algorithm found: 5," |
| 5583 | |
| 5584 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5586 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5587 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5588 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5589 | key_file=data_files/server6.key \ |
| 5590 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5591 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5592 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5593 | -c "Supported Signature Algorithm found: 4," \ |
| 5594 | -c "Supported Signature Algorithm found: 5," |
| 5595 | |
| 5596 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5598 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5599 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5600 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5601 | key_file=data_files/server5.key" \ |
| 5602 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5603 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5604 | -S "skip write certificate request" \ |
| 5605 | -C "skip parse certificate request" \ |
| 5606 | -c "got a certificate request" \ |
| 5607 | -C "skip write certificate" \ |
| 5608 | -C "skip write certificate verify" \ |
| 5609 | -S "skip parse certificate verify" \ |
| 5610 | -s "x509_verify_cert() returned" \ |
| 5611 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5612 | -s "! mbedtls_ssl_handshake returned" \ |
| 5613 | -s "send alert level=2 message=48" \ |
| 5614 | -c "! mbedtls_ssl_handshake returned" \ |
| 5615 | -s "X509 - Certificate verification failed" |
| 5616 | # We don't check that the client receives the alert because it might |
| 5617 | # detect that its write end of the connection is closed and abort |
| 5618 | # before reading the alert message. |
| 5619 | |
| 5620 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5622 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5623 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5624 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5625 | key_file=data_files/server5.key" \ |
| 5626 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5627 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5628 | -S "skip write certificate request" \ |
| 5629 | -C "skip parse certificate request" \ |
| 5630 | -c "got a certificate request" \ |
| 5631 | -C "skip write certificate" \ |
| 5632 | -C "skip write certificate verify" \ |
| 5633 | -S "skip parse certificate verify" \ |
| 5634 | -s "x509_verify_cert() returned" \ |
| 5635 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5636 | -s "! mbedtls_ssl_handshake returned" \ |
| 5637 | -c "! mbedtls_ssl_handshake returned" \ |
| 5638 | -s "X509 - Certificate verification failed" |
| 5639 | |
| 5640 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5642 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5643 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5644 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5645 | key_file=data_files/server5.key" \ |
| 5646 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5647 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5648 | -S "skip write certificate request" \ |
| 5649 | -C "skip parse certificate request" \ |
| 5650 | -c "got a certificate request" \ |
| 5651 | -C "skip write certificate" \ |
| 5652 | -C "skip write certificate verify" \ |
| 5653 | -S "skip parse certificate verify" \ |
| 5654 | -s "x509_verify_cert() returned" \ |
| 5655 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5656 | -S "! mbedtls_ssl_handshake returned" \ |
| 5657 | -C "! mbedtls_ssl_handshake returned" \ |
| 5658 | -S "X509 - Certificate verification failed" |
| 5659 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5660 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5661 | requires_full_size_output_buffer |
| 5662 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5664 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5665 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5666 | key_file=data_files/dir-maxpath/09.key" \ |
| 5667 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5668 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5669 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5670 | -C "X509 - A fatal error occurred" |
| 5671 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5672 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5673 | requires_full_size_output_buffer |
| 5674 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5676 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5677 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5678 | key_file=data_files/dir-maxpath/10.key" \ |
| 5679 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5680 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5681 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5682 | -c "X509 - A fatal error occurred" |
| 5683 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5684 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5685 | requires_full_size_output_buffer |
| 5686 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5688 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5689 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5690 | key_file=data_files/dir-maxpath/10.key" \ |
| 5691 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5692 | debug_level=3 auth_mode=optional" \ |
| 5693 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5694 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5695 | -c "X509 - A fatal error occurred" |
| 5696 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5697 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5698 | requires_full_size_output_buffer |
| 5699 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5701 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5702 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5703 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5704 | key_file=data_files/dir-maxpath/10.key" \ |
| 5705 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5706 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5707 | -s "X509 - A fatal error occurred" |
| 5708 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5709 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5710 | requires_full_size_output_buffer |
| 5711 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5713 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5714 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5715 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5716 | key_file=data_files/dir-maxpath/10.key" \ |
| 5717 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5718 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5719 | -s "X509 - A fatal error occurred" |
| 5720 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5721 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5722 | requires_full_size_output_buffer |
| 5723 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5725 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5726 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5727 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5728 | key_file=data_files/dir-maxpath/09.key" \ |
| 5729 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5730 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5731 | -S "X509 - A fatal error occurred" |
| 5732 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5733 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5734 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5735 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5736 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5737 | "$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] | 5738 | key_file=data_files/server5.key \ |
| 5739 | crt_file2=data_files/server5-sha1.crt \ |
| 5740 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5741 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5742 | 0 \ |
| 5743 | -c "signed using.*ECDSA with SHA256" \ |
| 5744 | -C "signed using.*ECDSA with SHA1" |
| 5745 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5746 | # tests for SNI |
| 5747 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5748 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5749 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5750 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5751 | 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] | 5752 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5753 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5754 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5755 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5756 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5757 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5758 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5759 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5760 | 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] | 5761 | 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] | 5762 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5763 | 0 \ |
| 5764 | -s "parse ServerName extension" \ |
| 5765 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5766 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5767 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5768 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5769 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5770 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5771 | 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] | 5772 | 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] | 5773 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5774 | 0 \ |
| 5775 | -s "parse ServerName extension" \ |
| 5776 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5777 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5778 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5779 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5780 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5781 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5782 | 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] | 5783 | 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] | 5784 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5785 | 1 \ |
| 5786 | -s "parse ServerName extension" \ |
| 5787 | -s "ssl_sni_wrapper() returned" \ |
| 5788 | -s "mbedtls_ssl_handshake returned" \ |
| 5789 | -c "mbedtls_ssl_handshake returned" \ |
| 5790 | -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] | 5791 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5792 | run_test "SNI: client auth no override: optional" \ |
| 5793 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5794 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5795 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5796 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5797 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5798 | -S "skip write certificate request" \ |
| 5799 | -C "skip parse certificate request" \ |
| 5800 | -c "got a certificate request" \ |
| 5801 | -C "skip write certificate" \ |
| 5802 | -C "skip write certificate verify" \ |
| 5803 | -S "skip parse certificate verify" |
| 5804 | |
| 5805 | run_test "SNI: client auth override: none -> optional" \ |
| 5806 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5807 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5808 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5809 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5810 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5811 | -S "skip write certificate request" \ |
| 5812 | -C "skip parse certificate request" \ |
| 5813 | -c "got a certificate request" \ |
| 5814 | -C "skip write certificate" \ |
| 5815 | -C "skip write certificate verify" \ |
| 5816 | -S "skip parse certificate verify" |
| 5817 | |
| 5818 | run_test "SNI: client auth override: optional -> none" \ |
| 5819 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5820 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5821 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5822 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5823 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5824 | -s "skip write certificate request" \ |
| 5825 | -C "skip parse certificate request" \ |
| 5826 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 5827 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5828 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5829 | run_test "SNI: CA no override" \ |
| 5830 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5831 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5832 | ca_file=data_files/test-ca.crt \ |
| 5833 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5834 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5835 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5836 | 1 \ |
| 5837 | -S "skip write certificate request" \ |
| 5838 | -C "skip parse certificate request" \ |
| 5839 | -c "got a certificate request" \ |
| 5840 | -C "skip write certificate" \ |
| 5841 | -C "skip write certificate verify" \ |
| 5842 | -S "skip parse certificate verify" \ |
| 5843 | -s "x509_verify_cert() returned" \ |
| 5844 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5845 | -S "The certificate has been revoked (is on a CRL)" |
| 5846 | |
| 5847 | run_test "SNI: CA override" \ |
| 5848 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5849 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5850 | ca_file=data_files/test-ca.crt \ |
| 5851 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5852 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5853 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5854 | 0 \ |
| 5855 | -S "skip write certificate request" \ |
| 5856 | -C "skip parse certificate request" \ |
| 5857 | -c "got a certificate request" \ |
| 5858 | -C "skip write certificate" \ |
| 5859 | -C "skip write certificate verify" \ |
| 5860 | -S "skip parse certificate verify" \ |
| 5861 | -S "x509_verify_cert() returned" \ |
| 5862 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5863 | -S "The certificate has been revoked (is on a CRL)" |
| 5864 | |
| 5865 | run_test "SNI: CA override with CRL" \ |
| 5866 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5867 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5868 | ca_file=data_files/test-ca.crt \ |
| 5869 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5870 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5871 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5872 | 1 \ |
| 5873 | -S "skip write certificate request" \ |
| 5874 | -C "skip parse certificate request" \ |
| 5875 | -c "got a certificate request" \ |
| 5876 | -C "skip write certificate" \ |
| 5877 | -C "skip write certificate verify" \ |
| 5878 | -S "skip parse certificate verify" \ |
| 5879 | -s "x509_verify_cert() returned" \ |
| 5880 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5881 | -s "The certificate has been revoked (is on a CRL)" |
| 5882 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5883 | # Tests for SNI and DTLS |
| 5884 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5885 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5887 | run_test "SNI: DTLS, no SNI callback" \ |
| 5888 | "$P_SRV debug_level=3 dtls=1 \ |
| 5889 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5890 | "$P_CLI server_name=localhost dtls=1" \ |
| 5891 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5892 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5893 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5894 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5895 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5897 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5898 | "$P_SRV debug_level=3 dtls=1 \ |
| 5899 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5900 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5901 | "$P_CLI server_name=localhost dtls=1" \ |
| 5902 | 0 \ |
| 5903 | -s "parse ServerName extension" \ |
| 5904 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5905 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5906 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5907 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5909 | run_test "SNI: DTLS, matching cert 2" \ |
| 5910 | "$P_SRV debug_level=3 dtls=1 \ |
| 5911 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5912 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5913 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5914 | 0 \ |
| 5915 | -s "parse ServerName extension" \ |
| 5916 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5917 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5920 | run_test "SNI: DTLS, no matching cert" \ |
| 5921 | "$P_SRV debug_level=3 dtls=1 \ |
| 5922 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5923 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5924 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5925 | 1 \ |
| 5926 | -s "parse ServerName extension" \ |
| 5927 | -s "ssl_sni_wrapper() returned" \ |
| 5928 | -s "mbedtls_ssl_handshake returned" \ |
| 5929 | -c "mbedtls_ssl_handshake returned" \ |
| 5930 | -c "SSL - A fatal alert message was received from our peer" |
| 5931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5933 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5934 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5935 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5936 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5937 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5938 | 0 \ |
| 5939 | -S "skip write certificate request" \ |
| 5940 | -C "skip parse certificate request" \ |
| 5941 | -c "got a certificate request" \ |
| 5942 | -C "skip write certificate" \ |
| 5943 | -C "skip write certificate verify" \ |
| 5944 | -S "skip parse certificate verify" |
| 5945 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5946 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5947 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5948 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5949 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5950 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5951 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5952 | 0 \ |
| 5953 | -S "skip write certificate request" \ |
| 5954 | -C "skip parse certificate request" \ |
| 5955 | -c "got a certificate request" \ |
| 5956 | -C "skip write certificate" \ |
| 5957 | -C "skip write certificate verify" \ |
| 5958 | -S "skip parse certificate verify" |
| 5959 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5961 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5962 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5963 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5964 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5965 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5966 | 0 \ |
| 5967 | -s "skip write certificate request" \ |
| 5968 | -C "skip parse certificate request" \ |
| 5969 | -c "got no certificate request" \ |
| 5970 | -c "skip write certificate" \ |
| 5971 | -c "skip write certificate verify" \ |
| 5972 | -s "skip parse certificate verify" |
| 5973 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5975 | run_test "SNI: DTLS, CA no override" \ |
| 5976 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5977 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5978 | ca_file=data_files/test-ca.crt \ |
| 5979 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5980 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5981 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5982 | 1 \ |
| 5983 | -S "skip write certificate request" \ |
| 5984 | -C "skip parse certificate request" \ |
| 5985 | -c "got a certificate request" \ |
| 5986 | -C "skip write certificate" \ |
| 5987 | -C "skip write certificate verify" \ |
| 5988 | -S "skip parse certificate verify" \ |
| 5989 | -s "x509_verify_cert() returned" \ |
| 5990 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5991 | -S "The certificate has been revoked (is on a CRL)" |
| 5992 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5994 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5995 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5996 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5997 | ca_file=data_files/test-ca.crt \ |
| 5998 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5999 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6000 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6001 | 0 \ |
| 6002 | -S "skip write certificate request" \ |
| 6003 | -C "skip parse certificate request" \ |
| 6004 | -c "got a certificate request" \ |
| 6005 | -C "skip write certificate" \ |
| 6006 | -C "skip write certificate verify" \ |
| 6007 | -S "skip parse certificate verify" \ |
| 6008 | -S "x509_verify_cert() returned" \ |
| 6009 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6010 | -S "The certificate has been revoked (is on a CRL)" |
| 6011 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6013 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6014 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6015 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6016 | ca_file=data_files/test-ca.crt \ |
| 6017 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6018 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6019 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6020 | 1 \ |
| 6021 | -S "skip write certificate request" \ |
| 6022 | -C "skip parse certificate request" \ |
| 6023 | -c "got a certificate request" \ |
| 6024 | -C "skip write certificate" \ |
| 6025 | -C "skip write certificate verify" \ |
| 6026 | -S "skip parse certificate verify" \ |
| 6027 | -s "x509_verify_cert() returned" \ |
| 6028 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6029 | -s "The certificate has been revoked (is on a CRL)" |
| 6030 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6031 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6033 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6034 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6035 | "$P_CLI nbio=2 tickets=0" \ |
| 6036 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6037 | -S "mbedtls_ssl_handshake returned" \ |
| 6038 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6039 | -c "Read from server: .* bytes read" |
| 6040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6041 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6042 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6043 | "$P_CLI nbio=2 tickets=0" \ |
| 6044 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6045 | -S "mbedtls_ssl_handshake returned" \ |
| 6046 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6047 | -c "Read from server: .* bytes read" |
| 6048 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6050 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6051 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6052 | "$P_CLI nbio=2 tickets=1" \ |
| 6053 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6054 | -S "mbedtls_ssl_handshake returned" \ |
| 6055 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6056 | -c "Read from server: .* bytes read" |
| 6057 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6059 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6060 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6061 | "$P_CLI nbio=2 tickets=1" \ |
| 6062 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6063 | -S "mbedtls_ssl_handshake returned" \ |
| 6064 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6065 | -c "Read from server: .* bytes read" |
| 6066 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6068 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6069 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6070 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6071 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6072 | -S "mbedtls_ssl_handshake returned" \ |
| 6073 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6074 | -c "Read from server: .* bytes read" |
| 6075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6077 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6078 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6079 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6080 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6081 | -S "mbedtls_ssl_handshake returned" \ |
| 6082 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6083 | -c "Read from server: .* bytes read" |
| 6084 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "Non-blocking I/O: session-id resume" \ |
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 reconnect=1" \ |
| 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 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6094 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6095 | |
| 6096 | run_test "Event-driven I/O: basic handshake" \ |
| 6097 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6098 | "$P_CLI event=1 tickets=0" \ |
| 6099 | 0 \ |
| 6100 | -S "mbedtls_ssl_handshake returned" \ |
| 6101 | -C "mbedtls_ssl_handshake returned" \ |
| 6102 | -c "Read from server: .* bytes read" |
| 6103 | |
| 6104 | run_test "Event-driven I/O: client auth" \ |
| 6105 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6106 | "$P_CLI event=1 tickets=0" \ |
| 6107 | 0 \ |
| 6108 | -S "mbedtls_ssl_handshake returned" \ |
| 6109 | -C "mbedtls_ssl_handshake returned" \ |
| 6110 | -c "Read from server: .* bytes read" |
| 6111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6113 | run_test "Event-driven I/O: ticket" \ |
| 6114 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6115 | "$P_CLI event=1 tickets=1" \ |
| 6116 | 0 \ |
| 6117 | -S "mbedtls_ssl_handshake returned" \ |
| 6118 | -C "mbedtls_ssl_handshake returned" \ |
| 6119 | -c "Read from server: .* bytes read" |
| 6120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6122 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6123 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6124 | "$P_CLI event=1 tickets=1" \ |
| 6125 | 0 \ |
| 6126 | -S "mbedtls_ssl_handshake returned" \ |
| 6127 | -C "mbedtls_ssl_handshake returned" \ |
| 6128 | -c "Read from server: .* bytes read" |
| 6129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6131 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6132 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6133 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6134 | 0 \ |
| 6135 | -S "mbedtls_ssl_handshake returned" \ |
| 6136 | -C "mbedtls_ssl_handshake returned" \ |
| 6137 | -c "Read from server: .* bytes read" |
| 6138 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6140 | run_test "Event-driven I/O: ticket + resume" \ |
| 6141 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6142 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6143 | 0 \ |
| 6144 | -S "mbedtls_ssl_handshake returned" \ |
| 6145 | -C "mbedtls_ssl_handshake returned" \ |
| 6146 | -c "Read from server: .* bytes read" |
| 6147 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6149 | run_test "Event-driven I/O: session-id resume" \ |
| 6150 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6151 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6152 | 0 \ |
| 6153 | -S "mbedtls_ssl_handshake returned" \ |
| 6154 | -C "mbedtls_ssl_handshake returned" \ |
| 6155 | -c "Read from server: .* bytes read" |
| 6156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6158 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6159 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6160 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6161 | 0 \ |
| 6162 | -c "Read from server: .* bytes read" |
| 6163 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6165 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6166 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6167 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6168 | 0 \ |
| 6169 | -c "Read from server: .* bytes read" |
| 6170 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6172 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6173 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6174 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6175 | 0 \ |
| 6176 | -c "Read from server: .* bytes read" |
| 6177 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6179 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6180 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6181 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6182 | 0 \ |
| 6183 | -c "Read from server: .* bytes read" |
| 6184 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6186 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6187 | "$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] | 6188 | "$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] | 6189 | 0 \ |
| 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 | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6193 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6194 | "$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] | 6195 | "$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] | 6196 | 0 \ |
| 6197 | -c "Read from server: .* bytes read" |
| 6198 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6200 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6201 | "$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] | 6202 | "$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] | 6203 | 0 \ |
| 6204 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6205 | |
| 6206 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6207 | # During session resumption, the client will send its ApplicationData record |
| 6208 | # within the same datagram as the Finished messages. In this situation, the |
| 6209 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6210 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6212 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6213 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6214 | "$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] | 6215 | "$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] | 6216 | 0 \ |
| 6217 | -c "Read from server: .* bytes read" |
| 6218 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6219 | # Tests for version negotiation |
| 6220 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6222 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6223 | "$P_SRV" \ |
| 6224 | "$P_CLI" \ |
| 6225 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6226 | -S "mbedtls_ssl_handshake returned" \ |
| 6227 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6228 | -s "Protocol is TLSv1.2" \ |
| 6229 | -c "Protocol is TLSv1.2" |
| 6230 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6232 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6233 | "$P_SRV" \ |
| 6234 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6235 | 1 \ |
| 6236 | -s "Handshake protocol not within min/max boundaries" \ |
| 6237 | -c "Error in protocol version" \ |
| 6238 | -S "Protocol is TLSv1.0" \ |
| 6239 | -C "Handshake was completed" |
| 6240 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6242 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6243 | "$P_SRV" \ |
| 6244 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6245 | 1 \ |
| 6246 | -s "Handshake protocol not within min/max boundaries" \ |
| 6247 | -c "Error in protocol version" \ |
| 6248 | -S "Protocol is TLSv1.1" \ |
| 6249 | -C "Handshake was completed" |
| 6250 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6251 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6252 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6253 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6254 | "$P_CLI" \ |
| 6255 | 1 \ |
| 6256 | -s "Error in protocol version" \ |
| 6257 | -c "Handshake protocol not within min/max boundaries" \ |
| 6258 | -S "Version: TLS1.0" \ |
| 6259 | -C "Protocol is TLSv1.0" |
| 6260 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6262 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6263 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6264 | "$P_CLI" \ |
| 6265 | 1 \ |
| 6266 | -s "Error in protocol version" \ |
| 6267 | -c "Handshake protocol not within min/max boundaries" \ |
| 6268 | -S "Version: TLS1.1" \ |
| 6269 | -C "Protocol is TLSv1.1" |
| 6270 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6271 | # Tests for ALPN extension |
| 6272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6273 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6274 | "$P_SRV debug_level=3" \ |
| 6275 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6276 | 0 \ |
| 6277 | -C "client hello, adding alpn extension" \ |
| 6278 | -S "found alpn extension" \ |
| 6279 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6280 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6281 | -C "found alpn extension " \ |
| 6282 | -C "Application Layer Protocol is" \ |
| 6283 | -S "Application Layer Protocol is" |
| 6284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6285 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6286 | "$P_SRV debug_level=3" \ |
| 6287 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6288 | 0 \ |
| 6289 | -c "client hello, adding alpn extension" \ |
| 6290 | -s "found alpn extension" \ |
| 6291 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6292 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6293 | -C "found alpn extension " \ |
| 6294 | -c "Application Layer Protocol is (none)" \ |
| 6295 | -S "Application Layer Protocol is" |
| 6296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6297 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6298 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6299 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6300 | 0 \ |
| 6301 | -C "client hello, adding alpn extension" \ |
| 6302 | -S "found alpn extension" \ |
| 6303 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6304 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6305 | -C "found alpn extension " \ |
| 6306 | -C "Application Layer Protocol is" \ |
| 6307 | -s "Application Layer Protocol is (none)" |
| 6308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6309 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6310 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6311 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6312 | 0 \ |
| 6313 | -c "client hello, adding alpn extension" \ |
| 6314 | -s "found alpn extension" \ |
| 6315 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6316 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6317 | -c "found alpn extension" \ |
| 6318 | -c "Application Layer Protocol is abc" \ |
| 6319 | -s "Application Layer Protocol is abc" |
| 6320 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6321 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6322 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6323 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6324 | 0 \ |
| 6325 | -c "client hello, adding alpn extension" \ |
| 6326 | -s "found alpn extension" \ |
| 6327 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6328 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6329 | -c "found alpn extension" \ |
| 6330 | -c "Application Layer Protocol is abc" \ |
| 6331 | -s "Application Layer Protocol is abc" |
| 6332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6333 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6334 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6335 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6336 | 0 \ |
| 6337 | -c "client hello, adding alpn extension" \ |
| 6338 | -s "found alpn extension" \ |
| 6339 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6340 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6341 | -c "found alpn extension" \ |
| 6342 | -c "Application Layer Protocol is 1234" \ |
| 6343 | -s "Application Layer Protocol is 1234" |
| 6344 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6345 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6346 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6347 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6348 | 1 \ |
| 6349 | -c "client hello, adding alpn extension" \ |
| 6350 | -s "found alpn extension" \ |
| 6351 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6352 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6353 | -C "found alpn extension" \ |
| 6354 | -C "Application Layer Protocol is 1234" \ |
| 6355 | -S "Application Layer Protocol is 1234" |
| 6356 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6357 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6358 | # Tests for keyUsage in leaf certificates, part 1: |
| 6359 | # server-side certificate/suite selection |
| 6360 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6361 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6362 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6363 | "$P_SRV key_file=data_files/server2.key \ |
| 6364 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6365 | "$P_CLI" \ |
| 6366 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6367 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6368 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6370 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6371 | "$P_SRV key_file=data_files/server2.key \ |
| 6372 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6373 | "$P_CLI" \ |
| 6374 | 0 \ |
| 6375 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6378 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6379 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6380 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6381 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6382 | 1 \ |
| 6383 | -C "Ciphersuite is " |
| 6384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6386 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6387 | "$P_SRV key_file=data_files/server5.key \ |
| 6388 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6389 | "$P_CLI" \ |
| 6390 | 0 \ |
| 6391 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6392 | |
| 6393 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6395 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6396 | "$P_SRV key_file=data_files/server5.key \ |
| 6397 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6398 | "$P_CLI" \ |
| 6399 | 0 \ |
| 6400 | -c "Ciphersuite is TLS-ECDH-" |
| 6401 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6403 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6404 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6405 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6406 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6407 | 1 \ |
| 6408 | -C "Ciphersuite is " |
| 6409 | |
| 6410 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6411 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6412 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6414 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6415 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6416 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6417 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6418 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6419 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6420 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6421 | -C "Processing of the Certificate handshake message failed" \ |
| 6422 | -c "Ciphersuite is TLS-" |
| 6423 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6425 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6426 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6427 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6428 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6429 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6430 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6431 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6432 | -C "Processing of the Certificate handshake message failed" \ |
| 6433 | -c "Ciphersuite is TLS-" |
| 6434 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6436 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6437 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6438 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6439 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6440 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6441 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6442 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6443 | -C "Processing of the Certificate handshake message failed" \ |
| 6444 | -c "Ciphersuite is TLS-" |
| 6445 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6447 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6448 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6449 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6450 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6451 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6452 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6453 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6454 | -c "Processing of the Certificate handshake message failed" \ |
| 6455 | -C "Ciphersuite is TLS-" |
| 6456 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6458 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6459 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6460 | -cert data_files/server2.ku-ke.crt" \ |
| 6461 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6462 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6463 | 0 \ |
| 6464 | -c "bad certificate (usage extensions)" \ |
| 6465 | -C "Processing of the Certificate handshake message failed" \ |
| 6466 | -c "Ciphersuite is TLS-" \ |
| 6467 | -c "! Usage does not match the keyUsage extension" |
| 6468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6470 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6471 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6472 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6473 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6474 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6475 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6476 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6477 | -C "Processing of the Certificate handshake message failed" \ |
| 6478 | -c "Ciphersuite is TLS-" |
| 6479 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6481 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6482 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6483 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6484 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6485 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6486 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6487 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6488 | -c "Processing of the Certificate handshake message failed" \ |
| 6489 | -C "Ciphersuite is TLS-" |
| 6490 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6492 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6493 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6494 | -cert data_files/server2.ku-ds.crt" \ |
| 6495 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6496 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6497 | 0 \ |
| 6498 | -c "bad certificate (usage extensions)" \ |
| 6499 | -C "Processing of the Certificate handshake message failed" \ |
| 6500 | -c "Ciphersuite is TLS-" \ |
| 6501 | -c "! Usage does not match the keyUsage extension" |
| 6502 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6504 | requires_openssl_tls1_3 |
| 6505 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6506 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6507 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6508 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6509 | "$P_CLI debug_level=3" \ |
| 6510 | 0 \ |
| 6511 | -C "bad certificate (usage extensions)" \ |
| 6512 | -C "Processing of the Certificate handshake message failed" \ |
| 6513 | -c "Ciphersuite is" |
| 6514 | |
| 6515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6516 | requires_openssl_tls1_3 |
| 6517 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6518 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6519 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6520 | -cert data_files/server2.ku-ke.crt" \ |
| 6521 | "$P_CLI debug_level=1" \ |
| 6522 | 1 \ |
| 6523 | -c "bad certificate (usage extensions)" \ |
| 6524 | -c "Processing of the Certificate handshake message failed" \ |
| 6525 | -C "Ciphersuite is" |
| 6526 | |
| 6527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6528 | requires_openssl_tls1_3 |
| 6529 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6530 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6531 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6532 | -cert data_files/server2.ku-ka.crt" \ |
| 6533 | "$P_CLI debug_level=1" \ |
| 6534 | 1 \ |
| 6535 | -c "bad certificate (usage extensions)" \ |
| 6536 | -c "Processing of the Certificate handshake message failed" \ |
| 6537 | -C "Ciphersuite is" |
| 6538 | |
| 6539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6540 | requires_openssl_tls1_3 |
| 6541 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6542 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6543 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6544 | -cert data_files/server5.ku-ds.crt" \ |
| 6545 | "$P_CLI debug_level=3" \ |
| 6546 | 0 \ |
| 6547 | -C "bad certificate (usage extensions)" \ |
| 6548 | -C "Processing of the Certificate handshake message failed" \ |
| 6549 | -c "Ciphersuite is" |
| 6550 | |
| 6551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6552 | requires_openssl_tls1_3 |
| 6553 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6554 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6555 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6556 | -cert data_files/server5.ku-ke.crt" \ |
| 6557 | "$P_CLI debug_level=1" \ |
| 6558 | 1 \ |
| 6559 | -c "bad certificate (usage extensions)" \ |
| 6560 | -c "Processing of the Certificate handshake message failed" \ |
| 6561 | -C "Ciphersuite is" |
| 6562 | |
| 6563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6564 | requires_openssl_tls1_3 |
| 6565 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6566 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6567 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6568 | -cert data_files/server5.ku-ka.crt" \ |
| 6569 | "$P_CLI debug_level=1" \ |
| 6570 | 1 \ |
| 6571 | -c "bad certificate (usage extensions)" \ |
| 6572 | -c "Processing of the Certificate handshake message failed" \ |
| 6573 | -C "Ciphersuite is" |
| 6574 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6575 | # Tests for keyUsage in leaf certificates, part 3: |
| 6576 | # server-side checking of client cert |
| 6577 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6579 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6580 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6581 | "$O_CLI -key data_files/server2.key \ |
| 6582 | -cert data_files/server2.ku-ds.crt" \ |
| 6583 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6584 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6585 | -S "bad certificate (usage extensions)" \ |
| 6586 | -S "Processing of the Certificate handshake message failed" |
| 6587 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6589 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6590 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6591 | "$O_CLI -key data_files/server2.key \ |
| 6592 | -cert data_files/server2.ku-ke.crt" \ |
| 6593 | 0 \ |
| 6594 | -s "bad certificate (usage extensions)" \ |
| 6595 | -S "Processing of the Certificate handshake message failed" |
| 6596 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6598 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6599 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6600 | "$O_CLI -key data_files/server2.key \ |
| 6601 | -cert data_files/server2.ku-ke.crt" \ |
| 6602 | 1 \ |
| 6603 | -s "bad certificate (usage extensions)" \ |
| 6604 | -s "Processing of the Certificate handshake message failed" |
| 6605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6607 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6608 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6609 | "$O_CLI -key data_files/server5.key \ |
| 6610 | -cert data_files/server5.ku-ds.crt" \ |
| 6611 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6612 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6613 | -S "bad certificate (usage extensions)" \ |
| 6614 | -S "Processing of the Certificate handshake message failed" |
| 6615 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6617 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6618 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6619 | "$O_CLI -key data_files/server5.key \ |
| 6620 | -cert data_files/server5.ku-ka.crt" \ |
| 6621 | 0 \ |
| 6622 | -s "bad certificate (usage extensions)" \ |
| 6623 | -S "Processing of the Certificate handshake message failed" |
| 6624 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6626 | requires_openssl_tls1_3 |
| 6627 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6628 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
| 6629 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6630 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6631 | -cert data_files/server2.ku-ds.crt" \ |
| 6632 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6633 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6634 | -S "bad certificate (usage extensions)" \ |
| 6635 | -S "Processing of the Certificate handshake message failed" |
| 6636 | |
| 6637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6638 | requires_openssl_tls1_3 |
| 6639 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6640 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 6641 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6642 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6643 | -cert data_files/server2.ku-ke.crt" \ |
| 6644 | 0 \ |
| 6645 | -s "bad certificate (usage extensions)" \ |
| 6646 | -S "Processing of the Certificate handshake message failed" |
| 6647 | |
| 6648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6649 | requires_openssl_tls1_3 |
| 6650 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6651 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
| 6652 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6653 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6654 | -cert data_files/server5.ku-ds.crt" \ |
| 6655 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6656 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6657 | -S "bad certificate (usage extensions)" \ |
| 6658 | -S "Processing of the Certificate handshake message failed" |
| 6659 | |
| 6660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6661 | requires_openssl_tls1_3 |
| 6662 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6663 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
| 6664 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6665 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6666 | -cert data_files/server5.ku-ka.crt" \ |
| 6667 | 0 \ |
| 6668 | -s "bad certificate (usage extensions)" \ |
| 6669 | -S "Processing of the Certificate handshake message failed" |
| 6670 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6671 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6672 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6674 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6675 | "$P_SRV key_file=data_files/server5.key \ |
| 6676 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6677 | "$P_CLI" \ |
| 6678 | 0 |
| 6679 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6681 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6682 | "$P_SRV key_file=data_files/server5.key \ |
| 6683 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6684 | "$P_CLI" \ |
| 6685 | 0 |
| 6686 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6688 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6689 | "$P_SRV key_file=data_files/server5.key \ |
| 6690 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6691 | "$P_CLI" \ |
| 6692 | 0 |
| 6693 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6695 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6696 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6697 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6698 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6699 | 1 |
| 6700 | |
| 6701 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6702 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6703 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6704 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6705 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6706 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6707 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6708 | 0 \ |
| 6709 | -C "bad certificate (usage extensions)" \ |
| 6710 | -C "Processing of the Certificate handshake message failed" \ |
| 6711 | -c "Ciphersuite is TLS-" |
| 6712 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6714 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6715 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6716 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6717 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6718 | 0 \ |
| 6719 | -C "bad certificate (usage extensions)" \ |
| 6720 | -C "Processing of the Certificate handshake message failed" \ |
| 6721 | -c "Ciphersuite is TLS-" |
| 6722 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6724 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6725 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6726 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6727 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6728 | 0 \ |
| 6729 | -C "bad certificate (usage extensions)" \ |
| 6730 | -C "Processing of the Certificate handshake message failed" \ |
| 6731 | -c "Ciphersuite is TLS-" |
| 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 cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6735 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6736 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6737 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6738 | 1 \ |
| 6739 | -c "bad certificate (usage extensions)" \ |
| 6740 | -c "Processing of the Certificate handshake message failed" \ |
| 6741 | -C "Ciphersuite is TLS-" |
| 6742 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6744 | requires_openssl_tls1_3 |
| 6745 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6746 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6747 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6748 | -cert data_files/server5.eku-srv.crt" \ |
| 6749 | "$P_CLI debug_level=1" \ |
| 6750 | 0 \ |
| 6751 | -C "bad certificate (usage extensions)" \ |
| 6752 | -C "Processing of the Certificate handshake message failed" \ |
| 6753 | -c "Ciphersuite is" |
| 6754 | |
| 6755 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6756 | requires_openssl_tls1_3 |
| 6757 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6758 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6759 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6760 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6761 | "$P_CLI debug_level=1" \ |
| 6762 | 0 \ |
| 6763 | -C "bad certificate (usage extensions)" \ |
| 6764 | -C "Processing of the Certificate handshake message failed" \ |
| 6765 | -c "Ciphersuite is" |
| 6766 | |
| 6767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6768 | requires_openssl_tls1_3 |
| 6769 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6770 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6771 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6772 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6773 | "$P_CLI debug_level=1" \ |
| 6774 | 0 \ |
| 6775 | -C "bad certificate (usage extensions)" \ |
| 6776 | -C "Processing of the Certificate handshake message failed" \ |
| 6777 | -c "Ciphersuite is" |
| 6778 | |
| 6779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6780 | requires_openssl_tls1_3 |
| 6781 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6782 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6783 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6784 | -cert data_files/server5.eku-cs.crt" \ |
| 6785 | "$P_CLI debug_level=1" \ |
| 6786 | 1 \ |
| 6787 | -c "bad certificate (usage extensions)" \ |
| 6788 | -c "Processing of the Certificate handshake message failed" \ |
| 6789 | -C "Ciphersuite is" |
| 6790 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6791 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6792 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6794 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6795 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6796 | "$O_CLI -key data_files/server5.key \ |
| 6797 | -cert data_files/server5.eku-cli.crt" \ |
| 6798 | 0 \ |
| 6799 | -S "bad certificate (usage extensions)" \ |
| 6800 | -S "Processing of the Certificate handshake message failed" |
| 6801 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6803 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6804 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6805 | "$O_CLI -key data_files/server5.key \ |
| 6806 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6807 | 0 \ |
| 6808 | -S "bad certificate (usage extensions)" \ |
| 6809 | -S "Processing of the Certificate handshake message failed" |
| 6810 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6812 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6813 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6814 | "$O_CLI -key data_files/server5.key \ |
| 6815 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6816 | 0 \ |
| 6817 | -S "bad certificate (usage extensions)" \ |
| 6818 | -S "Processing of the Certificate handshake message failed" |
| 6819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6821 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6822 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6823 | "$O_CLI -key data_files/server5.key \ |
| 6824 | -cert data_files/server5.eku-cs.crt" \ |
| 6825 | 0 \ |
| 6826 | -s "bad certificate (usage extensions)" \ |
| 6827 | -S "Processing of the Certificate handshake message failed" |
| 6828 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6830 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6831 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6832 | "$O_CLI -key data_files/server5.key \ |
| 6833 | -cert data_files/server5.eku-cs.crt" \ |
| 6834 | 1 \ |
| 6835 | -s "bad certificate (usage extensions)" \ |
| 6836 | -s "Processing of the Certificate handshake message failed" |
| 6837 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6839 | requires_openssl_tls1_3 |
| 6840 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6841 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
| 6842 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6843 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6844 | -cert data_files/server5.eku-cli.crt" \ |
| 6845 | 0 \ |
| 6846 | -S "bad certificate (usage extensions)" \ |
| 6847 | -S "Processing of the Certificate handshake message failed" |
| 6848 | |
| 6849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6850 | requires_openssl_tls1_3 |
| 6851 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6852 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
| 6853 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6854 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6855 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6856 | 0 \ |
| 6857 | -S "bad certificate (usage extensions)" \ |
| 6858 | -S "Processing of the Certificate handshake message failed" |
| 6859 | |
| 6860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6861 | requires_openssl_tls1_3 |
| 6862 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6863 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
| 6864 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6865 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6866 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6867 | 0 \ |
| 6868 | -S "bad certificate (usage extensions)" \ |
| 6869 | -S "Processing of the Certificate handshake message failed" |
| 6870 | |
| 6871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6872 | requires_openssl_tls1_3 |
| 6873 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6874 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
| 6875 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 6876 | "$O_NEXT_CLI_NO_CERT -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 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6882 | # Tests for DHM parameters loading |
| 6883 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6885 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6886 | "$P_SRV" \ |
| 6887 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6888 | debug_level=3" \ |
| 6889 | 0 \ |
| 6890 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 6891 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6892 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6893 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6894 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6895 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6896 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6897 | debug_level=3" \ |
| 6898 | 0 \ |
| 6899 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 6900 | -c "value of 'DHM: G ' (2 bits)" |
| 6901 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6902 | # Tests for DHM client-side size checking |
| 6903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6905 | run_test "DHM size: server default, client default, OK" \ |
| 6906 | "$P_SRV" \ |
| 6907 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6908 | debug_level=1" \ |
| 6909 | 0 \ |
| 6910 | -C "DHM prime too short:" |
| 6911 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6913 | run_test "DHM size: server default, client 2048, OK" \ |
| 6914 | "$P_SRV" \ |
| 6915 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6916 | debug_level=1 dhmlen=2048" \ |
| 6917 | 0 \ |
| 6918 | -C "DHM prime too short:" |
| 6919 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6920 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6921 | run_test "DHM size: server 1024, client default, OK" \ |
| 6922 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 6923 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6924 | debug_level=1" \ |
| 6925 | 0 \ |
| 6926 | -C "DHM prime too short:" |
| 6927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6929 | run_test "DHM size: server 999, client 999, OK" \ |
| 6930 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6931 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6932 | debug_level=1 dhmlen=999" \ |
| 6933 | 0 \ |
| 6934 | -C "DHM prime too short:" |
| 6935 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6937 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 6938 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6939 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6940 | debug_level=1 dhmlen=1000" \ |
| 6941 | 0 \ |
| 6942 | -C "DHM prime too short:" |
| 6943 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6945 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6946 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6947 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6948 | debug_level=1" \ |
| 6949 | 1 \ |
| 6950 | -c "DHM prime too short:" |
| 6951 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6953 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6954 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6955 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6956 | debug_level=1 dhmlen=1001" \ |
| 6957 | 1 \ |
| 6958 | -c "DHM prime too short:" |
| 6959 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6961 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6962 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6963 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6964 | debug_level=1 dhmlen=1000" \ |
| 6965 | 1 \ |
| 6966 | -c "DHM prime too short:" |
| 6967 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6969 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6970 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6971 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6972 | debug_level=1 dhmlen=999" \ |
| 6973 | 1 \ |
| 6974 | -c "DHM prime too short:" |
| 6975 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6977 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6978 | "$P_SRV" \ |
| 6979 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6980 | debug_level=1 dhmlen=2049" \ |
| 6981 | 1 \ |
| 6982 | -c "DHM prime too short:" |
| 6983 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6984 | # Tests for PSK callback |
| 6985 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6987 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6988 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6989 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6990 | psk_identity=foo psk=abc123" \ |
| 6991 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6992 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6993 | -S "SSL - Unknown identity received" \ |
| 6994 | -S "SSL - Verification of the message MAC failed" |
| 6995 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6996 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6997 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6998 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6999 | "$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] | 7000 | "$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] | 7001 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7002 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7003 | -C "session hash for extended master secret"\ |
| 7004 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7005 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7006 | -S "SSL - Unknown identity received" \ |
| 7007 | -S "SSL - Verification of the message MAC failed" |
| 7008 | |
| 7009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7011 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7012 | "$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] | 7013 | "$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] | 7014 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7015 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7016 | -C "session hash for extended master secret"\ |
| 7017 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7018 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7019 | -S "SSL - Unknown identity received" \ |
| 7020 | -S "SSL - Verification of the message MAC failed" |
| 7021 | |
| 7022 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7024 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7025 | "$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] | 7026 | "$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] | 7027 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7028 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7029 | -c "session hash for extended master secret"\ |
| 7030 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7031 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7032 | -S "SSL - Unknown identity received" \ |
| 7033 | -S "SSL - Verification of the message MAC failed" |
| 7034 | |
| 7035 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7037 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7038 | "$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] | 7039 | "$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] | 7040 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7041 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7042 | -c "session hash for extended master secret"\ |
| 7043 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7044 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7045 | -S "SSL - Unknown identity received" \ |
| 7046 | -S "SSL - Verification of the message MAC failed" |
| 7047 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7048 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7050 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7051 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7052 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7053 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7054 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7055 | -C "session hash for extended master secret"\ |
| 7056 | -S "session hash for extended master secret"\ |
| 7057 | -S "SSL - The handshake negotiation failed" \ |
| 7058 | -S "SSL - Unknown identity received" \ |
| 7059 | -S "SSL - Verification of the message MAC failed" |
| 7060 | |
| 7061 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7062 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7063 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7064 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7065 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7066 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7067 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7068 | -C "session hash for extended master secret"\ |
| 7069 | -S "session hash for extended master secret"\ |
| 7070 | -S "SSL - The handshake negotiation failed" \ |
| 7071 | -S "SSL - Unknown identity received" \ |
| 7072 | -S "SSL - Verification of the message MAC failed" |
| 7073 | |
| 7074 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7076 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7077 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7078 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7079 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7080 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7081 | -c "session hash for extended master secret"\ |
| 7082 | -s "session hash for extended master secret"\ |
| 7083 | -S "SSL - The handshake negotiation failed" \ |
| 7084 | -S "SSL - Unknown identity received" \ |
| 7085 | -S "SSL - Verification of the message MAC failed" |
| 7086 | |
| 7087 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7089 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7090 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7091 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7092 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7093 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7094 | -c "session hash for extended master secret"\ |
| 7095 | -s "session hash for extended master secret"\ |
| 7096 | -S "SSL - The handshake negotiation failed" \ |
| 7097 | -S "SSL - Unknown identity received" \ |
| 7098 | -S "SSL - Verification of the message MAC failed" |
| 7099 | |
| 7100 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7102 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7103 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7104 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7105 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7106 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7107 | -C "session hash for extended master secret"\ |
| 7108 | -S "session hash for extended master secret"\ |
| 7109 | -S "SSL - The handshake negotiation failed" \ |
| 7110 | -S "SSL - Unknown identity received" \ |
| 7111 | -S "SSL - Verification of the message MAC failed" |
| 7112 | |
| 7113 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7115 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7116 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7117 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7118 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7119 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7120 | -C "session hash for extended master secret"\ |
| 7121 | -S "session hash for extended master secret"\ |
| 7122 | -S "SSL - The handshake negotiation failed" \ |
| 7123 | -S "SSL - Unknown identity received" \ |
| 7124 | -S "SSL - Verification of the message MAC failed" |
| 7125 | |
| 7126 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7128 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7129 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7130 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7131 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7132 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7133 | -c "session hash for extended master secret"\ |
| 7134 | -s "session hash for extended master secret"\ |
| 7135 | -S "SSL - The handshake negotiation failed" \ |
| 7136 | -S "SSL - Unknown identity received" \ |
| 7137 | -S "SSL - Verification of the message MAC failed" |
| 7138 | |
| 7139 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7140 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7141 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7142 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7143 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7144 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7145 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7146 | -c "session hash for extended master secret"\ |
| 7147 | -s "session hash for extended master secret"\ |
| 7148 | -S "SSL - The handshake negotiation failed" \ |
| 7149 | -S "SSL - Unknown identity received" \ |
| 7150 | -S "SSL - Verification of the message MAC failed" |
| 7151 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7152 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7154 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7155 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7156 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7157 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7158 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7159 | -C "session hash for extended master secret"\ |
| 7160 | -S "session hash for extended master secret"\ |
| 7161 | -S "SSL - The handshake negotiation failed" \ |
| 7162 | -S "SSL - Unknown identity received" \ |
| 7163 | -S "SSL - Verification of the message MAC failed" |
| 7164 | |
| 7165 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7166 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7167 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7168 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7169 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7170 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7171 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7172 | -C "session hash for extended master secret"\ |
| 7173 | -S "session hash for extended master secret"\ |
| 7174 | -S "SSL - The handshake negotiation failed" \ |
| 7175 | -S "SSL - Unknown identity received" \ |
| 7176 | -S "SSL - Verification of the message MAC failed" |
| 7177 | |
| 7178 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7180 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7181 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7182 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7183 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7184 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7185 | -c "session hash for extended master secret"\ |
| 7186 | -s "session hash for extended master secret"\ |
| 7187 | -S "SSL - The handshake negotiation failed" \ |
| 7188 | -S "SSL - Unknown identity received" \ |
| 7189 | -S "SSL - Verification of the message MAC failed" |
| 7190 | |
| 7191 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7193 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7194 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7195 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7196 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7197 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7198 | -c "session hash for extended master secret"\ |
| 7199 | -s "session hash for extended master secret"\ |
| 7200 | -S "SSL - The handshake negotiation failed" \ |
| 7201 | -S "SSL - Unknown identity received" \ |
| 7202 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7203 | |
| 7204 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7206 | 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] | 7207 | "$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" \ |
| 7208 | "$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] | 7209 | psk_identity=foo psk=abc123" \ |
| 7210 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7211 | -C "session hash for extended master secret"\ |
| 7212 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7213 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7214 | -S "SSL - Unknown identity received" \ |
| 7215 | -S "SSL - Verification of the message MAC failed" |
| 7216 | |
| 7217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7219 | 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] | 7220 | "$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" \ |
| 7221 | "$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] | 7222 | psk_identity=foo psk=abc123" \ |
| 7223 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7224 | -C "session hash for extended master secret"\ |
| 7225 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7226 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7227 | -S "SSL - Unknown identity received" \ |
| 7228 | -S "SSL - Verification of the message MAC failed" |
| 7229 | |
| 7230 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7232 | 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] | 7233 | "$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] | 7234 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7235 | "$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] | 7236 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7237 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7238 | -c "session hash for extended master secret"\ |
| 7239 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7240 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7241 | -S "SSL - Unknown identity received" \ |
| 7242 | -S "SSL - Verification of the message MAC failed" |
| 7243 | |
| 7244 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7246 | 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] | 7247 | "$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] | 7248 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7249 | "$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] | 7250 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7251 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7252 | -c "session hash for extended master secret"\ |
| 7253 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7254 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7255 | -S "SSL - Unknown identity received" \ |
| 7256 | -S "SSL - Verification of the message MAC failed" |
| 7257 | |
| 7258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7260 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7261 | "$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" \ |
| 7262 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7263 | psk_identity=foo psk=abc123" \ |
| 7264 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7265 | -C "session hash for extended master secret"\ |
| 7266 | -S "session hash for extended master secret"\ |
| 7267 | -S "SSL - The handshake negotiation failed" \ |
| 7268 | -S "SSL - Unknown identity received" \ |
| 7269 | -S "SSL - Verification of the message MAC failed" |
| 7270 | |
| 7271 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7273 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7274 | "$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" \ |
| 7275 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7276 | psk_identity=foo psk=abc123" \ |
| 7277 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7278 | -C "session hash for extended master secret"\ |
| 7279 | -S "session hash for extended master secret"\ |
| 7280 | -S "SSL - The handshake negotiation failed" \ |
| 7281 | -S "SSL - Unknown identity received" \ |
| 7282 | -S "SSL - Verification of the message MAC failed" |
| 7283 | |
| 7284 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7286 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7287 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7288 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7289 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7290 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7291 | 0 \ |
| 7292 | -c "session hash for extended master secret"\ |
| 7293 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7294 | -S "SSL - The handshake negotiation failed" \ |
| 7295 | -S "SSL - Unknown identity received" \ |
| 7296 | -S "SSL - Verification of the message MAC failed" |
| 7297 | |
| 7298 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7300 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7301 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7302 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7303 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7304 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7305 | 0 \ |
| 7306 | -c "session hash for extended master secret"\ |
| 7307 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7308 | -S "SSL - The handshake negotiation failed" \ |
| 7309 | -S "SSL - Unknown identity received" \ |
| 7310 | -S "SSL - Verification of the message MAC failed" |
| 7311 | |
| 7312 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7314 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7315 | "$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" \ |
| 7316 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7317 | psk_identity=foo psk=abc123" \ |
| 7318 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7319 | -C "session hash for extended master secret"\ |
| 7320 | -S "session hash for extended master secret"\ |
| 7321 | -S "SSL - The handshake negotiation failed" \ |
| 7322 | -S "SSL - Unknown identity received" \ |
| 7323 | -S "SSL - Verification of the message MAC failed" |
| 7324 | |
| 7325 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7327 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7328 | "$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" \ |
| 7329 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7330 | psk_identity=foo psk=abc123" \ |
| 7331 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7332 | -C "session hash for extended master secret"\ |
| 7333 | -S "session hash for extended master secret"\ |
| 7334 | -S "SSL - The handshake negotiation failed" \ |
| 7335 | -S "SSL - Unknown identity received" \ |
| 7336 | -S "SSL - Verification of the message MAC failed" |
| 7337 | |
| 7338 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7340 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7341 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7342 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7343 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7344 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7345 | 0 \ |
| 7346 | -c "session hash for extended master secret"\ |
| 7347 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7348 | -S "SSL - The handshake negotiation failed" \ |
| 7349 | -S "SSL - Unknown identity received" \ |
| 7350 | -S "SSL - Verification of the message MAC failed" |
| 7351 | |
| 7352 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7354 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7355 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7356 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7357 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7358 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7359 | 0 \ |
| 7360 | -c "session hash for extended master secret"\ |
| 7361 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7362 | -S "SSL - The handshake negotiation failed" \ |
| 7363 | -S "SSL - Unknown identity received" \ |
| 7364 | -S "SSL - Verification of the message MAC failed" |
| 7365 | |
| 7366 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7368 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7369 | "$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" \ |
| 7370 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7371 | psk_identity=foo psk=abc123" \ |
| 7372 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7373 | -C "session hash for extended master secret"\ |
| 7374 | -S "session hash for extended master secret"\ |
| 7375 | -S "SSL - The handshake negotiation failed" \ |
| 7376 | -S "SSL - Unknown identity received" \ |
| 7377 | -S "SSL - Verification of the message MAC failed" |
| 7378 | |
| 7379 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7381 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7382 | "$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" \ |
| 7383 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7384 | psk_identity=foo psk=abc123" \ |
| 7385 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7386 | -C "session hash for extended master secret"\ |
| 7387 | -S "session hash for extended master secret"\ |
| 7388 | -S "SSL - The handshake negotiation failed" \ |
| 7389 | -S "SSL - Unknown identity received" \ |
| 7390 | -S "SSL - Verification of the message MAC failed" |
| 7391 | |
| 7392 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7394 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7395 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7396 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7397 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7398 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7399 | 0 \ |
| 7400 | -c "session hash for extended master secret"\ |
| 7401 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7402 | -S "SSL - The handshake negotiation failed" \ |
| 7403 | -S "SSL - Unknown identity received" \ |
| 7404 | -S "SSL - Verification of the message MAC failed" |
| 7405 | |
| 7406 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7408 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7409 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7410 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7411 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7412 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7413 | 0 \ |
| 7414 | -c "session hash for extended master secret"\ |
| 7415 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7416 | -S "SSL - The handshake negotiation failed" \ |
| 7417 | -S "SSL - Unknown identity received" \ |
| 7418 | -S "SSL - Verification of the message MAC failed" |
| 7419 | |
| 7420 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7422 | 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] | 7423 | "$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" \ |
| 7424 | "$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] | 7425 | psk_identity=def psk=beef" \ |
| 7426 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7427 | -C "session hash for extended master secret"\ |
| 7428 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7429 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7430 | -S "SSL - Unknown identity received" \ |
| 7431 | -S "SSL - Verification of the message MAC failed" |
| 7432 | |
| 7433 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7435 | 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] | 7436 | "$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" \ |
| 7437 | "$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] | 7438 | psk_identity=def psk=beef" \ |
| 7439 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7440 | -C "session hash for extended master secret"\ |
| 7441 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7442 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7443 | -S "SSL - Unknown identity received" \ |
| 7444 | -S "SSL - Verification of the message MAC failed" |
| 7445 | |
| 7446 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7448 | 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] | 7449 | "$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] | 7450 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7451 | "$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] | 7452 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7453 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7454 | -c "session hash for extended master secret"\ |
| 7455 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7456 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7457 | -S "SSL - Unknown identity received" \ |
| 7458 | -S "SSL - Verification of the message MAC failed" |
| 7459 | |
| 7460 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7462 | 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] | 7463 | "$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] | 7464 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7465 | "$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] | 7466 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7467 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7468 | -c "session hash for extended master secret"\ |
| 7469 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7470 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7471 | -S "SSL - Unknown identity received" \ |
| 7472 | -S "SSL - Verification of the message MAC failed" |
| 7473 | |
| 7474 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7476 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7477 | "$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" \ |
| 7478 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7479 | psk_identity=def psk=beef" \ |
| 7480 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7481 | -C "session hash for extended master secret"\ |
| 7482 | -S "session hash for extended master secret"\ |
| 7483 | -S "SSL - The handshake negotiation failed" \ |
| 7484 | -S "SSL - Unknown identity received" \ |
| 7485 | -S "SSL - Verification of the message MAC failed" |
| 7486 | |
| 7487 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7489 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7490 | "$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" \ |
| 7491 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7492 | psk_identity=def psk=beef" \ |
| 7493 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7494 | -C "session hash for extended master secret"\ |
| 7495 | -S "session hash for extended master secret"\ |
| 7496 | -S "SSL - The handshake negotiation failed" \ |
| 7497 | -S "SSL - Unknown identity received" \ |
| 7498 | -S "SSL - Verification of the message MAC failed" |
| 7499 | |
| 7500 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7501 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7502 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7503 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7504 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7505 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7506 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7507 | 0 \ |
| 7508 | -c "session hash for extended master secret"\ |
| 7509 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7510 | -S "SSL - The handshake negotiation failed" \ |
| 7511 | -S "SSL - Unknown identity received" \ |
| 7512 | -S "SSL - Verification of the message MAC failed" |
| 7513 | |
| 7514 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7516 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7517 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7518 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7519 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7520 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7521 | 0 \ |
| 7522 | -c "session hash for extended master secret"\ |
| 7523 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7524 | -S "SSL - The handshake negotiation failed" \ |
| 7525 | -S "SSL - Unknown identity received" \ |
| 7526 | -S "SSL - Verification of the message MAC failed" |
| 7527 | |
| 7528 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7530 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7531 | "$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" \ |
| 7532 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7533 | psk_identity=def psk=beef" \ |
| 7534 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7535 | -C "session hash for extended master secret"\ |
| 7536 | -S "session hash for extended master secret"\ |
| 7537 | -S "SSL - The handshake negotiation failed" \ |
| 7538 | -S "SSL - Unknown identity received" \ |
| 7539 | -S "SSL - Verification of the message MAC failed" |
| 7540 | |
| 7541 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7543 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7544 | "$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" \ |
| 7545 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7546 | psk_identity=def psk=beef" \ |
| 7547 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7548 | -C "session hash for extended master secret"\ |
| 7549 | -S "session hash for extended master secret"\ |
| 7550 | -S "SSL - The handshake negotiation failed" \ |
| 7551 | -S "SSL - Unknown identity received" \ |
| 7552 | -S "SSL - Verification of the message MAC failed" |
| 7553 | |
| 7554 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7556 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7557 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7558 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7559 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7560 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7561 | 0 \ |
| 7562 | -c "session hash for extended master secret"\ |
| 7563 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7564 | -S "SSL - The handshake negotiation failed" \ |
| 7565 | -S "SSL - Unknown identity received" \ |
| 7566 | -S "SSL - Verification of the message MAC failed" |
| 7567 | |
| 7568 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7570 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7571 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7572 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7573 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7574 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7575 | 0 \ |
| 7576 | -c "session hash for extended master secret"\ |
| 7577 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7578 | -S "SSL - The handshake negotiation failed" \ |
| 7579 | -S "SSL - Unknown identity received" \ |
| 7580 | -S "SSL - Verification of the message MAC failed" |
| 7581 | |
| 7582 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7584 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7585 | "$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" \ |
| 7586 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7587 | psk_identity=def psk=beef" \ |
| 7588 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7589 | -C "session hash for extended master secret"\ |
| 7590 | -S "session hash for extended master secret"\ |
| 7591 | -S "SSL - The handshake negotiation failed" \ |
| 7592 | -S "SSL - Unknown identity received" \ |
| 7593 | -S "SSL - Verification of the message MAC failed" |
| 7594 | |
| 7595 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7597 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7598 | "$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" \ |
| 7599 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7600 | psk_identity=def psk=beef" \ |
| 7601 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7602 | -C "session hash for extended master secret"\ |
| 7603 | -S "session hash for extended master secret"\ |
| 7604 | -S "SSL - The handshake negotiation failed" \ |
| 7605 | -S "SSL - Unknown identity received" \ |
| 7606 | -S "SSL - Verification of the message MAC failed" |
| 7607 | |
| 7608 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7610 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7611 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7612 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7613 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7614 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7615 | 0 \ |
| 7616 | -c "session hash for extended master secret"\ |
| 7617 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7618 | -S "SSL - The handshake negotiation failed" \ |
| 7619 | -S "SSL - Unknown identity received" \ |
| 7620 | -S "SSL - Verification of the message MAC failed" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7624 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7625 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7626 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7627 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7628 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7629 | 0 \ |
| 7630 | -c "session hash for extended master secret"\ |
| 7631 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7632 | -S "SSL - The handshake negotiation failed" \ |
| 7633 | -S "SSL - Unknown identity received" \ |
| 7634 | -S "SSL - Verification of the message MAC failed" |
| 7635 | |
| 7636 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7638 | 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] | 7639 | "$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" \ |
| 7640 | "$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] | 7641 | psk_identity=def psk=beef" \ |
| 7642 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7643 | -C "session hash for extended master secret"\ |
| 7644 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7645 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7646 | -S "SSL - Unknown identity received" \ |
| 7647 | -S "SSL - Verification of the message MAC failed" |
| 7648 | |
| 7649 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7651 | 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] | 7652 | "$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" \ |
| 7653 | "$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] | 7654 | psk_identity=def psk=beef" \ |
| 7655 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7656 | -C "session hash for extended master secret"\ |
| 7657 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7658 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7659 | -S "SSL - Unknown identity received" \ |
| 7660 | -S "SSL - Verification of the message MAC failed" |
| 7661 | |
| 7662 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7664 | 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] | 7665 | "$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" \ |
| 7666 | "$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] | 7667 | psk_identity=def psk=beef" \ |
| 7668 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7669 | -C "session hash for extended master secret"\ |
| 7670 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7671 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7672 | -S "SSL - Unknown identity received" \ |
| 7673 | -S "SSL - Verification of the message MAC failed" |
| 7674 | |
| 7675 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7677 | 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] | 7678 | "$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" \ |
| 7679 | "$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] | 7680 | psk_identity=def psk=beef" \ |
| 7681 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7682 | -C "session hash for extended master secret"\ |
| 7683 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7684 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7685 | -S "SSL - Unknown identity received" \ |
| 7686 | -S "SSL - Verification of the message MAC failed" |
| 7687 | |
| 7688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7690 | 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] | 7691 | "$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" \ |
| 7692 | "$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] | 7693 | psk_identity=def psk=beef" \ |
| 7694 | 1 \ |
| 7695 | -s "SSL - Verification of the message MAC failed" |
| 7696 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7698 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7699 | "$P_SRV" \ |
| 7700 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7701 | psk_identity=foo psk=abc123" \ |
| 7702 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7703 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7704 | -S "SSL - Unknown identity received" \ |
| 7705 | -S "SSL - Verification of the message MAC failed" |
| 7706 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7708 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7709 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7710 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7711 | psk_identity=foo psk=abc123" \ |
| 7712 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7713 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7714 | -s "SSL - Unknown identity received" \ |
| 7715 | -S "SSL - Verification of the message MAC failed" |
| 7716 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7718 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7719 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7720 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7721 | psk_identity=abc psk=dead" \ |
| 7722 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7723 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7724 | -S "SSL - Unknown identity received" \ |
| 7725 | -S "SSL - Verification of the message MAC failed" |
| 7726 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7728 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7729 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7730 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7731 | psk_identity=def psk=beef" \ |
| 7732 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7733 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7734 | -S "SSL - Unknown identity received" \ |
| 7735 | -S "SSL - Verification of the message MAC failed" |
| 7736 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7738 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7739 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7740 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7741 | psk_identity=ghi psk=beef" \ |
| 7742 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7743 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7744 | -s "SSL - Unknown identity received" \ |
| 7745 | -S "SSL - Verification of the message MAC failed" |
| 7746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7748 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7749 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7750 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7751 | psk_identity=abc psk=beef" \ |
| 7752 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7753 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7754 | -S "SSL - Unknown identity received" \ |
| 7755 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7756 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7757 | # Tests for EC J-PAKE |
| 7758 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7759 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
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 | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7761 | run_test "ECJPAKE: client not configured" \ |
| 7762 | "$P_SRV debug_level=3" \ |
| 7763 | "$P_CLI debug_level=3" \ |
| 7764 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7765 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7766 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7767 | -S "found ecjpake kkpp extension" \ |
| 7768 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7769 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7770 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7771 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7772 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7773 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7774 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7776 | run_test "ECJPAKE: server not configured" \ |
| 7777 | "$P_SRV debug_level=3" \ |
| 7778 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7779 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7780 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7781 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7782 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7783 | -s "found ecjpake kkpp extension" \ |
| 7784 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7785 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7786 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7787 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7788 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7789 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7790 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7791 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7792 | run_test "ECJPAKE: working, TLS" \ |
| 7793 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7794 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7795 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 7796 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7797 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7798 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7799 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7800 | -s "found ecjpake kkpp extension" \ |
| 7801 | -S "skip ecjpake kkpp extension" \ |
| 7802 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7803 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7804 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7805 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7806 | -S "SSL - Verification of the message MAC failed" |
| 7807 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7808 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7811 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 7812 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 7813 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 7814 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7815 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7816 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7817 | -s "SSL - Verification of the message MAC failed" |
| 7818 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7819 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7821 | run_test "ECJPAKE: working, DTLS" \ |
| 7822 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7823 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7824 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7825 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7826 | -c "re-using cached ecjpake parameters" \ |
| 7827 | -S "SSL - Verification of the message MAC failed" |
| 7828 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7829 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7831 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 7832 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 7833 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 7834 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7835 | 0 \ |
| 7836 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7837 | -S "SSL - Verification of the message MAC failed" |
| 7838 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7839 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7840 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7842 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 7843 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 7844 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 7845 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7846 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 7847 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 7848 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7849 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7850 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7851 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7852 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 7853 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 7854 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 7855 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 7856 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7857 | 0 |
| 7858 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 7859 | # Test for ClientHello without extensions |
| 7860 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 7861 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 7863 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 7864 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7865 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 7866 | 0 \ |
| 7867 | -s "dumping 'client hello extensions' (0 bytes)" |
| 7868 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7869 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7870 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7871 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7873 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7874 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7875 | "$P_CLI request_size=100" \ |
| 7876 | 0 \ |
| 7877 | -s "Read from client: 100 bytes read$" |
| 7878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7880 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 7881 | "$P_SRV buffer_size=100" \ |
| 7882 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 7883 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 7884 | -s "Read from client: 101 bytes read (100 + 1)" |
| 7885 | |
| 7886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7887 | requires_max_content_len 200 |
| 7888 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 7889 | "$P_SRV buffer_size=100" \ |
| 7890 | "$P_CLI request_size=200" \ |
| 7891 | 0 \ |
| 7892 | -s "Read from client: 200 bytes read (100 + 100)" |
| 7893 | |
| 7894 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7895 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 7896 | "$P_SRV buffer_size=100" \ |
| 7897 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 7898 | 0 \ |
| 7899 | -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] | 7900 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7901 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7902 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7903 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7904 | "$P_SRV force_version=tls12" \ |
| 7905 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7906 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7907 | 0 \ |
| 7908 | -s "Read from client: 1 bytes read" |
| 7909 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7910 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7911 | "$P_SRV force_version=tls12" \ |
| 7912 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7913 | 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] | 7914 | 0 \ |
| 7915 | -s "Read from client: 1 bytes read" |
| 7916 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7917 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7918 | "$P_SRV force_version=tls12" \ |
| 7919 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7920 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7921 | 0 \ |
| 7922 | -s "Read from client: 1 bytes read" |
| 7923 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7924 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7925 | "$P_SRV force_version=tls12" \ |
| 7926 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7927 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7928 | 0 \ |
| 7929 | -s "Read from client: 1 bytes read" |
| 7930 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7931 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7932 | "$P_SRV force_version=tls12" \ |
| 7933 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 7934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7935 | 0 \ |
| 7936 | -s "Read from client: 1 bytes read" |
| 7937 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 7938 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 7939 | "$P_SRV force_version=tls13" \ |
| 7940 | "$P_CLI request_size=1 \ |
| 7941 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 7942 | 0 \ |
| 7943 | -s "Read from client: 1 bytes read" |
| 7944 | |
| 7945 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 7946 | "$P_SRV force_version=tls13" \ |
| 7947 | "$P_CLI request_size=1 \ |
| 7948 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 7949 | 0 \ |
| 7950 | -s "Read from client: 1 bytes read" |
| 7951 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7952 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7953 | |
| 7954 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7955 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7956 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7957 | "$P_CLI dtls=1 request_size=1 \ |
| 7958 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7959 | 0 \ |
| 7960 | -s "Read from client: 1 bytes read" |
| 7961 | |
| 7962 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7963 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7964 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 7965 | "$P_CLI dtls=1 request_size=1 \ |
| 7966 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7967 | 0 \ |
| 7968 | -s "Read from client: 1 bytes read" |
| 7969 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7970 | # Tests for small server packets |
| 7971 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7972 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7973 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7974 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7975 | 0 \ |
| 7976 | -c "Read from server: 1 bytes read" |
| 7977 | |
| 7978 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7979 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7980 | "$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] | 7981 | 0 \ |
| 7982 | -c "Read from server: 1 bytes read" |
| 7983 | |
| 7984 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7985 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7986 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7987 | 0 \ |
| 7988 | -c "Read from server: 1 bytes read" |
| 7989 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7990 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7991 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7992 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7993 | 0 \ |
| 7994 | -c "Read from server: 1 bytes read" |
| 7995 | |
| 7996 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 7997 | "$P_SRV response_size=1 force_version=tls12" \ |
| 7998 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7999 | 0 \ |
| 8000 | -c "Read from server: 1 bytes read" |
| 8001 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8002 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8003 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8004 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8005 | 0 \ |
| 8006 | -c "Read from server: 1 bytes read" |
| 8007 | |
| 8008 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8009 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8010 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8011 | 0 \ |
| 8012 | -c "Read from server: 1 bytes read" |
| 8013 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8014 | # Tests for small server packets in DTLS |
| 8015 | |
| 8016 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8017 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8018 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8019 | "$P_CLI dtls=1 \ |
| 8020 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8021 | 0 \ |
| 8022 | -c "Read from server: 1 bytes read" |
| 8023 | |
| 8024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8025 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8026 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8027 | "$P_CLI dtls=1 \ |
| 8028 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8029 | 0 \ |
| 8030 | -c "Read from server: 1 bytes read" |
| 8031 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8032 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8033 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8034 | # How many fragments do we expect to write $1 bytes? |
| 8035 | fragments_for_write() { |
| 8036 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8037 | } |
| 8038 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8039 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8040 | "$P_SRV force_version=tls12" \ |
| 8041 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8042 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8043 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8044 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8045 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8046 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8047 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8048 | "$P_SRV force_version=tls12" \ |
| 8049 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8050 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8051 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8052 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8053 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8054 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8055 | "$P_SRV force_version=tls12" \ |
| 8056 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8057 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8058 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8059 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8060 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8061 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8062 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8063 | "$P_SRV force_version=tls12" \ |
| 8064 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8065 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8066 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8067 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8068 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8069 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8070 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8071 | "$P_SRV force_version=tls12" \ |
| 8072 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8073 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8074 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8075 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8076 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8077 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8078 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8079 | "$P_SRV force_version=tls13" \ |
| 8080 | "$P_CLI request_size=16384 \ |
| 8081 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8082 | 0 \ |
| 8083 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8084 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8085 | |
| 8086 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8087 | "$P_SRV force_version=tls13" \ |
| 8088 | "$P_CLI request_size=16384 \ |
| 8089 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8090 | 0 \ |
| 8091 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8092 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8093 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8094 | # 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] | 8095 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8096 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8097 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8098 | 0 \ |
| 8099 | -c "Read from server: 16384 bytes read" |
| 8100 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8101 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8102 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8103 | "$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] | 8104 | 0 \ |
| 8105 | -s "16384 bytes written in 1 fragments" \ |
| 8106 | -c "Read from server: 16384 bytes read" |
| 8107 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8108 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8109 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8110 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8111 | 0 \ |
| 8112 | -c "Read from server: 16384 bytes read" |
| 8113 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8114 | 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] | 8115 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8116 | "$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] | 8117 | 0 \ |
| 8118 | -s "16384 bytes written in 1 fragments" \ |
| 8119 | -c "Read from server: 16384 bytes read" |
| 8120 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8121 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8122 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8123 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8124 | 0 \ |
| 8125 | -c "Read from server: 16384 bytes read" |
| 8126 | |
| 8127 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8128 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8129 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8130 | 0 \ |
| 8131 | -c "Read from server: 16384 bytes read" |
| 8132 | |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8133 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8134 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8135 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8136 | 0 \ |
| 8137 | -c "Read from server: 16384 bytes read" |
| 8138 | |
| 8139 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8140 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8141 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8142 | 0 \ |
| 8143 | -c "Read from server: 16384 bytes read" |
| 8144 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8145 | # Tests for restartable ECC |
| 8146 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8147 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8148 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8149 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8150 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8152 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8153 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8154 | "$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] | 8155 | 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] | 8156 | debug_level=1" \ |
| 8157 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8158 | -C "x509_verify_cert.*4b00" \ |
| 8159 | -C "mbedtls_pk_verify.*4b00" \ |
| 8160 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8161 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8162 | |
| 8163 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8164 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8166 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8167 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8168 | "$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] | 8169 | 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] | 8170 | debug_level=1 ec_max_ops=0" \ |
| 8171 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8172 | -C "x509_verify_cert.*4b00" \ |
| 8173 | -C "mbedtls_pk_verify.*4b00" \ |
| 8174 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8175 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8176 | |
| 8177 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8178 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8180 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8181 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8182 | "$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] | 8183 | 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] | 8184 | debug_level=1 ec_max_ops=65535" \ |
| 8185 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8186 | -C "x509_verify_cert.*4b00" \ |
| 8187 | -C "mbedtls_pk_verify.*4b00" \ |
| 8188 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8189 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8190 | |
| 8191 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8192 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8194 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8195 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8196 | "$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] | 8197 | 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] | 8198 | debug_level=1 ec_max_ops=1000" \ |
| 8199 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8200 | -c "x509_verify_cert.*4b00" \ |
| 8201 | -c "mbedtls_pk_verify.*4b00" \ |
| 8202 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8203 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8204 | |
| 8205 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8206 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8208 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8209 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8210 | crt_file=data_files/server5-badsign.crt \ |
| 8211 | key_file=data_files/server5.key" \ |
| 8212 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8213 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8214 | debug_level=1 ec_max_ops=1000" \ |
| 8215 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8216 | -c "x509_verify_cert.*4b00" \ |
| 8217 | -C "mbedtls_pk_verify.*4b00" \ |
| 8218 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8219 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8220 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8221 | -c "! mbedtls_ssl_handshake returned" \ |
| 8222 | -c "X509 - Certificate verification failed" |
| 8223 | |
| 8224 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8225 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8227 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8228 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8229 | crt_file=data_files/server5-badsign.crt \ |
| 8230 | key_file=data_files/server5.key" \ |
| 8231 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8232 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8233 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8234 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8235 | -c "x509_verify_cert.*4b00" \ |
| 8236 | -c "mbedtls_pk_verify.*4b00" \ |
| 8237 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8238 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8239 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8240 | -C "! mbedtls_ssl_handshake returned" \ |
| 8241 | -C "X509 - Certificate verification failed" |
| 8242 | |
| 8243 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8244 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8246 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8247 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8248 | crt_file=data_files/server5-badsign.crt \ |
| 8249 | key_file=data_files/server5.key" \ |
| 8250 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8251 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8252 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8253 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8254 | -C "x509_verify_cert.*4b00" \ |
| 8255 | -c "mbedtls_pk_verify.*4b00" \ |
| 8256 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8257 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8258 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8259 | -C "! mbedtls_ssl_handshake returned" \ |
| 8260 | -C "X509 - Certificate verification failed" |
| 8261 | |
| 8262 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8263 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8265 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8266 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8267 | "$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] | 8268 | 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] | 8269 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8270 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8271 | -c "x509_verify_cert.*4b00" \ |
| 8272 | -c "mbedtls_pk_verify.*4b00" \ |
| 8273 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8274 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8275 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8276 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8277 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8279 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8280 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8281 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8282 | debug_level=1 ec_max_ops=1000" \ |
| 8283 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8284 | -c "x509_verify_cert.*4b00" \ |
| 8285 | -c "mbedtls_pk_verify.*4b00" \ |
| 8286 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8287 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8288 | |
| 8289 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8290 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8292 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8293 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8294 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 8295 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 8296 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8297 | -C "x509_verify_cert.*4b00" \ |
| 8298 | -C "mbedtls_pk_verify.*4b00" \ |
| 8299 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8300 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8301 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8302 | # Tests of asynchronous private key support in SSL |
| 8303 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8304 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8306 | run_test "SSL async private: sign, delay=0" \ |
| 8307 | "$P_SRV \ |
| 8308 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8309 | "$P_CLI" \ |
| 8310 | 0 \ |
| 8311 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8312 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8313 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8314 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8315 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8316 | run_test "SSL async private: sign, delay=1" \ |
| 8317 | "$P_SRV \ |
| 8318 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8319 | "$P_CLI" \ |
| 8320 | 0 \ |
| 8321 | -s "Async sign callback: using key slot " \ |
| 8322 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8323 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8324 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8325 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8327 | run_test "SSL async private: sign, delay=2" \ |
| 8328 | "$P_SRV \ |
| 8329 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8330 | "$P_CLI" \ |
| 8331 | 0 \ |
| 8332 | -s "Async sign callback: using key slot " \ |
| 8333 | -U "Async sign callback: using key slot " \ |
| 8334 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8335 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8336 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8337 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8338 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8339 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8341 | run_test "SSL async private: sign, SNI" \ |
| 8342 | "$P_SRV debug_level=3 \ |
| 8343 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8344 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8345 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8346 | "$P_CLI server_name=polarssl.example" \ |
| 8347 | 0 \ |
| 8348 | -s "Async sign callback: using key slot " \ |
| 8349 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8350 | -s "parse ServerName extension" \ |
| 8351 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8352 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8353 | |
| 8354 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8356 | run_test "SSL async private: decrypt, delay=0" \ |
| 8357 | "$P_SRV \ |
| 8358 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8359 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8360 | 0 \ |
| 8361 | -s "Async decrypt callback: using key slot " \ |
| 8362 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8363 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8366 | run_test "SSL async private: decrypt, delay=1" \ |
| 8367 | "$P_SRV \ |
| 8368 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8369 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8370 | 0 \ |
| 8371 | -s "Async decrypt callback: using key slot " \ |
| 8372 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8373 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8374 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8375 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8377 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8378 | "$P_SRV psk=abc123 \ |
| 8379 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8380 | "$P_CLI psk=abc123 \ |
| 8381 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8382 | 0 \ |
| 8383 | -s "Async decrypt callback: using key slot " \ |
| 8384 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8385 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8388 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8389 | "$P_SRV psk=abc123 \ |
| 8390 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8391 | "$P_CLI psk=abc123 \ |
| 8392 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8393 | 0 \ |
| 8394 | -s "Async decrypt callback: using key slot " \ |
| 8395 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8396 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8397 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8398 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8400 | run_test "SSL async private: sign callback not present" \ |
| 8401 | "$P_SRV \ |
| 8402 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8403 | "$P_CLI; [ \$? -eq 1 ] && |
| 8404 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8405 | 0 \ |
| 8406 | -S "Async sign callback" \ |
| 8407 | -s "! mbedtls_ssl_handshake returned" \ |
| 8408 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8409 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8410 | -s "Successful connection" |
| 8411 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8412 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8414 | run_test "SSL async private: decrypt callback not present" \ |
| 8415 | "$P_SRV debug_level=1 \ |
| 8416 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8417 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8418 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8419 | 0 \ |
| 8420 | -S "Async decrypt callback" \ |
| 8421 | -s "! mbedtls_ssl_handshake returned" \ |
| 8422 | -s "got no RSA private key" \ |
| 8423 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8424 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8425 | |
| 8426 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8427 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8429 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8430 | "$P_SRV \ |
| 8431 | async_operations=s async_private_delay1=1 \ |
| 8432 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8433 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8434 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8435 | 0 \ |
| 8436 | -s "Async sign callback: using key slot 0," \ |
| 8437 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8438 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8439 | |
| 8440 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8441 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8443 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8444 | "$P_SRV \ |
| 8445 | async_operations=s async_private_delay2=1 \ |
| 8446 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8447 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8448 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8449 | 0 \ |
| 8450 | -s "Async sign callback: using key slot 0," \ |
| 8451 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8452 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8453 | |
| 8454 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8455 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8457 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8458 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8459 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8460 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8461 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8462 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8463 | 0 \ |
| 8464 | -s "Async sign callback: using key slot 1," \ |
| 8465 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8466 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8467 | |
| 8468 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8469 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8471 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8472 | "$P_SRV \ |
| 8473 | async_operations=s async_private_delay1=1 \ |
| 8474 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8475 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8476 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8477 | 0 \ |
| 8478 | -s "Async sign callback: no key matches this certificate." |
| 8479 | |
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 | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8482 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8483 | "$P_SRV \ |
| 8484 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8485 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8486 | "$P_CLI" \ |
| 8487 | 1 \ |
| 8488 | -s "Async sign callback: injected error" \ |
| 8489 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8490 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8491 | -s "! mbedtls_ssl_handshake returned" |
| 8492 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8493 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8495 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8496 | "$P_SRV \ |
| 8497 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8498 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8499 | "$P_CLI" \ |
| 8500 | 1 \ |
| 8501 | -s "Async sign callback: using key slot " \ |
| 8502 | -S "Async resume" \ |
| 8503 | -s "Async cancel" |
| 8504 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8505 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8507 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8508 | "$P_SRV \ |
| 8509 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8510 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8511 | "$P_CLI" \ |
| 8512 | 1 \ |
| 8513 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8514 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8515 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8516 | -s "! mbedtls_ssl_handshake returned" |
| 8517 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8518 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8520 | run_test "SSL async private: decrypt, error in start" \ |
| 8521 | "$P_SRV \ |
| 8522 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8523 | async_private_error=1" \ |
| 8524 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8525 | 1 \ |
| 8526 | -s "Async decrypt callback: injected error" \ |
| 8527 | -S "Async resume" \ |
| 8528 | -S "Async cancel" \ |
| 8529 | -s "! mbedtls_ssl_handshake returned" |
| 8530 | |
| 8531 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8532 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8533 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8534 | "$P_SRV \ |
| 8535 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8536 | async_private_error=2" \ |
| 8537 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8538 | 1 \ |
| 8539 | -s "Async decrypt callback: using key slot " \ |
| 8540 | -S "Async resume" \ |
| 8541 | -s "Async cancel" |
| 8542 | |
| 8543 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8545 | run_test "SSL async private: decrypt, error in resume" \ |
| 8546 | "$P_SRV \ |
| 8547 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8548 | async_private_error=3" \ |
| 8549 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8550 | 1 \ |
| 8551 | -s "Async decrypt callback: using key slot " \ |
| 8552 | -s "Async resume callback: decrypt done but injected error" \ |
| 8553 | -S "Async cancel" \ |
| 8554 | -s "! mbedtls_ssl_handshake returned" |
| 8555 | |
| 8556 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8558 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8559 | "$P_SRV \ |
| 8560 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8561 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8562 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8563 | 0 \ |
| 8564 | -s "Async cancel" \ |
| 8565 | -s "! mbedtls_ssl_handshake returned" \ |
| 8566 | -s "Async resume" \ |
| 8567 | -s "Successful connection" |
| 8568 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8569 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8571 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8572 | "$P_SRV \ |
| 8573 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8574 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8575 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8576 | 0 \ |
| 8577 | -s "! mbedtls_ssl_handshake returned" \ |
| 8578 | -s "Async resume" \ |
| 8579 | -s "Successful connection" |
| 8580 | |
| 8581 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8582 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8584 | 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] | 8585 | "$P_SRV \ |
| 8586 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8587 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8588 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8589 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8590 | [ \$? -eq 1 ] && |
| 8591 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8592 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8593 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8594 | -S "Async resume" \ |
| 8595 | -s "Async cancel" \ |
| 8596 | -s "! mbedtls_ssl_handshake returned" \ |
| 8597 | -s "Async sign callback: no key matches this certificate." \ |
| 8598 | -s "Successful connection" |
| 8599 | |
| 8600 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8603 | 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] | 8604 | "$P_SRV \ |
| 8605 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8606 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8607 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8608 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8609 | [ \$? -eq 1 ] && |
| 8610 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8611 | 0 \ |
| 8612 | -s "Async resume" \ |
| 8613 | -s "! mbedtls_ssl_handshake returned" \ |
| 8614 | -s "Async sign callback: no key matches this certificate." \ |
| 8615 | -s "Successful connection" |
| 8616 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8618 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8620 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8621 | "$P_SRV \ |
| 8622 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8623 | exchanges=2 renegotiation=1" \ |
| 8624 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8625 | 0 \ |
| 8626 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8627 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8628 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8629 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8630 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8632 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8633 | "$P_SRV \ |
| 8634 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8635 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8636 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8637 | 0 \ |
| 8638 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8639 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8640 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8641 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8644 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8645 | "$P_SRV \ |
| 8646 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8647 | exchanges=2 renegotiation=1" \ |
| 8648 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8649 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8650 | 0 \ |
| 8651 | -s "Async decrypt callback: using key slot " \ |
| 8652 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8653 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8654 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8657 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8658 | "$P_SRV \ |
| 8659 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8660 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8661 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8662 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8663 | 0 \ |
| 8664 | -s "Async decrypt callback: using key slot " \ |
| 8665 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8666 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8667 | # Tests for ECC extensions (rfc 4492) |
| 8668 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8669 | requires_config_enabled MBEDTLS_AES_C |
| 8670 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8671 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8672 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8674 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8675 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8676 | "$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] | 8677 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8678 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8679 | -C "client hello, adding supported_point_formats extension" \ |
| 8680 | -S "found supported elliptic curves extension" \ |
| 8681 | -S "found supported point formats extension" |
| 8682 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_AES_C |
| 8684 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8685 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8686 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8688 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8689 | "$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] | 8690 | "$P_CLI debug_level=3" \ |
| 8691 | 0 \ |
| 8692 | -C "found supported_point_formats extension" \ |
| 8693 | -S "server hello, supported_point_formats extension" |
| 8694 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8695 | requires_config_enabled MBEDTLS_AES_C |
| 8696 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8697 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8698 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8700 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8701 | "$P_SRV debug_level=3" \ |
| 8702 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8703 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8704 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8705 | -c "client hello, adding supported_point_formats extension" \ |
| 8706 | -s "found supported elliptic curves extension" \ |
| 8707 | -s "found supported point formats extension" |
| 8708 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8709 | requires_config_enabled MBEDTLS_AES_C |
| 8710 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8711 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8712 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8714 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8715 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8716 | "$P_CLI debug_level=3" \ |
| 8717 | 0 \ |
| 8718 | -c "found supported_point_formats extension" \ |
| 8719 | -s "server hello, supported_point_formats extension" |
| 8720 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8721 | # Tests for DTLS HelloVerifyRequest |
| 8722 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8724 | run_test "DTLS cookie: enabled" \ |
| 8725 | "$P_SRV dtls=1 debug_level=2" \ |
| 8726 | "$P_CLI dtls=1 debug_level=2" \ |
| 8727 | 0 \ |
| 8728 | -s "cookie verification failed" \ |
| 8729 | -s "cookie verification passed" \ |
| 8730 | -S "cookie verification skipped" \ |
| 8731 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8732 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8733 | -S "SSL - The requested feature is not available" |
| 8734 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8736 | run_test "DTLS cookie: disabled" \ |
| 8737 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8738 | "$P_CLI dtls=1 debug_level=2" \ |
| 8739 | 0 \ |
| 8740 | -S "cookie verification failed" \ |
| 8741 | -S "cookie verification passed" \ |
| 8742 | -s "cookie verification skipped" \ |
| 8743 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8744 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8745 | -S "SSL - The requested feature is not available" |
| 8746 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8748 | run_test "DTLS cookie: default (failing)" \ |
| 8749 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8750 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8751 | 1 \ |
| 8752 | -s "cookie verification failed" \ |
| 8753 | -S "cookie verification passed" \ |
| 8754 | -S "cookie verification skipped" \ |
| 8755 | -C "received hello verify request" \ |
| 8756 | -S "hello verification requested" \ |
| 8757 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8758 | |
| 8759 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8761 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8762 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8763 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8764 | 0 \ |
| 8765 | -s "cookie verification failed" \ |
| 8766 | -s "cookie verification passed" \ |
| 8767 | -S "cookie verification skipped" \ |
| 8768 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8769 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8770 | -S "SSL - The requested feature is not available" |
| 8771 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8773 | run_test "DTLS cookie: enabled, nbio" \ |
| 8774 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8775 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8776 | 0 \ |
| 8777 | -s "cookie verification failed" \ |
| 8778 | -s "cookie verification passed" \ |
| 8779 | -S "cookie verification skipped" \ |
| 8780 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8781 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8782 | -S "SSL - The requested feature is not available" |
| 8783 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8784 | # Tests for client reconnecting from the same port with DTLS |
| 8785 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8786 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8788 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8789 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8790 | "$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] | 8791 | 0 \ |
| 8792 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8793 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8794 | -S "Client initiated reconnection from same port" |
| 8795 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8796 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8798 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8799 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8800 | "$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] | 8801 | 0 \ |
| 8802 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8803 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8804 | -s "Client initiated reconnection from same port" |
| 8805 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8806 | 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] | 8807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8808 | 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] | 8809 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8810 | "$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] | 8811 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8812 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8813 | -s "Client initiated reconnection from same port" |
| 8814 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8815 | 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] | 8816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8817 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8818 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8819 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8820 | 0 \ |
| 8821 | -S "The operation timed out" \ |
| 8822 | -s "Client initiated reconnection from same port" |
| 8823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8825 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8826 | "$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] | 8827 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8828 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8829 | -s "The operation timed out" \ |
| 8830 | -S "Client initiated reconnection from same port" |
| 8831 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8833 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8834 | -p "$P_PXY inject_clihlo=1" \ |
| 8835 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8836 | "$P_CLI dtls=1 exchanges=2" \ |
| 8837 | 0 \ |
| 8838 | -s "possible client reconnect from the same port" \ |
| 8839 | -S "Client initiated reconnection from same port" |
| 8840 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8841 | # Tests for various cases of client authentication with DTLS |
| 8842 | # (focused on handshake flows and message parsing) |
| 8843 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8845 | run_test "DTLS client auth: required" \ |
| 8846 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8847 | "$P_CLI dtls=1" \ |
| 8848 | 0 \ |
| 8849 | -s "Verifying peer X.509 certificate... ok" |
| 8850 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8852 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8853 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8854 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8855 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8856 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8857 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8859 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8860 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8861 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8862 | 0 \ |
| 8863 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8864 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8865 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8867 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8868 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8869 | "$P_CLI dtls=1 psk=abc124" \ |
| 8870 | 1 \ |
| 8871 | -s "SSL - Verification of the message MAC failed" \ |
| 8872 | -c "SSL - A fatal alert message was received from our peer" |
| 8873 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8874 | # Tests for receiving fragmented handshake messages with DTLS |
| 8875 | |
| 8876 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8878 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8879 | "$G_SRV -u --mtu 2048 -a" \ |
| 8880 | "$P_CLI dtls=1 debug_level=2" \ |
| 8881 | 0 \ |
| 8882 | -C "found fragmented DTLS handshake message" \ |
| 8883 | -C "error" |
| 8884 | |
| 8885 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8887 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8888 | "$G_SRV -u --mtu 512" \ |
| 8889 | "$P_CLI dtls=1 debug_level=2" \ |
| 8890 | 0 \ |
| 8891 | -c "found fragmented DTLS handshake message" \ |
| 8892 | -C "error" |
| 8893 | |
| 8894 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8896 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8897 | "$G_SRV -u --mtu 128" \ |
| 8898 | "$P_CLI dtls=1 debug_level=2" \ |
| 8899 | 0 \ |
| 8900 | -c "found fragmented DTLS handshake message" \ |
| 8901 | -C "error" |
| 8902 | |
| 8903 | requires_gnutls |
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 | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8905 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8906 | "$G_SRV -u --mtu 128" \ |
| 8907 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8908 | 0 \ |
| 8909 | -c "found fragmented DTLS handshake message" \ |
| 8910 | -C "error" |
| 8911 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8912 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8913 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8915 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8916 | "$G_SRV -u --mtu 256" \ |
| 8917 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8918 | 0 \ |
| 8919 | -c "found fragmented DTLS handshake message" \ |
| 8920 | -c "client hello, adding renegotiation extension" \ |
| 8921 | -c "found renegotiation extension" \ |
| 8922 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8923 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8924 | -C "error" \ |
| 8925 | -s "Extra-header:" |
| 8926 | |
| 8927 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8930 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8931 | "$G_SRV -u --mtu 256" \ |
| 8932 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8933 | 0 \ |
| 8934 | -c "found fragmented DTLS handshake message" \ |
| 8935 | -c "client hello, adding renegotiation extension" \ |
| 8936 | -c "found renegotiation extension" \ |
| 8937 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8938 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8939 | -C "error" \ |
| 8940 | -s "Extra-header:" |
| 8941 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8943 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8944 | "$O_SRV -dtls -mtu 2048" \ |
| 8945 | "$P_CLI dtls=1 debug_level=2" \ |
| 8946 | 0 \ |
| 8947 | -C "found fragmented DTLS handshake message" \ |
| 8948 | -C "error" |
| 8949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8951 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8952 | "$O_SRV -dtls -mtu 768" \ |
| 8953 | "$P_CLI dtls=1 debug_level=2" \ |
| 8954 | 0 \ |
| 8955 | -c "found fragmented DTLS handshake message" \ |
| 8956 | -C "error" |
| 8957 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8959 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 8960 | "$O_SRV -dtls -mtu 256" \ |
| 8961 | "$P_CLI dtls=1 debug_level=2" \ |
| 8962 | 0 \ |
| 8963 | -c "found fragmented DTLS handshake message" \ |
| 8964 | -C "error" |
| 8965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8967 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8968 | "$O_SRV -dtls -mtu 256" \ |
| 8969 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8970 | 0 \ |
| 8971 | -c "found fragmented DTLS handshake message" \ |
| 8972 | -C "error" |
| 8973 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8974 | # Tests for sending fragmented handshake messages with DTLS |
| 8975 | # |
| 8976 | # Use client auth when we need the client to send large messages, |
| 8977 | # and use large cert chains on both sides too (the long chains we have all use |
| 8978 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8979 | # Sizes reached (UDP payload): |
| 8980 | # - 2037B for server certificate |
| 8981 | # - 1542B for client certificate |
| 8982 | # - 1013B for newsessionticket |
| 8983 | # - all others below 512B |
| 8984 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8985 | |
| 8986 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8987 | requires_config_enabled MBEDTLS_RSA_C |
| 8988 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8989 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8990 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8992 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8993 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8994 | crt_file=data_files/server7_int-ca.crt \ |
| 8995 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8996 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8997 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8998 | "$P_CLI dtls=1 debug_level=2 \ |
| 8999 | crt_file=data_files/server8_int-ca2.crt \ |
| 9000 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9001 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9002 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9003 | 0 \ |
| 9004 | -S "found fragmented DTLS handshake message" \ |
| 9005 | -C "found fragmented DTLS handshake message" \ |
| 9006 | -C "error" |
| 9007 | |
| 9008 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9009 | requires_config_enabled MBEDTLS_RSA_C |
| 9010 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9011 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9012 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9014 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9015 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9016 | crt_file=data_files/server7_int-ca.crt \ |
| 9017 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9018 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9019 | max_frag_len=1024" \ |
| 9020 | "$P_CLI dtls=1 debug_level=2 \ |
| 9021 | crt_file=data_files/server8_int-ca2.crt \ |
| 9022 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9023 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9024 | max_frag_len=2048" \ |
| 9025 | 0 \ |
| 9026 | -S "found fragmented DTLS handshake message" \ |
| 9027 | -c "found fragmented DTLS handshake message" \ |
| 9028 | -C "error" |
| 9029 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9030 | # With the MFL extension, the server has no way of forcing |
| 9031 | # the client to not exceed a certain MTU; hence, the following |
| 9032 | # test can't be replicated with an MTU proxy such as the one |
| 9033 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9034 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9035 | requires_config_enabled MBEDTLS_RSA_C |
| 9036 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9037 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9038 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9040 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9041 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9042 | crt_file=data_files/server7_int-ca.crt \ |
| 9043 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9044 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9045 | max_frag_len=512" \ |
| 9046 | "$P_CLI dtls=1 debug_level=2 \ |
| 9047 | crt_file=data_files/server8_int-ca2.crt \ |
| 9048 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9049 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9050 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9051 | 0 \ |
| 9052 | -S "found fragmented DTLS handshake message" \ |
| 9053 | -c "found fragmented DTLS handshake message" \ |
| 9054 | -C "error" |
| 9055 | |
| 9056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9057 | requires_config_enabled MBEDTLS_RSA_C |
| 9058 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9059 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9060 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9062 | 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] | 9063 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9064 | crt_file=data_files/server7_int-ca.crt \ |
| 9065 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9066 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9067 | max_frag_len=2048" \ |
| 9068 | "$P_CLI dtls=1 debug_level=2 \ |
| 9069 | crt_file=data_files/server8_int-ca2.crt \ |
| 9070 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9071 | hs_timeout=2500-60000 \ |
| 9072 | max_frag_len=1024" \ |
| 9073 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9074 | -S "found fragmented DTLS handshake message" \ |
| 9075 | -c "found fragmented DTLS handshake message" \ |
| 9076 | -C "error" |
| 9077 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9078 | # While not required by the standard defining the MFL extension |
| 9079 | # (according to which it only applies to records, not to datagrams), |
| 9080 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9081 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9082 | # to the peer. |
| 9083 | # The next test checks that no datagrams significantly larger than the |
| 9084 | # negotiated MFL are sent. |
| 9085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9086 | requires_config_enabled MBEDTLS_RSA_C |
| 9087 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9088 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9089 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9091 | 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] | 9092 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9093 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9094 | crt_file=data_files/server7_int-ca.crt \ |
| 9095 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9096 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9097 | max_frag_len=2048" \ |
| 9098 | "$P_CLI dtls=1 debug_level=2 \ |
| 9099 | crt_file=data_files/server8_int-ca2.crt \ |
| 9100 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9101 | hs_timeout=2500-60000 \ |
| 9102 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9103 | 0 \ |
| 9104 | -S "found fragmented DTLS handshake message" \ |
| 9105 | -c "found fragmented DTLS handshake message" \ |
| 9106 | -C "error" |
| 9107 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9109 | requires_config_enabled MBEDTLS_RSA_C |
| 9110 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9111 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9112 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9114 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9115 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9116 | crt_file=data_files/server7_int-ca.crt \ |
| 9117 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9118 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9119 | max_frag_len=2048" \ |
| 9120 | "$P_CLI dtls=1 debug_level=2 \ |
| 9121 | crt_file=data_files/server8_int-ca2.crt \ |
| 9122 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9123 | hs_timeout=2500-60000 \ |
| 9124 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9125 | 0 \ |
| 9126 | -s "found fragmented DTLS handshake message" \ |
| 9127 | -c "found fragmented DTLS handshake message" \ |
| 9128 | -C "error" |
| 9129 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9130 | # While not required by the standard defining the MFL extension |
| 9131 | # (according to which it only applies to records, not to datagrams), |
| 9132 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9133 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9134 | # to the peer. |
| 9135 | # The next test checks that no datagrams significantly larger than the |
| 9136 | # negotiated MFL are sent. |
| 9137 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9138 | requires_config_enabled MBEDTLS_RSA_C |
| 9139 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9140 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9141 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9143 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9144 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9145 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9146 | crt_file=data_files/server7_int-ca.crt \ |
| 9147 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9148 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9149 | max_frag_len=2048" \ |
| 9150 | "$P_CLI dtls=1 debug_level=2 \ |
| 9151 | crt_file=data_files/server8_int-ca2.crt \ |
| 9152 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9153 | hs_timeout=2500-60000 \ |
| 9154 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9155 | 0 \ |
| 9156 | -s "found fragmented DTLS handshake message" \ |
| 9157 | -c "found fragmented DTLS handshake message" \ |
| 9158 | -C "error" |
| 9159 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9160 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9161 | requires_config_enabled MBEDTLS_RSA_C |
| 9162 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9163 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9165 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9166 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9167 | crt_file=data_files/server7_int-ca.crt \ |
| 9168 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9169 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9170 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9171 | "$P_CLI dtls=1 debug_level=2 \ |
| 9172 | crt_file=data_files/server8_int-ca2.crt \ |
| 9173 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9174 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9175 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9176 | 0 \ |
| 9177 | -S "found fragmented DTLS handshake message" \ |
| 9178 | -C "found fragmented DTLS handshake message" \ |
| 9179 | -C "error" |
| 9180 | |
| 9181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9182 | requires_config_enabled MBEDTLS_RSA_C |
| 9183 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9184 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9186 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9187 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9188 | crt_file=data_files/server7_int-ca.crt \ |
| 9189 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9190 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9191 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9192 | "$P_CLI dtls=1 debug_level=2 \ |
| 9193 | crt_file=data_files/server8_int-ca2.crt \ |
| 9194 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9195 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9196 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9197 | 0 \ |
| 9198 | -s "found fragmented DTLS handshake message" \ |
| 9199 | -C "found fragmented DTLS handshake message" \ |
| 9200 | -C "error" |
| 9201 | |
| 9202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9203 | requires_config_enabled MBEDTLS_RSA_C |
| 9204 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9205 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9207 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9208 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9209 | crt_file=data_files/server7_int-ca.crt \ |
| 9210 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9211 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9212 | mtu=512" \ |
| 9213 | "$P_CLI dtls=1 debug_level=2 \ |
| 9214 | crt_file=data_files/server8_int-ca2.crt \ |
| 9215 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9216 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9217 | mtu=2048" \ |
| 9218 | 0 \ |
| 9219 | -S "found fragmented DTLS handshake message" \ |
| 9220 | -c "found fragmented DTLS handshake message" \ |
| 9221 | -C "error" |
| 9222 | |
| 9223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9224 | requires_config_enabled MBEDTLS_RSA_C |
| 9225 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9226 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9228 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9229 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9230 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9231 | crt_file=data_files/server7_int-ca.crt \ |
| 9232 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9233 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9234 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9235 | "$P_CLI dtls=1 debug_level=2 \ |
| 9236 | crt_file=data_files/server8_int-ca2.crt \ |
| 9237 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9238 | hs_timeout=2500-60000 \ |
| 9239 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9240 | 0 \ |
| 9241 | -s "found fragmented DTLS handshake message" \ |
| 9242 | -c "found fragmented DTLS handshake message" \ |
| 9243 | -C "error" |
| 9244 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9245 | # 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] | 9246 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9247 | requires_config_enabled MBEDTLS_RSA_C |
| 9248 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9249 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9250 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9251 | requires_config_enabled MBEDTLS_AES_C |
| 9252 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9253 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9255 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9256 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9257 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9258 | crt_file=data_files/server7_int-ca.crt \ |
| 9259 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9260 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9261 | mtu=512" \ |
| 9262 | "$P_CLI dtls=1 debug_level=2 \ |
| 9263 | crt_file=data_files/server8_int-ca2.crt \ |
| 9264 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9265 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9266 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9267 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9268 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9269 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9270 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9271 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9272 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9273 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9274 | # 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] | 9275 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9276 | # retransmissions, but in some cases (like both the server and client using |
| 9277 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9278 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9279 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9281 | requires_config_enabled MBEDTLS_RSA_C |
| 9282 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9283 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9284 | requires_config_enabled MBEDTLS_AES_C |
| 9285 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9286 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9288 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9289 | -p "$P_PXY mtu=508" \ |
| 9290 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9291 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9292 | key_file=data_files/server7.key \ |
| 9293 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9294 | "$P_CLI dtls=1 debug_level=2 \ |
| 9295 | crt_file=data_files/server8_int-ca2.crt \ |
| 9296 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9297 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9298 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9299 | 0 \ |
| 9300 | -s "found fragmented DTLS handshake message" \ |
| 9301 | -c "found fragmented DTLS handshake message" \ |
| 9302 | -C "error" |
| 9303 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9304 | # 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] | 9305 | only_with_valgrind |
| 9306 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9307 | requires_config_enabled MBEDTLS_RSA_C |
| 9308 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9309 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9310 | requires_config_enabled MBEDTLS_AES_C |
| 9311 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9312 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9314 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9315 | -p "$P_PXY mtu=508" \ |
| 9316 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9317 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9318 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9319 | hs_timeout=250-10000" \ |
| 9320 | "$P_CLI dtls=1 debug_level=2 \ |
| 9321 | crt_file=data_files/server8_int-ca2.crt \ |
| 9322 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9323 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9324 | hs_timeout=250-10000" \ |
| 9325 | 0 \ |
| 9326 | -s "found fragmented DTLS handshake message" \ |
| 9327 | -c "found fragmented DTLS handshake message" \ |
| 9328 | -C "error" |
| 9329 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9330 | # 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] | 9331 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9332 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9333 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9334 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9335 | requires_config_enabled MBEDTLS_RSA_C |
| 9336 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9337 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9339 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9340 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9341 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9342 | crt_file=data_files/server7_int-ca.crt \ |
| 9343 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9344 | hs_timeout=10000-60000 \ |
| 9345 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9346 | "$P_CLI dtls=1 debug_level=2 \ |
| 9347 | crt_file=data_files/server8_int-ca2.crt \ |
| 9348 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9349 | hs_timeout=10000-60000 \ |
| 9350 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9351 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9352 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9358 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9359 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9360 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9361 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9363 | requires_config_enabled MBEDTLS_RSA_C |
| 9364 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9365 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9366 | requires_config_enabled MBEDTLS_AES_C |
| 9367 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9368 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9370 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9371 | -p "$P_PXY mtu=512" \ |
| 9372 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9373 | crt_file=data_files/server7_int-ca.crt \ |
| 9374 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9375 | hs_timeout=10000-60000 \ |
| 9376 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9377 | "$P_CLI dtls=1 debug_level=2 \ |
| 9378 | crt_file=data_files/server8_int-ca2.crt \ |
| 9379 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9380 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9381 | hs_timeout=10000-60000 \ |
| 9382 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9383 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9384 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9385 | -s "found fragmented DTLS handshake message" \ |
| 9386 | -c "found fragmented DTLS handshake message" \ |
| 9387 | -C "error" |
| 9388 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9389 | not_with_valgrind # spurious autoreduction due to timeout |
| 9390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9391 | requires_config_enabled MBEDTLS_RSA_C |
| 9392 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9393 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9395 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9396 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9397 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9398 | crt_file=data_files/server7_int-ca.crt \ |
| 9399 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9400 | hs_timeout=10000-60000 \ |
| 9401 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9402 | "$P_CLI dtls=1 debug_level=2 \ |
| 9403 | crt_file=data_files/server8_int-ca2.crt \ |
| 9404 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9405 | hs_timeout=10000-60000 \ |
| 9406 | mtu=1024 nbio=2" \ |
| 9407 | 0 \ |
| 9408 | -S "autoreduction" \ |
| 9409 | -s "found fragmented DTLS handshake message" \ |
| 9410 | -c "found fragmented DTLS handshake message" \ |
| 9411 | -C "error" |
| 9412 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9413 | # 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] | 9414 | not_with_valgrind # spurious autoreduction due to timeout |
| 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, nbio (MTU=512)" \ |
| 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 \ |
| 9428 | hs_timeout=10000-60000 \ |
| 9429 | mtu=512 nbio=2" \ |
| 9430 | "$P_CLI dtls=1 debug_level=2 \ |
| 9431 | crt_file=data_files/server8_int-ca2.crt \ |
| 9432 | key_file=data_files/server8.key \ |
| 9433 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9434 | hs_timeout=10000-60000 \ |
| 9435 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9436 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9437 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9438 | -s "found fragmented DTLS handshake message" \ |
| 9439 | -c "found fragmented DTLS handshake message" \ |
| 9440 | -C "error" |
| 9441 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9442 | # 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] | 9443 | # This ensures things still work after session_reset(). |
| 9444 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9445 | # Since we don't support reading fragmented ClientHello yet, |
| 9446 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9447 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9448 | # An autoreduction on the client-side might happen if the server is |
| 9449 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9450 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9451 | # resumed listening, which would result in a spurious autoreduction. |
| 9452 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9453 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9454 | requires_config_enabled MBEDTLS_RSA_C |
| 9455 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9456 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9457 | requires_config_enabled MBEDTLS_AES_C |
| 9458 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9459 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9461 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9462 | -p "$P_PXY mtu=1450" \ |
| 9463 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9464 | crt_file=data_files/server7_int-ca.crt \ |
| 9465 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9466 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9467 | mtu=1450" \ |
| 9468 | "$P_CLI dtls=1 debug_level=2 \ |
| 9469 | crt_file=data_files/server8_int-ca2.crt \ |
| 9470 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9471 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9472 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9473 | 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] | 9474 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9475 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9476 | -s "found fragmented DTLS handshake message" \ |
| 9477 | -c "found fragmented DTLS handshake message" \ |
| 9478 | -C "error" |
| 9479 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9480 | # An autoreduction on the client-side might happen if the server is |
| 9481 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9482 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9483 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9484 | requires_config_enabled MBEDTLS_RSA_C |
| 9485 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9486 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9487 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9489 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9490 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9492 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9493 | -p "$P_PXY mtu=512" \ |
| 9494 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9495 | crt_file=data_files/server7_int-ca.crt \ |
| 9496 | key_file=data_files/server7.key \ |
| 9497 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9498 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9499 | mtu=512" \ |
| 9500 | "$P_CLI dtls=1 debug_level=2 \ |
| 9501 | crt_file=data_files/server8_int-ca2.crt \ |
| 9502 | key_file=data_files/server8.key \ |
| 9503 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9504 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9505 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9506 | mtu=512" \ |
| 9507 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9508 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9509 | -s "found fragmented DTLS handshake message" \ |
| 9510 | -c "found fragmented DTLS handshake message" \ |
| 9511 | -C "error" |
| 9512 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9513 | # An autoreduction on the client-side might happen if the server is |
| 9514 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9515 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9517 | requires_config_enabled MBEDTLS_RSA_C |
| 9518 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9519 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9520 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9521 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9522 | requires_config_enabled MBEDTLS_AES_C |
| 9523 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9524 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9526 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9527 | -p "$P_PXY mtu=512" \ |
| 9528 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9529 | crt_file=data_files/server7_int-ca.crt \ |
| 9530 | key_file=data_files/server7.key \ |
| 9531 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9532 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9533 | mtu=512" \ |
| 9534 | "$P_CLI dtls=1 debug_level=2 \ |
| 9535 | crt_file=data_files/server8_int-ca2.crt \ |
| 9536 | key_file=data_files/server8.key \ |
| 9537 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9538 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9539 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9540 | mtu=512" \ |
| 9541 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9542 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9543 | -s "found fragmented DTLS handshake message" \ |
| 9544 | -c "found fragmented DTLS handshake message" \ |
| 9545 | -C "error" |
| 9546 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9547 | # An autoreduction on the client-side might happen if the server is |
| 9548 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9549 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9551 | requires_config_enabled MBEDTLS_RSA_C |
| 9552 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9553 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9554 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9556 | requires_config_enabled MBEDTLS_AES_C |
| 9557 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9558 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9560 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9561 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9562 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9563 | crt_file=data_files/server7_int-ca.crt \ |
| 9564 | key_file=data_files/server7.key \ |
| 9565 | exchanges=2 renegotiation=1 \ |
| 9566 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9567 | hs_timeout=10000-60000 \ |
| 9568 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9569 | "$P_CLI dtls=1 debug_level=2 \ |
| 9570 | crt_file=data_files/server8_int-ca2.crt \ |
| 9571 | key_file=data_files/server8.key \ |
| 9572 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9573 | hs_timeout=10000-60000 \ |
| 9574 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9575 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9576 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9577 | -s "found fragmented DTLS handshake message" \ |
| 9578 | -c "found fragmented DTLS handshake message" \ |
| 9579 | -C "error" |
| 9580 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9581 | # An autoreduction on the client-side might happen if the server is |
| 9582 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9583 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9584 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9585 | requires_config_enabled MBEDTLS_RSA_C |
| 9586 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9587 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9588 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9589 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9590 | requires_config_enabled MBEDTLS_AES_C |
| 9591 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9592 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9593 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9594 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9595 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9596 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9597 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9598 | crt_file=data_files/server7_int-ca.crt \ |
| 9599 | key_file=data_files/server7.key \ |
| 9600 | exchanges=2 renegotiation=1 \ |
| 9601 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9602 | hs_timeout=10000-60000 \ |
| 9603 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9604 | "$P_CLI dtls=1 debug_level=2 \ |
| 9605 | crt_file=data_files/server8_int-ca2.crt \ |
| 9606 | key_file=data_files/server8.key \ |
| 9607 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9608 | hs_timeout=10000-60000 \ |
| 9609 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9610 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9611 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9612 | -s "found fragmented DTLS handshake message" \ |
| 9613 | -c "found fragmented DTLS handshake message" \ |
| 9614 | -C "error" |
| 9615 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9616 | # An autoreduction on the client-side might happen if the server is |
| 9617 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9618 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9619 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9620 | requires_config_enabled MBEDTLS_RSA_C |
| 9621 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9622 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9623 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9625 | requires_config_enabled MBEDTLS_AES_C |
| 9626 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9627 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9629 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9630 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9631 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9632 | crt_file=data_files/server7_int-ca.crt \ |
| 9633 | key_file=data_files/server7.key \ |
| 9634 | exchanges=2 renegotiation=1 \ |
| 9635 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9636 | hs_timeout=10000-60000 \ |
| 9637 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9638 | "$P_CLI dtls=1 debug_level=2 \ |
| 9639 | crt_file=data_files/server8_int-ca2.crt \ |
| 9640 | key_file=data_files/server8.key \ |
| 9641 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9642 | hs_timeout=10000-60000 \ |
| 9643 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9644 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9645 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9646 | -s "found fragmented DTLS handshake message" \ |
| 9647 | -c "found fragmented DTLS handshake message" \ |
| 9648 | -C "error" |
| 9649 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9650 | # 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] | 9651 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9652 | requires_config_enabled MBEDTLS_RSA_C |
| 9653 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9654 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9655 | requires_config_enabled MBEDTLS_AES_C |
| 9656 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9657 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9658 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9660 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9661 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9662 | "$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] | 9663 | crt_file=data_files/server7_int-ca.crt \ |
| 9664 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9665 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9666 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9667 | crt_file=data_files/server8_int-ca2.crt \ |
| 9668 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9669 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9670 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9671 | 0 \ |
| 9672 | -s "found fragmented DTLS handshake message" \ |
| 9673 | -c "found fragmented DTLS handshake message" \ |
| 9674 | -C "error" |
| 9675 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9676 | # 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] | 9677 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9678 | requires_config_enabled MBEDTLS_RSA_C |
| 9679 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9680 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9681 | requires_config_enabled MBEDTLS_AES_C |
| 9682 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9683 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9684 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9686 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9687 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9688 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9689 | crt_file=data_files/server7_int-ca.crt \ |
| 9690 | key_file=data_files/server7.key \ |
| 9691 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9692 | "$P_CLI dtls=1 debug_level=2 \ |
| 9693 | crt_file=data_files/server8_int-ca2.crt \ |
| 9694 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9695 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9696 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9697 | 0 \ |
| 9698 | -s "found fragmented DTLS handshake message" \ |
| 9699 | -c "found fragmented DTLS handshake message" \ |
| 9700 | -C "error" |
| 9701 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9702 | # interop tests for DTLS fragmentating with reliable connection |
| 9703 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9704 | # here and below we just want to test that the we fragment in a way that |
| 9705 | # pleases other implementations, so we don't need the peer to fragment |
| 9706 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9707 | requires_config_enabled MBEDTLS_RSA_C |
| 9708 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9709 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9710 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9711 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9712 | "$G_SRV -u" \ |
| 9713 | "$P_CLI dtls=1 debug_level=2 \ |
| 9714 | crt_file=data_files/server8_int-ca2.crt \ |
| 9715 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9716 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9717 | 0 \ |
| 9718 | -c "fragmenting handshake message" \ |
| 9719 | -C "error" |
| 9720 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9721 | # We use --insecure for the GnuTLS client because it expects |
| 9722 | # the hostname / IP it connects to to be the name used in the |
| 9723 | # certificate obtained from the server. Here, however, it |
| 9724 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9725 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9726 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9727 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9729 | requires_config_enabled MBEDTLS_RSA_C |
| 9730 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9731 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9732 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9733 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9734 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9735 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9736 | crt_file=data_files/server7_int-ca.crt \ |
| 9737 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9738 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9739 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9740 | 0 \ |
| 9741 | -s "fragmenting handshake message" |
| 9742 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9744 | requires_config_enabled MBEDTLS_RSA_C |
| 9745 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9746 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9747 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9748 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9749 | "$P_CLI dtls=1 debug_level=2 \ |
| 9750 | crt_file=data_files/server8_int-ca2.crt \ |
| 9751 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9752 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9753 | 0 \ |
| 9754 | -c "fragmenting handshake message" \ |
| 9755 | -C "error" |
| 9756 | |
| 9757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9758 | requires_config_enabled MBEDTLS_RSA_C |
| 9759 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9760 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9761 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9762 | "$P_SRV dtls=1 debug_level=2 \ |
| 9763 | crt_file=data_files/server7_int-ca.crt \ |
| 9764 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9765 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9766 | "$O_CLI -dtls1_2" \ |
| 9767 | 0 \ |
| 9768 | -s "fragmenting handshake message" |
| 9769 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9770 | # interop tests for DTLS fragmentating with unreliable connection |
| 9771 | # |
| 9772 | # again we just want to test that the we fragment in a way that |
| 9773 | # pleases other implementations, so we don't need the peer to fragment |
| 9774 | requires_gnutls_next |
| 9775 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9776 | requires_config_enabled MBEDTLS_RSA_C |
| 9777 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9778 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9779 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9780 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9781 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9782 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9783 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9784 | crt_file=data_files/server8_int-ca2.crt \ |
| 9785 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9786 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9787 | 0 \ |
| 9788 | -c "fragmenting handshake message" \ |
| 9789 | -C "error" |
| 9790 | |
| 9791 | requires_gnutls_next |
| 9792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9793 | requires_config_enabled MBEDTLS_RSA_C |
| 9794 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9795 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9796 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9797 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9798 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9799 | "$P_SRV dtls=1 debug_level=2 \ |
| 9800 | crt_file=data_files/server7_int-ca.crt \ |
| 9801 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9802 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9803 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9804 | 0 \ |
| 9805 | -s "fragmenting handshake message" |
| 9806 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 9807 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 9808 | ## 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] | 9809 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9811 | requires_config_enabled MBEDTLS_RSA_C |
| 9812 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9813 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9814 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9815 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9816 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 9817 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9818 | "$P_CLI dtls=1 debug_level=2 \ |
| 9819 | crt_file=data_files/server8_int-ca2.crt \ |
| 9820 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9821 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9822 | 0 \ |
| 9823 | -c "fragmenting handshake message" \ |
| 9824 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9825 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 9826 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 9827 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 9828 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9829 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9830 | requires_config_enabled MBEDTLS_RSA_C |
| 9831 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9832 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9833 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9834 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9835 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9836 | "$P_SRV dtls=1 debug_level=2 \ |
| 9837 | crt_file=data_files/server7_int-ca.crt \ |
| 9838 | key_file=data_files/server7.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 | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9840 | "$O_CLI -dtls1_2" \ |
| 9841 | 0 \ |
| 9842 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9843 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9844 | # Tests for DTLS-SRTP (RFC 5764) |
| 9845 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9847 | run_test "DTLS-SRTP all profiles supported" \ |
| 9848 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9849 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9850 | 0 \ |
| 9851 | -s "found use_srtp extension" \ |
| 9852 | -s "found srtp profile" \ |
| 9853 | -s "selected srtp profile" \ |
| 9854 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9855 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9856 | -c "client hello, adding use_srtp extension" \ |
| 9857 | -c "found use_srtp extension" \ |
| 9858 | -c "found srtp profile" \ |
| 9859 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9860 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9861 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9862 | -C "error" |
| 9863 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9864 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9865 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9867 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9868 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9869 | "$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] | 9870 | 0 \ |
| 9871 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9872 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9873 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9874 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9875 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9876 | -c "client hello, adding use_srtp extension" \ |
| 9877 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9878 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9879 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9880 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9881 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9882 | -C "error" |
| 9883 | |
| 9884 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9886 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9887 | "$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] | 9888 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9889 | 0 \ |
| 9890 | -s "found use_srtp extension" \ |
| 9891 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9892 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9893 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9894 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9895 | -c "client hello, adding use_srtp extension" \ |
| 9896 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9897 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9898 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9899 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9900 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9901 | -C "error" |
| 9902 | |
| 9903 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9905 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9906 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9907 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9908 | 0 \ |
| 9909 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9910 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9911 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9912 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9913 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9914 | -c "client hello, adding use_srtp extension" \ |
| 9915 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9916 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9917 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9918 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9919 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9920 | -C "error" |
| 9921 | |
| 9922 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9924 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9925 | "$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] | 9926 | "$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] | 9927 | 0 \ |
| 9928 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9929 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9930 | -S "selected srtp profile" \ |
| 9931 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9932 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9933 | -c "client hello, adding use_srtp extension" \ |
| 9934 | -C "found use_srtp extension" \ |
| 9935 | -C "found srtp profile" \ |
| 9936 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9937 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9938 | -C "error" |
| 9939 | |
| 9940 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9942 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9943 | "$P_SRV dtls=1 debug_level=3" \ |
| 9944 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9945 | 0 \ |
| 9946 | -s "found use_srtp extension" \ |
| 9947 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9948 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9949 | -c "client hello, adding use_srtp extension" \ |
| 9950 | -C "found use_srtp extension" \ |
| 9951 | -C "found srtp profile" \ |
| 9952 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9953 | -C "DTLS-SRTP key material is"\ |
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 all profiles supported. mki used" \ |
| 9959 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9960 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9961 | 0 \ |
| 9962 | -s "found use_srtp extension" \ |
| 9963 | -s "found srtp profile" \ |
| 9964 | -s "selected srtp profile" \ |
| 9965 | -s "server hello, adding use_srtp extension" \ |
| 9966 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9967 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9968 | -c "client hello, adding use_srtp extension" \ |
| 9969 | -c "found use_srtp extension" \ |
| 9970 | -c "found srtp profile" \ |
| 9971 | -c "selected srtp profile" \ |
| 9972 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9973 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9974 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9975 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9976 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9977 | -C "error" |
| 9978 | |
| 9979 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9980 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9981 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9982 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9983 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9984 | 0 \ |
| 9985 | -s "found use_srtp extension" \ |
| 9986 | -s "found srtp profile" \ |
| 9987 | -s "selected srtp profile" \ |
| 9988 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9989 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9990 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9991 | -S "dumping 'using mki' (8 bytes)" \ |
| 9992 | -c "client hello, adding use_srtp extension" \ |
| 9993 | -c "found use_srtp extension" \ |
| 9994 | -c "found srtp profile" \ |
| 9995 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9996 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9997 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9998 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9999 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10000 | -C "dumping 'received mki' (8 bytes)" \ |
| 10001 | -C "error" |
| 10002 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10003 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10005 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10006 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10007 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10008 | 0 \ |
| 10009 | -s "found use_srtp extension" \ |
| 10010 | -s "found srtp profile" \ |
| 10011 | -s "selected srtp profile" \ |
| 10012 | -s "server hello, adding use_srtp extension" \ |
| 10013 | -s "DTLS-SRTP key material is"\ |
| 10014 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10015 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10016 | |
| 10017 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10019 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10020 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10021 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10022 | 0 \ |
| 10023 | -s "found use_srtp extension" \ |
| 10024 | -s "found srtp profile" \ |
| 10025 | -s "selected srtp profile" \ |
| 10026 | -s "server hello, adding use_srtp extension" \ |
| 10027 | -s "DTLS-SRTP key material is"\ |
| 10028 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10029 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10030 | |
| 10031 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10033 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10034 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10035 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10036 | 0 \ |
| 10037 | -s "found use_srtp extension" \ |
| 10038 | -s "found srtp profile" \ |
| 10039 | -s "selected srtp profile" \ |
| 10040 | -s "server hello, adding use_srtp extension" \ |
| 10041 | -s "DTLS-SRTP key material is"\ |
| 10042 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10043 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10044 | |
| 10045 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10046 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10047 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10048 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10049 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10050 | 0 \ |
| 10051 | -s "found use_srtp extension" \ |
| 10052 | -s "found srtp profile" \ |
| 10053 | -s "selected srtp profile" \ |
| 10054 | -s "server hello, adding use_srtp extension" \ |
| 10055 | -s "DTLS-SRTP key material is"\ |
| 10056 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10057 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10058 | |
| 10059 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10061 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10062 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10063 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10064 | 0 \ |
| 10065 | -s "found use_srtp extension" \ |
| 10066 | -s "found srtp profile" \ |
| 10067 | -s "selected srtp profile" \ |
| 10068 | -s "server hello, adding use_srtp extension" \ |
| 10069 | -s "DTLS-SRTP key material is"\ |
| 10070 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10071 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10072 | |
| 10073 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10075 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10076 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10077 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10078 | 0 \ |
| 10079 | -s "found use_srtp extension" \ |
| 10080 | -s "found srtp profile" \ |
| 10081 | -S "selected srtp profile" \ |
| 10082 | -S "server hello, adding use_srtp extension" \ |
| 10083 | -S "DTLS-SRTP key material is"\ |
| 10084 | -C "SRTP Extension negotiated, profile" |
| 10085 | |
| 10086 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10088 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10089 | "$P_SRV dtls=1 debug_level=3" \ |
| 10090 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10091 | 0 \ |
| 10092 | -s "found use_srtp extension" \ |
| 10093 | -S "server hello, adding use_srtp extension" \ |
| 10094 | -S "DTLS-SRTP key material is"\ |
| 10095 | -C "SRTP Extension negotiated, profile" |
| 10096 | |
| 10097 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10099 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10100 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10101 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10102 | 0 \ |
| 10103 | -c "client hello, adding use_srtp extension" \ |
| 10104 | -c "found use_srtp extension" \ |
| 10105 | -c "found srtp profile" \ |
| 10106 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10107 | -c "DTLS-SRTP key material is"\ |
| 10108 | -C "error" |
| 10109 | |
| 10110 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10112 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10113 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10114 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10115 | 0 \ |
| 10116 | -c "client hello, adding use_srtp extension" \ |
| 10117 | -c "found use_srtp extension" \ |
| 10118 | -c "found srtp profile" \ |
| 10119 | -c "selected srtp profile" \ |
| 10120 | -c "DTLS-SRTP key material is"\ |
| 10121 | -C "error" |
| 10122 | |
| 10123 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10125 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10126 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10127 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10128 | 0 \ |
| 10129 | -c "client hello, adding use_srtp extension" \ |
| 10130 | -c "found use_srtp extension" \ |
| 10131 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10132 | -c "selected srtp profile" \ |
| 10133 | -c "DTLS-SRTP key material is"\ |
| 10134 | -C "error" |
| 10135 | |
| 10136 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10138 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10139 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10140 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10141 | 0 \ |
| 10142 | -c "client hello, adding use_srtp extension" \ |
| 10143 | -c "found use_srtp extension" \ |
| 10144 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10145 | -c "selected srtp profile" \ |
| 10146 | -c "DTLS-SRTP key material is"\ |
| 10147 | -C "error" |
| 10148 | |
| 10149 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10151 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10152 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10153 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10154 | 0 \ |
| 10155 | -c "client hello, adding use_srtp extension" \ |
| 10156 | -c "found use_srtp extension" \ |
| 10157 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10158 | -c "selected srtp profile" \ |
| 10159 | -c "DTLS-SRTP key material is"\ |
| 10160 | -C "error" |
| 10161 | |
| 10162 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10164 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10165 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10166 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10167 | 0 \ |
| 10168 | -c "client hello, adding use_srtp extension" \ |
| 10169 | -C "found use_srtp extension" \ |
| 10170 | -C "found srtp profile" \ |
| 10171 | -C "selected srtp profile" \ |
| 10172 | -C "DTLS-SRTP key material is"\ |
| 10173 | -C "error" |
| 10174 | |
| 10175 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10177 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10178 | "$O_SRV -dtls" \ |
| 10179 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10180 | 0 \ |
| 10181 | -c "client hello, adding use_srtp extension" \ |
| 10182 | -C "found use_srtp extension" \ |
| 10183 | -C "found srtp profile" \ |
| 10184 | -C "selected srtp profile" \ |
| 10185 | -C "DTLS-SRTP key material is"\ |
| 10186 | -C "error" |
| 10187 | |
| 10188 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10190 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10191 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10192 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10193 | 0 \ |
| 10194 | -c "client hello, adding use_srtp extension" \ |
| 10195 | -c "found use_srtp extension" \ |
| 10196 | -c "found srtp profile" \ |
| 10197 | -c "selected srtp profile" \ |
| 10198 | -c "DTLS-SRTP key material is"\ |
| 10199 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10200 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10201 | -C "dumping 'received mki' (8 bytes)" \ |
| 10202 | -C "error" |
| 10203 | |
| 10204 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10205 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10207 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10208 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10209 | "$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] | 10210 | 0 \ |
| 10211 | -s "found use_srtp extension" \ |
| 10212 | -s "found srtp profile" \ |
| 10213 | -s "selected srtp profile" \ |
| 10214 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10215 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10216 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10217 | |
| 10218 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10219 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10220 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10221 | 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] | 10222 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10223 | "$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] | 10224 | 0 \ |
| 10225 | -s "found use_srtp extension" \ |
| 10226 | -s "found srtp profile" \ |
| 10227 | -s "selected srtp profile" \ |
| 10228 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10229 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10230 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10231 | |
| 10232 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10233 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10235 | 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] | 10236 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10237 | "$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] | 10238 | 0 \ |
| 10239 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10240 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10241 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10242 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10243 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10244 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10245 | |
| 10246 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10247 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10249 | 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] | 10250 | "$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] | 10251 | "$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] | 10252 | 0 \ |
| 10253 | -s "found use_srtp extension" \ |
| 10254 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10255 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10256 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10257 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10258 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10259 | |
| 10260 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10261 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10263 | 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] | 10264 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10265 | "$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] | 10266 | 0 \ |
| 10267 | -s "found use_srtp extension" \ |
| 10268 | -s "found srtp profile" \ |
| 10269 | -s "selected srtp profile" \ |
| 10270 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10271 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10272 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10273 | |
| 10274 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10275 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10277 | 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] | 10278 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10279 | "$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] | 10280 | 0 \ |
| 10281 | -s "found use_srtp extension" \ |
| 10282 | -s "found srtp profile" \ |
| 10283 | -S "selected srtp profile" \ |
| 10284 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10285 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10286 | -C "SRTP profile:" |
| 10287 | |
| 10288 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10289 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10291 | 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] | 10292 | "$P_SRV dtls=1 debug_level=3" \ |
| 10293 | "$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] | 10294 | 0 \ |
| 10295 | -s "found use_srtp extension" \ |
| 10296 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10297 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10298 | -C "SRTP profile:" |
| 10299 | |
| 10300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10301 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10303 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10304 | "$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" \ |
| 10305 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10306 | 0 \ |
| 10307 | -c "client hello, adding use_srtp extension" \ |
| 10308 | -c "found use_srtp extension" \ |
| 10309 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10310 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10311 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10312 | -C "error" |
| 10313 | |
| 10314 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10315 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10316 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10317 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10318 | "$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" \ |
| 10319 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10320 | 0 \ |
| 10321 | -c "client hello, adding use_srtp extension" \ |
| 10322 | -c "found use_srtp extension" \ |
| 10323 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10324 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10325 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10326 | -C "error" |
| 10327 | |
| 10328 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10329 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10331 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10332 | "$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" \ |
| 10333 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10334 | 0 \ |
| 10335 | -c "client hello, adding use_srtp extension" \ |
| 10336 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10337 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10338 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10339 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10340 | -C "error" |
| 10341 | |
| 10342 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10343 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10345 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10346 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10347 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10348 | 0 \ |
| 10349 | -c "client hello, adding use_srtp extension" \ |
| 10350 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10351 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10352 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10353 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10354 | -C "error" |
| 10355 | |
| 10356 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10357 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10359 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10360 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10361 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10362 | 0 \ |
| 10363 | -c "client hello, adding use_srtp extension" \ |
| 10364 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10365 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10366 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10367 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10368 | -C "error" |
| 10369 | |
| 10370 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10371 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10373 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10374 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10375 | "$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] | 10376 | 0 \ |
| 10377 | -c "client hello, adding use_srtp extension" \ |
| 10378 | -C "found use_srtp extension" \ |
| 10379 | -C "found srtp profile" \ |
| 10380 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10381 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10382 | -C "error" |
| 10383 | |
| 10384 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10385 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10387 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10388 | "$G_SRV -u" \ |
| 10389 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10390 | 0 \ |
| 10391 | -c "client hello, adding use_srtp extension" \ |
| 10392 | -C "found use_srtp extension" \ |
| 10393 | -C "found srtp profile" \ |
| 10394 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10395 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10396 | -C "error" |
| 10397 | |
| 10398 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10399 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10401 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10402 | "$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" \ |
| 10403 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10404 | 0 \ |
| 10405 | -c "client hello, adding use_srtp extension" \ |
| 10406 | -c "found use_srtp extension" \ |
| 10407 | -c "found srtp profile" \ |
| 10408 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10409 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10410 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10411 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10412 | -c "dumping 'received mki' (8 bytes)" \ |
| 10413 | -C "error" |
| 10414 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10415 | # Tests for specific things with "unreliable" UDP connection |
| 10416 | |
| 10417 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10419 | run_test "DTLS proxy: reference" \ |
| 10420 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10421 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10422 | "$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] | 10423 | 0 \ |
| 10424 | -C "replayed record" \ |
| 10425 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10426 | -C "Buffer record from epoch" \ |
| 10427 | -S "Buffer record from epoch" \ |
| 10428 | -C "ssl_buffer_message" \ |
| 10429 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10430 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10431 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10432 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10433 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10434 | -c "HTTP/1.0 200 OK" |
| 10435 | |
| 10436 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10438 | run_test "DTLS proxy: duplicate every packet" \ |
| 10439 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10440 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10441 | "$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] | 10442 | 0 \ |
| 10443 | -c "replayed record" \ |
| 10444 | -s "replayed record" \ |
| 10445 | -c "record from another epoch" \ |
| 10446 | -s "record from another epoch" \ |
| 10447 | -S "resend" \ |
| 10448 | -s "Extra-header:" \ |
| 10449 | -c "HTTP/1.0 200 OK" |
| 10450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10452 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10453 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10454 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10455 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10456 | 0 \ |
| 10457 | -c "replayed record" \ |
| 10458 | -S "replayed record" \ |
| 10459 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10460 | -s "record from another epoch" \ |
| 10461 | -c "resend" \ |
| 10462 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10463 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10464 | -c "HTTP/1.0 200 OK" |
| 10465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10467 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10468 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10469 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10470 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10471 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10472 | -c "next record in same datagram" \ |
| 10473 | -s "next record in same datagram" |
| 10474 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10475 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10476 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10477 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10478 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10479 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10480 | 0 \ |
| 10481 | -c "next record in same datagram" \ |
| 10482 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10485 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10486 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10487 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10488 | "$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] | 10489 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10490 | -c "discarding invalid record (mac)" \ |
| 10491 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10492 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10493 | -c "HTTP/1.0 200 OK" \ |
| 10494 | -S "too many records with bad MAC" \ |
| 10495 | -S "Verification of the message MAC failed" |
| 10496 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10497 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10498 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10499 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10500 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10501 | "$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] | 10502 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10503 | -C "discarding invalid record (mac)" \ |
| 10504 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10505 | -S "Extra-header:" \ |
| 10506 | -C "HTTP/1.0 200 OK" \ |
| 10507 | -s "too many records with bad MAC" \ |
| 10508 | -s "Verification of the message MAC failed" |
| 10509 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10511 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10512 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10513 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10514 | "$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] | 10515 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10516 | -c "discarding invalid record (mac)" \ |
| 10517 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10518 | -s "Extra-header:" \ |
| 10519 | -c "HTTP/1.0 200 OK" \ |
| 10520 | -S "too many records with bad MAC" \ |
| 10521 | -S "Verification of the message MAC failed" |
| 10522 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10524 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10525 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10526 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10527 | "$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] | 10528 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10529 | -c "discarding invalid record (mac)" \ |
| 10530 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10531 | -s "Extra-header:" \ |
| 10532 | -c "HTTP/1.0 200 OK" \ |
| 10533 | -s "too many records with bad MAC" \ |
| 10534 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10535 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10537 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10538 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10539 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10540 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10541 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10542 | -c "record from another epoch" \ |
| 10543 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10544 | -s "Extra-header:" \ |
| 10545 | -c "HTTP/1.0 200 OK" |
| 10546 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10547 | # Tests for reordering support with DTLS |
| 10548 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10549 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10551 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10552 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10553 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10554 | hs_timeout=2500-60000" \ |
| 10555 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10556 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10557 | 0 \ |
| 10558 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10559 | -c "Next handshake message has been buffered - load"\ |
| 10560 | -S "Buffering HS message" \ |
| 10561 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10562 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10563 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10564 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10565 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10566 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10567 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10569 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10570 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10571 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10572 | hs_timeout=2500-60000" \ |
| 10573 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10574 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10575 | 0 \ |
| 10576 | -c "Buffering HS message" \ |
| 10577 | -c "found fragmented DTLS handshake message"\ |
| 10578 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10579 | -c "Next handshake message has been buffered - load"\ |
| 10580 | -S "Buffering HS message" \ |
| 10581 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10582 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10583 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10584 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10585 | -S "Remember CCS message" |
| 10586 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10587 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10588 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10589 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10590 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10591 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10592 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10594 | 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] | 10595 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10596 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10597 | hs_timeout=2500-60000" \ |
| 10598 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10599 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10600 | 0 \ |
| 10601 | -c "Buffering HS message" \ |
| 10602 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10603 | -C "attempt to make space by freeing buffered messages" \ |
| 10604 | -S "Buffering HS message" \ |
| 10605 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10606 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10607 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10608 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10609 | -S "Remember CCS message" |
| 10610 | |
| 10611 | # The size constraints ensure that the delayed certificate message can't |
| 10612 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10613 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10614 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10615 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10616 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10618 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10619 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10620 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10621 | hs_timeout=2500-60000" \ |
| 10622 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10623 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10624 | 0 \ |
| 10625 | -c "Buffering HS message" \ |
| 10626 | -c "attempt to make space by freeing buffered future messages" \ |
| 10627 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10628 | -S "Buffering HS message" \ |
| 10629 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10630 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10631 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10632 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10633 | -S "Remember CCS message" |
| 10634 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10635 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10637 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10638 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10639 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10640 | hs_timeout=2500-60000" \ |
| 10641 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10642 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10643 | 0 \ |
| 10644 | -C "Buffering HS message" \ |
| 10645 | -C "Next handshake message has been buffered - load"\ |
| 10646 | -s "Buffering HS message" \ |
| 10647 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10648 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10649 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10650 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10651 | -S "Remember CCS message" |
| 10652 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10653 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10655 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10656 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10657 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10658 | hs_timeout=2500-60000" \ |
| 10659 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10660 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10661 | 0 \ |
| 10662 | -C "Buffering HS message" \ |
| 10663 | -C "Next handshake message has been buffered - load"\ |
| 10664 | -S "Buffering HS message" \ |
| 10665 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10666 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10667 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10668 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10669 | -S "Remember CCS message" |
| 10670 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10671 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10673 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10674 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10675 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10676 | hs_timeout=2500-60000" \ |
| 10677 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10678 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10679 | 0 \ |
| 10680 | -C "Buffering HS message" \ |
| 10681 | -C "Next handshake message has been buffered - load"\ |
| 10682 | -S "Buffering HS message" \ |
| 10683 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10684 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10685 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10686 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10687 | -s "Remember CCS message" |
| 10688 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10690 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10691 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10692 | "$P_SRV dgram_packing=0 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 | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10696 | 0 \ |
| 10697 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10698 | -s "Found buffered record from current epoch - load" \ |
| 10699 | -c "Buffer record from epoch 1" \ |
| 10700 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10701 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10702 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10703 | # from the server are delayed, so that the encrypted Finished message |
| 10704 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10705 | # in afterwards, the encrypted Finished message must be freed in order |
| 10706 | # to make space for the NewSessionTicket to be reassembled. |
| 10707 | # This works only in very particular circumstances: |
| 10708 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10709 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10710 | # the encrypted Finished message. |
| 10711 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10712 | # needs to be fragmented. |
| 10713 | # - All messages sent by the server must be small enough to be either sent |
| 10714 | # without fragmentation or be reassembled within the bounds of |
| 10715 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10716 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10717 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10718 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10720 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10721 | -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] | 10722 | "$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] | 10723 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10724 | 0 \ |
| 10725 | -s "Buffer record from epoch 1" \ |
| 10726 | -s "Found buffered record from current epoch - load" \ |
| 10727 | -c "Buffer record from epoch 1" \ |
| 10728 | -C "Found buffered record from current epoch - load" \ |
| 10729 | -c "Enough space available after freeing future epoch record" |
| 10730 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10731 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10732 | |
| 10733 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10735 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10736 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10737 | "$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] | 10738 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10739 | "$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] | 10740 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10741 | 0 \ |
| 10742 | -s "Extra-header:" \ |
| 10743 | -c "HTTP/1.0 200 OK" |
| 10744 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10745 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10746 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10747 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10748 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10749 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10750 | "$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] | 10751 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10752 | 0 \ |
| 10753 | -s "Extra-header:" \ |
| 10754 | -c "HTTP/1.0 200 OK" |
| 10755 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10756 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10758 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10759 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10760 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10761 | "$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] | 10762 | 0 \ |
| 10763 | -s "Extra-header:" \ |
| 10764 | -c "HTTP/1.0 200 OK" |
| 10765 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10766 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10768 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10769 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10770 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10771 | "$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] | 10772 | 0 \ |
| 10773 | -s "Extra-header:" \ |
| 10774 | -c "HTTP/1.0 200 OK" |
| 10775 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10776 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10778 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10779 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10780 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10781 | "$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] | 10782 | 0 \ |
| 10783 | -s "Extra-header:" \ |
| 10784 | -c "HTTP/1.0 200 OK" |
| 10785 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 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 | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10788 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 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=1 auth_mode=required" \ |
| 10791 | "$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] | 10792 | 0 \ |
| 10793 | -s "Extra-header:" \ |
| 10794 | -c "HTTP/1.0 200 OK" |
| 10795 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10796 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10798 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10799 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10800 | "$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] | 10801 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10802 | "$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] | 10803 | 0 \ |
| 10804 | -s "Extra-header:" \ |
| 10805 | -c "HTTP/1.0 200 OK" |
| 10806 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10807 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10809 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10810 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10811 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10812 | "$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] | 10813 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10814 | "$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] | 10815 | 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] | 10816 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10817 | 0 \ |
| 10818 | -s "a session has been resumed" \ |
| 10819 | -c "a session has been resumed" \ |
| 10820 | -s "Extra-header:" \ |
| 10821 | -c "HTTP/1.0 200 OK" |
| 10822 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10823 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10825 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10826 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10827 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10828 | "$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] | 10829 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10830 | "$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] | 10831 | 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] | 10832 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10833 | 0 \ |
| 10834 | -s "a session has been resumed" \ |
| 10835 | -c "a session has been resumed" \ |
| 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 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10840 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10842 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10843 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10844 | "$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] | 10845 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10846 | "$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] | 10847 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10848 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10849 | 0 \ |
| 10850 | -c "=> renegotiate" \ |
| 10851 | -s "=> renegotiate" \ |
| 10852 | -s "Extra-header:" \ |
| 10853 | -c "HTTP/1.0 200 OK" |
| 10854 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10855 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10856 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10858 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10859 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10860 | "$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] | 10861 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10862 | "$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] | 10863 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10864 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10865 | 0 \ |
| 10866 | -c "=> renegotiate" \ |
| 10867 | -s "=> renegotiate" \ |
| 10868 | -s "Extra-header:" \ |
| 10869 | -c "HTTP/1.0 200 OK" |
| 10870 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10871 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10874 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10875 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10876 | "$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] | 10877 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10878 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10879 | "$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] | 10880 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10881 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10882 | 0 \ |
| 10883 | -c "=> renegotiate" \ |
| 10884 | -s "=> renegotiate" \ |
| 10885 | -s "Extra-header:" \ |
| 10886 | -c "HTTP/1.0 200 OK" |
| 10887 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10888 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10890 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10891 | 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] | 10892 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10893 | "$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] | 10894 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10895 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10896 | "$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] | 10897 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10898 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10899 | 0 \ |
| 10900 | -c "=> renegotiate" \ |
| 10901 | -s "=> renegotiate" \ |
| 10902 | -s "Extra-header:" \ |
| 10903 | -c "HTTP/1.0 200 OK" |
| 10904 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10905 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 10906 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 10907 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 10908 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10909 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10910 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10912 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10913 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10914 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10915 | "$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] | 10916 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10917 | -c "HTTP/1.0 200 OK" |
| 10918 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10919 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10920 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10921 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10922 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10923 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10924 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10925 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10926 | "$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] | 10927 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10928 | -c "HTTP/1.0 200 OK" |
| 10929 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10930 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10931 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10932 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10933 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10934 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10935 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10936 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10937 | "$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] | 10938 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10939 | -c "HTTP/1.0 200 OK" |
| 10940 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10941 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10942 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10943 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10945 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10946 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10947 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10948 | "$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] | 10949 | 0 \ |
| 10950 | -s "Extra-header:" \ |
| 10951 | -c "Extra-header:" |
| 10952 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10953 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10954 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10955 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10957 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10958 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10959 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10960 | "$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] | 10961 | 0 \ |
| 10962 | -s "Extra-header:" \ |
| 10963 | -c "Extra-header:" |
| 10964 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10965 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10966 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10967 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10968 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10969 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10970 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10971 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10972 | "$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] | 10973 | 0 \ |
| 10974 | -s "Extra-header:" \ |
| 10975 | -c "Extra-header:" |
| 10976 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10977 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10978 | run_test "export keys functionality" \ |
| 10979 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10980 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10981 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10982 | -c "EAP-TLS key material is:"\ |
| 10983 | -s "EAP-TLS key material is:"\ |
| 10984 | -c "EAP-TLS IV is:" \ |
| 10985 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10986 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10987 | # openssl feature tests: check if tls1.3 exists. |
| 10988 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 10989 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 10990 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 10991 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 10992 | 0 \ |
| 10993 | -c "TLS 1.3" \ |
| 10994 | -s "TLS 1.3" |
| 10995 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 10996 | # 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] | 10997 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 10998 | requires_gnutls_next_no_ticket |
| 10999 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11000 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11001 | "$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] | 11002 | "$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] | 11003 | 0 \ |
| 11004 | -s "Version: TLS1.3" \ |
| 11005 | -c "Version: TLS1.3" |
| 11006 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11007 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11008 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11010 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11011 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11012 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11013 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11014 | "$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] | 11015 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11016 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11017 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11018 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11019 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11020 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11021 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11022 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11023 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11024 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11025 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11026 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11027 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11028 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11029 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11030 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11031 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11032 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11033 | -c "=> parse certificate verify" \ |
| 11034 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11035 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11036 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11037 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11038 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11039 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11040 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11041 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11043 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11044 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11045 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11046 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11047 | "$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] | 11048 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11049 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11050 | -s "SERVER HELLO was queued" \ |
| 11051 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11052 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11053 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11054 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11055 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11056 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11057 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11058 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11059 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11060 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11061 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11062 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11063 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11064 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11065 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11066 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11067 | -c "=> parse certificate verify" \ |
| 11068 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11069 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11070 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11071 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11072 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11073 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11074 | requires_openssl_tls1_3 |
| 11075 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11076 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11077 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11078 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11079 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11080 | run_test "TLS 1.3: alpn - openssl" \ |
| 11081 | "$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] | 11082 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11083 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11084 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11085 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11086 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11087 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11088 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11089 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11090 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11091 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11092 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11093 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11094 | -c "<= ssl_tls13_process_server_hello" \ |
| 11095 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11096 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11097 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11098 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11099 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11100 | -c "=> parse certificate verify" \ |
| 11101 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11102 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11103 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11104 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11105 | -c "HTTP/1.0 200 ok" \ |
| 11106 | -c "Application Layer Protocol is h2" |
| 11107 | |
| 11108 | requires_gnutls_tls1_3 |
| 11109 | requires_gnutls_next_no_ticket |
| 11110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11111 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11112 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11113 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11114 | requires_config_enabled MBEDTLS_SSL_ALPN |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11115 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11116 | "$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] | 11117 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11118 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11119 | -s "SERVER HELLO was queued" \ |
| 11120 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11121 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11122 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11123 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11124 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11125 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11126 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11127 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11128 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11129 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11130 | -c "<= ssl_tls13_process_server_hello" \ |
| 11131 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11132 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11133 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11134 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11135 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11136 | -c "=> parse certificate verify" \ |
| 11137 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11138 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11139 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11140 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11141 | -c "HTTP/1.0 200 OK" \ |
| 11142 | -c "Application Layer Protocol is h2" |
| 11143 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11144 | requires_openssl_tls1_3 |
| 11145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11146 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11147 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11148 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 11149 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11150 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11151 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11152 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11153 | -s "found alpn extension" \ |
| 11154 | -s "server side, adding alpn extension" \ |
| 11155 | -s "Protocol is TLSv1.3" \ |
| 11156 | -s "HTTP/1.0 200 OK" \ |
| 11157 | -s "Application Layer Protocol is h2" |
| 11158 | |
| 11159 | requires_gnutls_tls1_3 |
| 11160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11161 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11162 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11163 | requires_config_enabled MBEDTLS_SSL_ALPN |
| 11164 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11165 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11166 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11167 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11168 | -s "found alpn extension" \ |
| 11169 | -s "server side, adding alpn extension" \ |
| 11170 | -s "Protocol is TLSv1.3" \ |
| 11171 | -s "HTTP/1.0 200 OK" \ |
| 11172 | -s "Application Layer Protocol is h2" |
| 11173 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11175 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11176 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11177 | skip_handshake_stage_check |
| 11178 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11179 | 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] | 11180 | "$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] | 11181 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11182 | 1 \ |
| 11183 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11184 | -S "Version: TLS1.0" \ |
| 11185 | -C "Protocol is TLSv1.0" |
| 11186 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11188 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11189 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11190 | skip_handshake_stage_check |
| 11191 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11192 | 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] | 11193 | "$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] | 11194 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11195 | 1 \ |
| 11196 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11197 | -S "Version: TLS1.1" \ |
| 11198 | -C "Protocol is TLSv1.1" |
| 11199 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11201 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11202 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11203 | skip_handshake_stage_check |
| 11204 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11205 | 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] | 11206 | "$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] | 11207 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11208 | 1 \ |
| 11209 | -s "Client's version: 3.3" \ |
| 11210 | -c "is a fatal alert message (msg 40)" \ |
| 11211 | -S "Version: TLS1.2" \ |
| 11212 | -C "Protocol is TLSv1.2" |
| 11213 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11214 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11215 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11216 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11217 | skip_handshake_stage_check |
| 11218 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11219 | 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] | 11220 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11221 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11222 | 1 \ |
| 11223 | -s "fatal protocol_version" \ |
| 11224 | -c "is a fatal alert message (msg 70)" \ |
| 11225 | -S "Version: TLS1.0" \ |
| 11226 | -C "Protocol : TLSv1.0" |
| 11227 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11229 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11231 | skip_handshake_stage_check |
| 11232 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11233 | 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] | 11234 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11235 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11236 | 1 \ |
| 11237 | -s "fatal protocol_version" \ |
| 11238 | -c "is a fatal alert message (msg 70)" \ |
| 11239 | -S "Version: TLS1.1" \ |
| 11240 | -C "Protocol : TLSv1.1" |
| 11241 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11243 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11244 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11245 | skip_handshake_stage_check |
| 11246 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11247 | 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] | 11248 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11249 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11250 | 1 \ |
| 11251 | -s "fatal protocol_version" \ |
| 11252 | -c "is a fatal alert message (msg 70)" \ |
| 11253 | -S "Version: TLS1.2" \ |
| 11254 | -C "Protocol : TLSv1.2" |
| 11255 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11256 | requires_openssl_tls1_3 |
| 11257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11258 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11259 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11260 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11261 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11262 | "$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] | 11263 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11264 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11265 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11266 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11267 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11268 | -c "HTTP/1.0 200 ok" \ |
| 11269 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11270 | |
| 11271 | requires_gnutls_tls1_3 |
| 11272 | requires_gnutls_next_no_ticket |
| 11273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11274 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11275 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11276 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11277 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11278 | "$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] | 11279 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11280 | 0 \ |
| 11281 | -c "got a certificate request" \ |
| 11282 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11283 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11284 | -c "HTTP/1.0 200 OK" \ |
| 11285 | -c "Protocol is TLSv1.3" |
| 11286 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11287 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11288 | requires_openssl_tls1_3 |
| 11289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11290 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11291 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11292 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11293 | "$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] | 11294 | "$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] | 11295 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11296 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11297 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11298 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11299 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11300 | |
| 11301 | requires_gnutls_tls1_3 |
| 11302 | requires_gnutls_next_no_ticket |
| 11303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11304 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11305 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11306 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11307 | "$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] | 11308 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11309 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11310 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11311 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11312 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11313 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11314 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11315 | |
| 11316 | requires_openssl_tls1_3 |
| 11317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11320 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11321 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11322 | "$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] | 11323 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11324 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11325 | 0 \ |
| 11326 | -c "got a certificate request" \ |
| 11327 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11328 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11329 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11330 | |
| 11331 | requires_gnutls_tls1_3 |
| 11332 | requires_gnutls_next_no_ticket |
| 11333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11334 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11335 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11336 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11337 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11338 | "$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] | 11339 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11340 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11341 | 0 \ |
| 11342 | -c "got a certificate request" \ |
| 11343 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11344 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11345 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11346 | |
| 11347 | requires_openssl_tls1_3 |
| 11348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11349 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11350 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11351 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11352 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11353 | "$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] | 11354 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11355 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11356 | 0 \ |
| 11357 | -c "got a certificate request" \ |
| 11358 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11359 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11360 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11361 | |
| 11362 | requires_gnutls_tls1_3 |
| 11363 | requires_gnutls_next_no_ticket |
| 11364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11365 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11366 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11367 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11368 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11369 | "$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] | 11370 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11371 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11372 | 0 \ |
| 11373 | -c "got a certificate request" \ |
| 11374 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11375 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11376 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11377 | |
| 11378 | requires_openssl_tls1_3 |
| 11379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11380 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11381 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11382 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11383 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11384 | "$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] | 11385 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11386 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11387 | 0 \ |
| 11388 | -c "got a certificate request" \ |
| 11389 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11390 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11391 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11392 | |
| 11393 | requires_gnutls_tls1_3 |
| 11394 | requires_gnutls_next_no_ticket |
| 11395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11396 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11397 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11398 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11399 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11400 | "$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] | 11401 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11402 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11403 | 0 \ |
| 11404 | -c "got a certificate request" \ |
| 11405 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11406 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11407 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11408 | |
| 11409 | requires_openssl_tls1_3 |
| 11410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11411 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11412 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11413 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11414 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11415 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11416 | "$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] | 11417 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11418 | 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] | 11419 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11420 | -c "got a certificate request" \ |
| 11421 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11422 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11423 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11424 | |
| 11425 | requires_gnutls_tls1_3 |
| 11426 | requires_gnutls_next_no_ticket |
| 11427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11428 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11429 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11430 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11431 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11432 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11433 | "$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] | 11434 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11435 | 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] | 11436 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11437 | -c "got a certificate request" \ |
| 11438 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11439 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11440 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11441 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11442 | requires_openssl_tls1_3 |
| 11443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11444 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11445 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11446 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11447 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11448 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11449 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11450 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11451 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11452 | 0 \ |
| 11453 | -c "got a certificate request" \ |
| 11454 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11455 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11456 | -c "Protocol is TLSv1.3" |
| 11457 | |
| 11458 | requires_gnutls_tls1_3 |
| 11459 | requires_gnutls_next_no_ticket |
| 11460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11461 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11462 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11463 | requires_config_enabled MBEDTLS_RSA_C |
| 11464 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11465 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11466 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11467 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11468 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11469 | 0 \ |
| 11470 | -c "got a certificate request" \ |
| 11471 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11472 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11473 | -c "Protocol is TLSv1.3" |
| 11474 | |
| 11475 | requires_openssl_tls1_3 |
| 11476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11477 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11478 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11479 | requires_config_enabled MBEDTLS_RSA_C |
| 11480 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11481 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11482 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11483 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11484 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11485 | 0 \ |
| 11486 | -c "got a certificate request" \ |
| 11487 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11488 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11489 | -c "Protocol is TLSv1.3" |
| 11490 | |
| 11491 | requires_gnutls_tls1_3 |
| 11492 | requires_gnutls_next_no_ticket |
| 11493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11494 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11495 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11496 | requires_config_enabled MBEDTLS_RSA_C |
| 11497 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11498 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11499 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11500 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11501 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11502 | 0 \ |
| 11503 | -c "got a certificate request" \ |
| 11504 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11505 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11506 | -c "Protocol is TLSv1.3" |
| 11507 | |
| 11508 | requires_openssl_tls1_3 |
| 11509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11510 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11511 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11512 | requires_config_enabled MBEDTLS_RSA_C |
| 11513 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11514 | 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] | 11515 | "$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] | 11516 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11517 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11518 | 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] | 11519 | 1 \ |
| 11520 | -c "got a certificate request" \ |
| 11521 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11522 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11523 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11524 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11525 | |
| 11526 | requires_gnutls_tls1_3 |
| 11527 | requires_gnutls_next_no_ticket |
| 11528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11529 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11530 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11531 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11532 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11533 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11534 | "$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] | 11535 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11536 | 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] | 11537 | 1 \ |
| 11538 | -c "got a certificate request" \ |
| 11539 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11540 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11541 | -c "signature algorithm not in received or offered list." \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11542 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11543 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11544 | # Test using an opaque private key for client authentication |
| 11545 | requires_openssl_tls1_3 |
| 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_USE_PSA_CRYPTO |
| 11550 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11551 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11552 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11553 | 0 \ |
| 11554 | -c "got a certificate request" \ |
| 11555 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11556 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11557 | -c "Protocol is TLSv1.3" |
| 11558 | |
| 11559 | requires_gnutls_tls1_3 |
| 11560 | requires_gnutls_next_no_ticket |
| 11561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11562 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11563 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11564 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11565 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11566 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11567 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11568 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11569 | 0 \ |
| 11570 | -c "got a certificate request" \ |
| 11571 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11572 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11573 | -c "Protocol is TLSv1.3" |
| 11574 | |
| 11575 | requires_openssl_tls1_3 |
| 11576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11577 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11578 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11579 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11580 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11581 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11582 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11583 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11584 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11585 | 0 \ |
| 11586 | -c "got a certificate request" \ |
| 11587 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11588 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11589 | -c "Protocol is TLSv1.3" |
| 11590 | |
| 11591 | requires_gnutls_tls1_3 |
| 11592 | requires_gnutls_next_no_ticket |
| 11593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11594 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11595 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11596 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11597 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11598 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11599 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11600 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11601 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11602 | 0 \ |
| 11603 | -c "got a certificate request" \ |
| 11604 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11605 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11606 | -c "Protocol is TLSv1.3" |
| 11607 | |
| 11608 | requires_openssl_tls1_3 |
| 11609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11610 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11611 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11612 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11613 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11614 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11615 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11616 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11617 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11618 | 0 \ |
| 11619 | -c "got a certificate request" \ |
| 11620 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11621 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11622 | -c "Protocol is TLSv1.3" |
| 11623 | |
| 11624 | requires_gnutls_tls1_3 |
| 11625 | requires_gnutls_next_no_ticket |
| 11626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11627 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11628 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11629 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11630 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11631 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11632 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11633 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11634 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11635 | 0 \ |
| 11636 | -c "got a certificate request" \ |
| 11637 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11638 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11639 | -c "Protocol is TLSv1.3" |
| 11640 | |
| 11641 | requires_openssl_tls1_3 |
| 11642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11643 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11644 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11645 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11646 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11647 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11648 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11649 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11650 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11651 | 0 \ |
| 11652 | -c "got a certificate request" \ |
| 11653 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11654 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11655 | -c "Protocol is TLSv1.3" |
| 11656 | |
| 11657 | requires_gnutls_tls1_3 |
| 11658 | requires_gnutls_next_no_ticket |
| 11659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11660 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11661 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11662 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11663 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11664 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11665 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11666 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11667 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11668 | 0 \ |
| 11669 | -c "got a certificate request" \ |
| 11670 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11671 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11672 | -c "Protocol is TLSv1.3" |
| 11673 | |
| 11674 | requires_openssl_tls1_3 |
| 11675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11676 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11677 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11678 | requires_config_enabled MBEDTLS_RSA_C |
| 11679 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11680 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11681 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11682 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11683 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11684 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11685 | 0 \ |
| 11686 | -c "got a certificate request" \ |
| 11687 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11688 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11689 | -c "Protocol is TLSv1.3" |
| 11690 | |
| 11691 | requires_gnutls_tls1_3 |
| 11692 | requires_gnutls_next_no_ticket |
| 11693 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11694 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11695 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11696 | requires_config_enabled MBEDTLS_RSA_C |
| 11697 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11698 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11699 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11700 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11701 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11702 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11703 | 0 \ |
| 11704 | -c "got a certificate request" \ |
| 11705 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11706 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11707 | -c "Protocol is TLSv1.3" |
| 11708 | |
| 11709 | requires_openssl_tls1_3 |
| 11710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11711 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11712 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11713 | requires_config_enabled MBEDTLS_RSA_C |
| 11714 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11715 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11716 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11717 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11718 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11719 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11720 | 0 \ |
| 11721 | -c "got a certificate request" \ |
| 11722 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11723 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11724 | -c "Protocol is TLSv1.3" |
| 11725 | |
| 11726 | requires_gnutls_tls1_3 |
| 11727 | requires_gnutls_next_no_ticket |
| 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_sha384 - gnutls" \ |
| 11735 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11736 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11737 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 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_openssl_tls1_3 |
| 11745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11746 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11747 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11748 | requires_config_enabled MBEDTLS_RSA_C |
| 11749 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11750 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11751 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11752 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11753 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11754 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11755 | 0 \ |
| 11756 | -c "got a certificate request" \ |
| 11757 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11758 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11759 | -c "Protocol is TLSv1.3" |
| 11760 | |
| 11761 | requires_gnutls_tls1_3 |
| 11762 | requires_gnutls_next_no_ticket |
| 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_sha512 - gnutls" \ |
| 11770 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11771 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11772 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 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_openssl_tls1_3 |
| 11780 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11781 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11782 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11783 | requires_config_enabled MBEDTLS_RSA_C |
| 11784 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11785 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11786 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 11787 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 11788 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 11789 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11790 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11791 | 1 \ |
| 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 "signature algorithm not in received or offered list." \ |
| 11796 | -C "unkown pk type" |
| 11797 | |
| 11798 | requires_gnutls_tls1_3 |
| 11799 | requires_gnutls_next_no_ticket |
| 11800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11801 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11802 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11803 | requires_config_enabled MBEDTLS_RSA_C |
| 11804 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11805 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 11806 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 11807 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 11808 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11809 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 11810 | 1 \ |
| 11811 | -c "got a certificate request" \ |
| 11812 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11813 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11814 | -c "signature algorithm not in received or offered list." \ |
| 11815 | -C "unkown pk type" |
| 11816 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11818 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11819 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11820 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11821 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11822 | 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] | 11823 | "$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] | 11824 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11825 | 0 \ |
| 11826 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11827 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11828 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11829 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11830 | -c "HTTP/1.0 200 ok" |
| 11831 | |
| 11832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11833 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11834 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11835 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11836 | requires_openssl_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11837 | 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] | 11838 | "$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] | 11839 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11840 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11841 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11842 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11843 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11844 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 11845 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11846 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11848 | requires_gnutls_tls1_3 |
| 11849 | requires_gnutls_next_no_ticket |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11850 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11851 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11852 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11853 | 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] | 11854 | "$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] | 11855 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11856 | 0 \ |
| 11857 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11858 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11859 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11860 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11861 | -c "HTTP/1.0 200 OK" |
| 11862 | |
Gilles Peskine | 2ecf4ff | 2022-04-13 19:08:38 +0200 | [diff] [blame] | 11863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11864 | requires_gnutls_tls1_3 |
| 11865 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 11866 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 11867 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11868 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11869 | 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] | 11870 | "$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] | 11871 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11872 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 11873 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 11874 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11875 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11876 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 11877 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11878 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11879 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11881 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11882 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11883 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11884 | "$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] | 11885 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 11886 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11887 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11888 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11889 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11890 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11891 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11892 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11893 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 11894 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11895 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11897 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11898 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11899 | requires_openssl_tls1_3 |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11900 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11901 | "$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] | 11902 | "$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] | 11903 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11904 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11905 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11906 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11907 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11908 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11909 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11910 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11911 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11912 | -s "=> parse client hello" \ |
| 11913 | -s "<= parse client hello" |
| 11914 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11915 | requires_gnutls_tls1_3 |
| 11916 | requires_gnutls_next_no_ticket |
| 11917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11918 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 11919 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 11920 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 11921 | "$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] | 11922 | "$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] | 11923 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 11924 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11925 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11926 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11927 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 11928 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11929 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 11930 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11931 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11932 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 11933 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11934 | requires_gnutls_tls1_3 |
| 11935 | requires_gnutls_next_no_ticket |
| 11936 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11937 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11938 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11939 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11940 | "$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" \ |
| 11941 | "$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] | 11942 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11943 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11944 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11945 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11946 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11947 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 11948 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11949 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11950 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 11951 | -s "=> parse client hello" \ |
| 11952 | -s "<= parse client hello" |
| 11953 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11955 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11956 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 11957 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11958 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 11959 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 11960 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 11961 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11962 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11963 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11964 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11965 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 11966 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11967 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11968 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11969 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11970 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 11971 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 11972 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11973 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11974 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11975 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11976 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 11977 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11978 | "$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" \ |
| 11979 | "$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] | 11980 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11981 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11982 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11983 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11984 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 11985 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11986 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 11987 | -s "=> parse client hello" \ |
| 11988 | -s "<= parse client hello" |
| 11989 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 11990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11991 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11992 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 11993 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11994 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 11995 | "$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" \ |
| 11996 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 11997 | 1 \ |
| 11998 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 11999 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12000 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12001 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12002 | -s "=> write certificate request" \ |
| 12003 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12004 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12005 | -s "=> parse client hello" \ |
| 12006 | -s "<= parse client hello" |
| 12007 | |
| 12008 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12009 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12010 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12011 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12012 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12013 | "$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" \ |
| 12014 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12015 | 0 \ |
| 12016 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12017 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12018 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12019 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12020 | -s "=> write certificate request" \ |
| 12021 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12022 | -s "=> parse client hello" \ |
| 12023 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12024 | |
| 12025 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12026 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12027 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12029 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12030 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12031 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12032 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12033 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12034 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12035 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12036 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12037 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12038 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12039 | -s "=> write hello retry request" \ |
| 12040 | -s "<= write hello retry request" |
| 12041 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12043 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12044 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12045 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12046 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12047 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12048 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12049 | 1 \ |
| 12050 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12051 | -s "No certificate available." |
| 12052 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12053 | requires_openssl_tls1_3 |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12055 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12056 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12057 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12058 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12059 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12060 | 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] | 12061 | "$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" \ |
| 12062 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12063 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12064 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12065 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12066 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12068 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12069 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12070 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12071 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12072 | "$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] | 12073 | 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] | 12074 | "$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" \ |
| 12075 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12076 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12077 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12078 | |
| 12079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12080 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12081 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12082 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12083 | requires_config_enabled MBEDTLS_SSL_CLI_C |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12084 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12085 | "$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 \ |
| 12086 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12087 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12088 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12089 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12090 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12091 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12092 | |
XiaokangQian | eb69aee | 2022-07-05 08:21:43 +0000 | [diff] [blame] | 12093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12094 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12095 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12096 | run_test "TLS 1.3, default suite, PSK" \ |
| 12097 | "$P_SRV nbio=2 debug_level=5 force_version=tls13 psk=010203 psk_identity=0a0b0c tls13_kex_modes=psk" \ |
| 12098 | "$P_CLI nbio=2 debug_level=5 force_version=tls13 psk=010203 psk_identity=0a0b0c tls13_kex_modes=psk" \ |
| 12099 | 1 \ |
| 12100 | -c "=> write client hello" \ |
| 12101 | -c "client hello, adding pre_shared_key extension, omitting PSK binder list" \ |
| 12102 | -c "client hello, adding psk_key_exchange_modes extension" \ |
| 12103 | -c "client hello, adding PSK binder list" \ |
| 12104 | -c "<= write client hello" |
| 12105 | |
XiaokangQian | adab9a6 | 2022-07-18 07:41:26 +0000 | [diff] [blame] | 12106 | requires_openssl_tls1_3 |
| 12107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12108 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12109 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12110 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12111 | run_test "TLS 1.3, default suite, PSK - openssl" \ |
| 12112 | "$O_NEXT_SRV -msg -debug -tls1_3 -psk_identity 0a0b0c -psk 010203 -allow_no_dhe_kex -nocert" \ |
XiaokangQian | 088c929 | 2022-07-20 10:43:34 +0000 | [diff] [blame] | 12113 | "$P_CLI debug_level=4 psk=010203 psk_identity=0a0b0c tls13_kex_modes=psk" \ |
XiaokangQian | adab9a6 | 2022-07-18 07:41:26 +0000 | [diff] [blame] | 12114 | 1 \ |
| 12115 | -c "=> write client hello" \ |
| 12116 | -c "client hello, adding pre_shared_key extension, omitting PSK binder list" \ |
| 12117 | -c "client hello, adding psk_key_exchange_modes extension" \ |
| 12118 | -c "client hello, adding PSK binder list" \ |
| 12119 | -c "<= write client hello" |
| 12120 | |
| 12121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12122 | requires_gnutls_tls1_3 |
| 12123 | requires_gnutls_next_no_ticket |
| 12124 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12125 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12126 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12127 | run_test "TLS 1.3, default suite, PSK - gnutls" \ |
| 12128 | "$G_NEXT_SRV -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+CIPHER-ALL:%NO_TICKETS --pskhint=0a0b0c" \ |
XiaokangQian | 088c929 | 2022-07-20 10:43:34 +0000 | [diff] [blame] | 12129 | "$P_CLI debug_level=4 psk=010203 psk_identity=0a0b0c tls13_kex_modes=psk" \ |
XiaokangQian | adab9a6 | 2022-07-18 07:41:26 +0000 | [diff] [blame] | 12130 | 1 \ |
| 12131 | -c "=> write client hello" \ |
| 12132 | -c "client hello, adding pre_shared_key extension, omitting PSK binder list" \ |
| 12133 | -c "client hello, adding psk_key_exchange_modes extension" \ |
| 12134 | -c "client hello, adding PSK binder list" \ |
XiaokangQian | 3ad67bf | 2022-07-21 02:26:21 +0000 | [diff] [blame] | 12135 | -s "Parsing extension 'PSK Key Exchange Modes/45'" \ |
| 12136 | -s "Parsing extension 'Pre Shared Key/41'" \ |
XiaokangQian | adab9a6 | 2022-07-18 07:41:26 +0000 | [diff] [blame] | 12137 | -c "<= write client hello" |
| 12138 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12139 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12140 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12141 | TEST_SUITE_NAME=${i##*/} |
| 12142 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12143 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12144 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12145 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12146 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12147 | # Test 1.3 compatibility mode |
| 12148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12149 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12150 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12151 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12152 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12153 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12154 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12155 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12156 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12157 | -s "Protocol is TLSv1.3" \ |
| 12158 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12159 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12160 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12161 | |
| 12162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12163 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12165 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12166 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12167 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12168 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12169 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12170 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12171 | -s "Protocol is TLSv1.3" \ |
| 12172 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12173 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12174 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12175 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12176 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12178 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12179 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12180 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12181 | 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] | 12182 | "$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] | 12183 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12184 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12185 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12186 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12187 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12188 | |
| 12189 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12191 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12192 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12193 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12194 | 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] | 12195 | "$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] | 12196 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12197 | 1 \ |
| 12198 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12199 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12200 | requires_openssl_tls1_3 |
| 12201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12202 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12203 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12204 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12205 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12206 | "$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] | 12207 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12208 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12209 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12210 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12211 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12212 | requires_gnutls_tls1_3 |
| 12213 | requires_gnutls_next_no_ticket |
| 12214 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12216 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12217 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12218 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12219 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12220 | "$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] | 12221 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12222 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12223 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12224 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12225 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12226 | |
| 12227 | requires_gnutls_tls1_3 |
| 12228 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 12229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12230 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12231 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12232 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12233 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12234 | "$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] | 12235 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12236 | 1 \ |
| 12237 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12238 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12239 | requires_gnutls_tls1_3 |
| 12240 | requires_gnutls_next_no_ticket |
| 12241 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12242 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12243 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12244 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12245 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12246 | "$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] | 12247 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12248 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12249 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12250 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12251 | |
| 12252 | requires_openssl_tls1_3 |
| 12253 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12254 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12256 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12257 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12258 | "$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] | 12259 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12260 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12261 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12262 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12263 | -C "14 03 03 00 01" |
| 12264 | |
| 12265 | requires_openssl_tls1_3 |
| 12266 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12267 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12268 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12269 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12270 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12271 | "$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] | 12272 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12273 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12274 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12275 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12276 | |
| 12277 | requires_openssl_tls1_3 |
| 12278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12279 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12280 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12281 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12282 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12283 | "$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] | 12284 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12285 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12286 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12287 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12288 | -c "14 03 03 00 01" |
| 12289 | |
| 12290 | requires_gnutls_tls1_3 |
| 12291 | requires_gnutls_next_no_ticket |
| 12292 | requires_gnutls_next_disable_tls13_compat |
| 12293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12294 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12295 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12296 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12297 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12298 | "$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] | 12299 | "$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] | 12300 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12301 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12302 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12303 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12304 | |
| 12305 | requires_gnutls_tls1_3 |
| 12306 | requires_gnutls_next_no_ticket |
| 12307 | requires_gnutls_next_disable_tls13_compat |
| 12308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12309 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12310 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12311 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12312 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12313 | "$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] | 12314 | "$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] | 12315 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12316 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12317 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12318 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12319 | -c "discarding change cipher spec in TLS1.3" |
| 12320 | |
| 12321 | requires_gnutls_tls1_3 |
| 12322 | requires_gnutls_next_no_ticket |
| 12323 | requires_gnutls_next_disable_tls13_compat |
| 12324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12325 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12326 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12327 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12328 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12329 | "$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] | 12330 | "$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] | 12331 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12332 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12333 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12334 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12335 | |
| 12336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12337 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12338 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12339 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12340 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12341 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12342 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12343 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12344 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12345 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12346 | -c "Protocol is TLSv1.3" \ |
| 12347 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12348 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12349 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12350 | |
| 12351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12352 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12353 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12354 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12355 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12356 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12357 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12358 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12359 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12360 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12361 | -c "Protocol is TLSv1.3" \ |
| 12362 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12363 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12364 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12365 | |
| 12366 | requires_openssl_tls1_3 |
| 12367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12368 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12369 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12370 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12371 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12372 | "$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] | 12373 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12374 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12375 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12376 | -c "received HelloRetryRequest message" \ |
| 12377 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12378 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12379 | |
| 12380 | requires_openssl_tls1_3 |
| 12381 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12382 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12383 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12384 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12385 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12386 | "$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] | 12387 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12388 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12389 | -c "received HelloRetryRequest message" \ |
| 12390 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12391 | |
| 12392 | requires_openssl_tls1_3 |
| 12393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12394 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12395 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12396 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12397 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12398 | "$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] | 12399 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12400 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12401 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12402 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12403 | |
| 12404 | requires_gnutls_tls1_3 |
| 12405 | requires_gnutls_next_no_ticket |
| 12406 | requires_gnutls_next_disable_tls13_compat |
| 12407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12408 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12409 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12410 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12411 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12412 | "$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] | 12413 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12414 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12415 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12416 | -c "received HelloRetryRequest message" \ |
| 12417 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12418 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12419 | |
| 12420 | requires_gnutls_tls1_3 |
| 12421 | requires_gnutls_next_no_ticket |
| 12422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12423 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12424 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12425 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12426 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12427 | "$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] | 12428 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12429 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12430 | -c "received HelloRetryRequest message" \ |
| 12431 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12432 | |
| 12433 | requires_gnutls_tls1_3 |
| 12434 | requires_gnutls_next_no_ticket |
| 12435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12436 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12437 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12438 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12439 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12440 | "$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] | 12441 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12442 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12443 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12444 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12445 | |
| 12446 | requires_openssl_tls1_3 |
| 12447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12448 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12449 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12450 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12451 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12452 | "$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] | 12453 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12454 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12455 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12456 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12457 | -C "14 03 03 00 01" |
| 12458 | |
| 12459 | requires_openssl_tls1_3 |
| 12460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12461 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12462 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12463 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12464 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12465 | "$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] | 12466 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12467 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12468 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12469 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12470 | |
| 12471 | requires_openssl_tls1_3 |
| 12472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12473 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12474 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12475 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12476 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12477 | "$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] | 12478 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12479 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12480 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12481 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12482 | -c "14 03 03 00 01" |
| 12483 | |
| 12484 | requires_gnutls_tls1_3 |
| 12485 | requires_gnutls_next_no_ticket |
| 12486 | requires_gnutls_next_disable_tls13_compat |
| 12487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12488 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12489 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12490 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12491 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12492 | "$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] | 12493 | "$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] | 12494 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12495 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12496 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12497 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12498 | |
| 12499 | requires_gnutls_tls1_3 |
| 12500 | requires_gnutls_next_no_ticket |
| 12501 | requires_gnutls_next_disable_tls13_compat |
| 12502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12503 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12505 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12506 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12507 | "$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] | 12508 | "$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] | 12509 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12510 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12511 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12512 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12513 | -c "discarding change cipher spec in TLS1.3" |
| 12514 | |
| 12515 | requires_gnutls_tls1_3 |
| 12516 | requires_gnutls_next_no_ticket |
| 12517 | requires_gnutls_next_disable_tls13_compat |
| 12518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12519 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12520 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12521 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12522 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12523 | "$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] | 12524 | "$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] | 12525 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12526 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12527 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12528 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12529 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12530 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12532 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12533 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12534 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12535 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12536 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12537 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12538 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12539 | "$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] | 12540 | 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] | 12541 | 0 \ |
| 12542 | -c "Protocol is TLSv1.3" \ |
| 12543 | -c "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12544 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12545 | |
| 12546 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12548 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12549 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12550 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12551 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12552 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12553 | -d 4 |
| 12554 | --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 " \ |
| 12555 | "$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] | 12556 | 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] | 12557 | 0 \ |
| 12558 | -c "Protocol is TLSv1.3" \ |
| 12559 | -c "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12560 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12561 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12563 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12564 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12565 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12566 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12567 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12568 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12569 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12570 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12571 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12572 | "$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] | 12573 | 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] | 12574 | 0 \ |
| 12575 | -c "Protocol is TLSv1.3" \ |
| 12576 | -c "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12577 | -s "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12578 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12579 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12580 | |
| 12581 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12583 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12584 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12585 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12586 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12587 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12588 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12589 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12590 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12591 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12592 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12593 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12594 | 0 \ |
| 12595 | -c "TLSv1.3" \ |
| 12596 | -s "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12597 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12598 | |
| 12599 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12601 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12602 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12603 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12604 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12605 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12606 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12607 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12608 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12609 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12610 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12611 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12612 | 0 \ |
| 12613 | -c "Negotiated version: 3.4" \ |
| 12614 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
| 12615 | -s "select_sig_alg_for_certificate_verify:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12616 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12617 | |
| 12618 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12620 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12621 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12622 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12623 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12624 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12625 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12626 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12627 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12628 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12629 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12630 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12631 | 1 \ |
| 12632 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12633 | -s "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12634 | |
| 12635 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12636 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12637 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12638 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12639 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12640 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12641 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12642 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12643 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12644 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12645 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12646 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12647 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12648 | 1 \ |
| 12649 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12650 | -s "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12651 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12653 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12654 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12655 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12656 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12657 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12658 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12659 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12660 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12661 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12662 | "$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] | 12663 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12664 | 1 \ |
| 12665 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12666 | -s "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12667 | |
| 12668 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12670 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12671 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12672 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12673 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 12674 | "$P_SRV debug_level=4 force_version=tls13 |
| 12675 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12676 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12677 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12678 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12679 | 1 \ |
| 12680 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12681 | |
| 12682 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12684 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12685 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12686 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12687 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12688 | "$P_SRV debug_level=4 force_version=tls13 |
| 12689 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12690 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12691 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12692 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12693 | 1 \ |
| 12694 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12695 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12697 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12698 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12699 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12700 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12701 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12702 | "$P_SRV debug_level=4 force_version=tls13 |
| 12703 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12704 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12705 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12706 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12707 | 1 \ |
| 12708 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12709 | |
| 12710 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12712 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12713 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12714 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12715 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12716 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12717 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12718 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12719 | "$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] | 12720 | 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] | 12721 | 1 \ |
| 12722 | -c "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12723 | |
| 12724 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12726 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12727 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12728 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12729 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12730 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12731 | -d 4 |
| 12732 | --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 " \ |
| 12733 | "$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] | 12734 | 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] | 12735 | 1 \ |
| 12736 | -c "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12737 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12739 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12740 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12741 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12742 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12743 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12744 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12745 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12746 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12747 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12748 | "$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] | 12749 | 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] | 12750 | 1 \ |
| 12751 | -c "select_sig_alg_for_certificate_verify:no suitable signature algorithm found" |
| 12752 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12753 | requires_openssl_tls1_3 |
| 12754 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12755 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12756 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12757 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12758 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
| 12759 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache " \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12760 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12761 | 0 \ |
| 12762 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | a357cf4 | 2022-07-12 05:36:45 +0000 | [diff] [blame] | 12763 | -c "MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12764 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12765 | -c "Saving session for reuse... ok" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12766 | -c "HTTP/1.0 200 ok" |
| 12767 | |
| 12768 | requires_gnutls_tls1_3 |
| 12769 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12770 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12771 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12773 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | 34e90fa | 2022-07-21 15:31:14 +0200 | [diff] [blame] | 12774 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:+PSK --disable-client-cert" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12775 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12776 | 0 \ |
| 12777 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | a357cf4 | 2022-07-12 05:36:45 +0000 | [diff] [blame] | 12778 | -c "MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12779 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12780 | -c "Saving session for reuse... ok" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12781 | -c "HTTP/1.0 200 OK" |
| 12782 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12783 | requires_openssl_tls1_3 |
| 12784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12785 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12786 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12787 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12788 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12789 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=1" \ |
| 12790 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
| 12791 | 0 \ |
| 12792 | -s "=> write NewSessionTicket msg" \ |
| 12793 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12794 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 12795 | |
| 12796 | requires_gnutls_tls1_3 |
| 12797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12798 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12799 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12800 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12801 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
| 12802 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=1" \ |
| 12803 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%DISABLE_TLS13_COMPAT_MODE -V" \ |
| 12804 | 0 \ |
| 12805 | -s "=> write NewSessionTicket msg" \ |
| 12806 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12807 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" \ |
| 12808 | -c "NEW SESSION TICKET (4) was received" |
| 12809 | |
| 12810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12811 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12812 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12813 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12814 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12815 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
| 12816 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=1" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12817 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12818 | 0 \ |
| 12819 | -c "Protocol is TLSv1.3" \ |
| 12820 | -c "MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12821 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12822 | -c "Saving session for reuse... ok" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12823 | -c "HTTP/1.0 200 OK" \ |
| 12824 | -s "=> write NewSessionTicket msg" \ |
| 12825 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET" \ |
| 12826 | -s "server state: MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH" |
| 12827 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 12828 | requires_openssl_tls1_3 |
| 12829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12830 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12831 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12832 | 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] | 12833 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12834 | -msg -tls1_2 |
| 12835 | -Verify 10 " \ |
| 12836 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12837 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12838 | min_version=tls12 max_version=tls13 " \ |
| 12839 | 0 \ |
| 12840 | -c "Protocol is TLSv1.2" \ |
| 12841 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12842 | |
| 12843 | |
| 12844 | requires_gnutls_tls1_3 |
| 12845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12846 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12847 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 12848 | 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] | 12849 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12850 | -d 4 |
| 12851 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 12852 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12853 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 12854 | min_version=tls12 max_version=tls13 " \ |
| 12855 | 0 \ |
| 12856 | -c "Protocol is TLSv1.2" \ |
| 12857 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12858 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12859 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12861 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 12862 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 12863 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 12864 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 12865 | run_tests_memory_after_hanshake |
| 12866 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 12867 | # Final report |
| 12868 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12869 | echo "------------------------------------------------------------------------" |
| 12870 | |
| 12871 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 12872 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12873 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 12874 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12875 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 12876 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 12877 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 12878 | |
| 12879 | exit $FAILS |